Skip to content

Commit

Permalink
Merge pull request #767 from umccr/extend-aurora-automated-backup-ret…
Browse files Browse the repository at this point in the history
…ention

Updated aurora automated backup retention
  • Loading branch information
victorskl authored Dec 9, 2024
2 parents 976909a + ba34adf commit 480f5d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/stacks/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const getDatabaseConstructProps = (stage: AppStage): ConfigurableDatabaseProps =
enhancedMonitoringInterval: Duration.seconds(60),
enablePerformanceInsights: true,
removalPolicy: RemovalPolicy.DESTROY,
backupRetention: Duration.days(1),
};
case AppStage.GAMMA:
return {
Expand All @@ -165,14 +166,18 @@ const getDatabaseConstructProps = (stage: AppStage): ConfigurableDatabaseProps =
enhancedMonitoringInterval: Duration.seconds(60),
enablePerformanceInsights: true,
removalPolicy: RemovalPolicy.DESTROY,
backupRetention: Duration.days(1),
};
case AppStage.PROD:
return {
...baseConfig,
numberOfInstance: 1,
minACU: 0.5,
maxACU: 16,
enhancedMonitoringInterval: Duration.seconds(60),
enablePerformanceInsights: true,
removalPolicy: RemovalPolicy.RETAIN,
backupRetention: Duration.days(7),
};
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export type ConfigurableDatabaseProps = MonitoringProps & {
* The schedule (in Duration) that will rotate the master secret
*/
secretRotationSchedule: Duration;
/**
* RDS aurora automated backup retention (in Duration)
*/
backupRetention: Duration;
};

/**
Expand Down Expand Up @@ -161,6 +165,10 @@ export class DatabaseConstruct extends Construct {
writer: rds.ClusterInstance.serverlessV2('WriterClusterInstance', {
enablePerformanceInsights: props.enablePerformanceInsights,
}),

backup: {
retention: props.backupRetention,
},
});

new sm.SecretRotation(this, 'MasterDbSecretRotation', {
Expand Down
1 change: 1 addition & 0 deletions test/stateful/pipeline/deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function applyNagSuppression(stackId: string, stack: Stack) {
'/SharedStack/EventBusConstruct/UniversalEventArchiveBucket/Resource',
'/SharedStack/EventBusConstruct/UniversalEventArchiver/UniversalEventArchiver/ServiceRole/Resource',
'/SharedStack/EventBusConstruct/UniversalEventArchiver/UniversalEventArchiver/ServiceRole/DefaultPolicy/Resource',
'/SharedStack/DatabaseConstruct/Cluster/MonitoringRole/Resource',
],
[
{
Expand Down

0 comments on commit 480f5d0

Please sign in to comment.