forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rds): Support rolling instance updates
Support defining the instance update behaviour of RDS instances. This allows to switch between bulk (all instances at once) and rolling updates (one instance after another). While bulk updates are faster, they have a higher risk for longer downtimes as all instances might be simultaneously unreachable due to the update. Rolling updates take longer but ensure that all but one instance are not updated and thus downtimes are limited to the (at most two) changes of the primary instance. We keep the current behaviour, namely a bulk update, as default. This implementation follows proposal A by hixi-hyi in issue aws#10595.
- Loading branch information
1 parent
cad6fc5
commit 50559a6
Showing
12 changed files
with
3,561 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/@aws-cdk/aws-rds/test/integ.rolling-instance-updates.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as ec2 from '@aws-cdk/aws-ec2'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as integTests from '@aws-cdk/integ-tests'; | ||
import * as constructs from 'constructs'; | ||
import * as rds from '../lib'; | ||
|
||
interface RollingInstanceUpdateTestStackProps extends cdk.StackProps { | ||
instanceUpdateBehaviour: rds.InstanceUpdateBehaviour; | ||
} | ||
|
||
class RollingInstanceUpdateTestStack extends cdk.Stack { | ||
constructor(scope: constructs.Construct, id: string, props: RollingInstanceUpdateTestStackProps) { | ||
super(scope, id, props); | ||
const vpc = new ec2.Vpc(this, 'Vpc', { | ||
maxAzs: 2, | ||
}); | ||
|
||
new rds.DatabaseCluster(this, 'DatabaseCluster', { | ||
engine: rds.DatabaseClusterEngine.AURORA, | ||
instances: 3, | ||
instanceProps: { | ||
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL), | ||
vpc, | ||
}, | ||
removalPolicy: cdk.RemovalPolicy.DESTROY, | ||
instanceUpdateBehaviour: props.instanceUpdateBehaviour, | ||
}); | ||
} | ||
} | ||
|
||
|
||
// Beginning of the test suite | ||
const app = new cdk.App(); | ||
new integTests.IntegTest(app, 'InstanceUpdateBehaviorTests', { | ||
testCases: [ | ||
new RollingInstanceUpdateTestStack(app, 'BulkUpdate', { | ||
instanceUpdateBehaviour: rds.InstanceUpdateBehaviour.BULK, | ||
}), | ||
new RollingInstanceUpdateTestStack(app, 'RollingUpdate', { | ||
instanceUpdateBehaviour: rds.InstanceUpdateBehaviour.ROLLING, | ||
}), | ||
], | ||
}); | ||
|
||
app.synth(); |
Oops, something went wrong.