From 2aeb2460fbeb8e4ffae4bd70809c60310b1f6aaa Mon Sep 17 00:00:00 2001 From: Osmar Alonso Date: Fri, 11 Sep 2020 13:18:04 +0100 Subject: [PATCH 1/2] adds performance insights option for postrges rds --- state/rds-postgres.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/state/rds-postgres.yaml b/state/rds-postgres.yaml index 7692c6512..8e0229690 100644 --- a/state/rds-postgres.yaml +++ b/state/rds-postgres.yaml @@ -135,6 +135,18 @@ Parameters: Type: String AllowedValues: ['true', 'false'] Default: 'false' + PerformanceInsights: + Type: String + AllowedValues: + - true + - false + Default: true + PerformanceInsightsRetentionPeriod: + Type: Number + Default: 7 + Description: "In number of days. 0 disables retention. Allowed: 0 - 35." + MinValue: 0 + MaxValue: 731 Conditions: HasKmsKey: !Not [!Equals [!Ref ParentKmsKeyStack, '']] HasZone: !Not [!Equals [!Ref ParentZoneStack, '']] @@ -144,6 +156,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 @@ -198,6 +211,7 @@ 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'] @@ -205,6 +219,7 @@ Resources: 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 From 3baab2edf062a3f429402efcd820f9f1359c9822 Mon Sep 17 00:00:00 2001 From: Osmar Alonso Date: Fri, 11 Sep 2020 13:29:51 +0100 Subject: [PATCH 2/2] adds description to parameter --- state/rds-postgres.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/state/rds-postgres.yaml b/state/rds-postgres.yaml index 8e0229690..ca2211409 100644 --- a/state/rds-postgres.yaml +++ b/state/rds-postgres.yaml @@ -137,14 +137,13 @@ Parameters: Default: 'false' PerformanceInsights: Type: String - AllowedValues: - - true - - false + 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 - 35." + Description: "In number of days. 0 disables retention. Allowed: 0 - 731." MinValue: 0 MaxValue: 731 Conditions: