Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds performance insights to Postgres template #489

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions state/rds-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ Parameters:
Type: String
AllowedValues: ['true', 'false']
Default: 'false'
PerformanceInsights:
Type: String
Description: 'Enable Performance Insights in rds (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html).'
AllowedValues: [true, false]
Default: true
PerformanceInsightsRetentionPeriod:
Type: Number
Default: 7
Description: "In number of days. 0 disables retention. Allowed: 0 - 731."
MinValue: 0
MaxValue: 731
Conditions:
HasKmsKey: !Not [!Equals [!Ref ParentKmsKeyStack, '']]
HasZone: !Not [!Equals [!Ref ParentZoneStack, '']]
Expand All @@ -144,6 +155,7 @@ Conditions:
HasDBOptionGroupName: !Not [!Equals [!Ref DBOptionGroupName, '']]
HasDBParameterGroupName: !Not [!Equals [!Ref DBParameterGroupName, '']]
HasKmsKeyAndNotDBSnapshotIdentifier: !And [!Condition HasKmsKey, !Not [!Condition HasDBSnapshotIdentifier]]
HasPerformanceInsightsEnabled: !Equals [!Ref PerformanceInsights, true]
Resources:
RecordSet:
Condition: HasZone
Expand Down Expand Up @@ -198,13 +210,15 @@ Resources:
DBSnapshotIdentifier: !If [HasDBSnapshotIdentifier, !Ref DBSnapshotIdentifier, !Ref 'AWS::NoValue']
DBSubnetGroupName: !Ref DBSubnetGroup
EnableIAMDatabaseAuthentication: !Ref EnableIAMDatabaseAuthentication
EnablePerformanceInsights: !Ref PerformanceInsights
Engine: postgres
EngineVersion: !If [HasDBSnapshotIdentifier, !Ref 'AWS::NoValue', !Ref EngineVersion]
KmsKeyId: !If [HasKmsKeyAndNotDBSnapshotIdentifier, {'Fn::ImportValue': !Sub '${ParentKmsKeyStack}-KeyId'}, !Ref 'AWS::NoValue']
MasterUsername: !If [HasDBSnapshotIdentifier, !Ref 'AWS::NoValue', !Ref DBMasterUsername]
MasterUserPassword: !If [HasDBSnapshotIdentifier, !Ref 'AWS::NoValue', !Ref DBMasterUserPassword]
MultiAZ: !Ref DBMultiAZ
OptionGroupName: !If [HasDBOptionGroupName, !Ref DBOptionGroupName, !Ref 'AWS::NoValue']
PerformanceInsightsRetentionPeriod: !If [HasPerformanceInsightsEnabled, !Ref PerformanceInsightsRetentionPeriod, !Ref "AWS::NoValue"]
PreferredBackupWindow: !Ref PreferredBackupWindow
PreferredMaintenanceWindow: !Ref PreferredMaintenanceWindow
StorageType: gp2
Expand Down