diff --git a/src/rds.ts b/src/rds.ts index 6b3f6d8..14961fa 100644 --- a/src/rds.ts +++ b/src/rds.ts @@ -49,6 +49,8 @@ export interface PostgresProps { readonly multiAz?: boolean; readonly allocatedStorage?: number; readonly maxAllocatedStorage?: number; + readonly replicaAllocatedStorage?: number + readonly replicaMaxAllocatedStorage?: number readonly storageType?: rds.StorageType; readonly backupRetention?: number; readonly deletionProtection?: boolean; @@ -61,6 +63,9 @@ export interface PostgresProps { readonly metricTopicName?: string; readonly snsTopicCreate?: boolean; readonly storageEncrypted?: boolean; + readonly allowMajorVersionUpgrade?: boolean; + readonly autoMinorVersionUpgrade?: boolean; + readonly dbIOPS?: number; readonly tags?: Record; readonly enableAlerts?: boolean; // Flag to enable/disable all alerts (default: true) // Custom alert thresholds @@ -139,11 +144,15 @@ export class PostgresRDSCluster extends Construct { performanceInsightRetention: props.performanceInsightRetention, deleteAutomatedBackups: true, removalPolicy: RemovalPolicy.SNAPSHOT, - deletionProtection: props.deletionProtection, + deletionProtection: props.deletionProtection ?? true, cloudwatchLogsExports: ['postgresql'], copyTagsToSnapshot: true, allocatedStorage: props.allocatedStorage, maxAllocatedStorage: props.maxAllocatedStorage, + StorageType: props.storageType, + allowMajorVersionUpgrade: props.allowMajorVersionUpgrade ?? false, + autoMinorVersionUpgrade: props.autoMinorVersionUpgrade ?? false, + iops: props.dbIOPS, }; const rdsInstance = props.snapshotIdentifier ? new rds.DatabaseInstanceFromSnapshot(this, `${props.clusterName}Cluster`, { ...commonInstanceProps, @@ -154,8 +163,6 @@ export class PostgresRDSCluster extends Construct { ...commonInstanceProps, engine: props.postgresVersion, credentials: rds.Credentials.fromGeneratedSecret(props.databaseMasterUserName), - allowMajorVersionUpgrade: false, - autoMinorVersionUpgrade: true, backupRetention: props.backupRetention ? Duration.days(props.backupRetention) : Duration.days(0), storageEncrypted: props.storageEncrypted ?? false, databaseName: props.databaseName, @@ -196,6 +203,13 @@ export class PostgresRDSCluster extends Construct { for (let index = 0; index < props.readReplicas.replicas; index++) { let readReplics = new rds.DatabaseInstanceReadReplica(this, `${props.clusterName}-rreplicas-${index}`, { sourceDatabaseInstance: rdsInstance, + subnetGroup: dbSubnetGroup, + deletionProtection: props.deletionProtection, + storageEncrypted: props.storageEncrypted, + storageType: props.storageType, + autoMinorVersionUpgrade: props.allowMajorVersionUpgrade ?? false, + allocatedStorage: props.replicaAllocatedStorage ?? props.allocatedStorage, + maxAllocatedStorage: props.replicaMaxAllocatedStorage ?? props.maxAllocatedStorage, instanceIdentifier: `${props.clusterName}-rreplicas-${index}`, instanceType: props.readReplicas.instanceType, enablePerformanceInsights: props.enablePerformanceInsights, diff --git a/src/slackchatbot.ts b/src/slackchatbot.ts index 9c7ae05..e4403cd 100644 --- a/src/slackchatbot.ts +++ b/src/slackchatbot.ts @@ -7,7 +7,7 @@ import { import { Construct } from 'constructs'; export interface SlackChatbotProps { - readonly environmentName: string; + readonly slackChannelConfigurationName: string; readonly slackWorkspaceId: string; readonly slackChannelId: string; readonly notificationTopics: sns.ITopic[]; @@ -50,7 +50,7 @@ export class SlackChatbotIntegration extends Construct { this.slackChannel = new chatbot.SlackChannelConfiguration(this, `${this.node.id}-SlackChannelConfig`, { slackWorkspaceId: props.slackWorkspaceId, slackChannelId: props.slackChannelId, - slackChannelConfigurationName: `${props.environmentName}-tracking-rds-alerts`, + slackChannelConfigurationName: props.slackChannelConfigurationName, role: this.chatbotRole, notificationTopics: props.notificationTopics, });