@@ -125,6 +125,21 @@ export class BlueGreenContainerDeploymentStack extends Stack {
125
125
ecsService .connections .allowFrom (loadBalancer , Port .tcp (80 ));
126
126
ecsService .connections .allowFrom (loadBalancer , Port .tcp (8080 ));
127
127
128
+ const ecsDeploymentConfiguration = new EcsDeploymentConfiguration (
129
+ this ,
130
+ ' DeploymentConfig' ,
131
+ {
132
+ deploymentConfigName: ' Canary20Percent5Minute' ,
133
+ trafficRoutingConfig: {
134
+ type: ' TimeBasedCanary' ,
135
+ timeBasedCanary: {
136
+ canaryInterval: 5 ,
137
+ canaryPercentage: 20 ,
138
+ },
139
+ },
140
+ }
141
+ );
142
+
128
143
const deploymentGroup = new EcsDeploymentGroup (this , ' DeploymentGroup' , {
129
144
applicationName: ' blue-green-application' ,
130
145
deploymentGroupName: ' blue-green-deployment-group' ,
@@ -136,19 +151,11 @@ export class BlueGreenContainerDeploymentStack extends Stack {
136
151
prodTrafficListener: prodListener ,
137
152
testTrafficListener: testListener ,
138
153
terminationWaitTimeInMinutes: 100 ,
139
- createDeploymentConfigInput: {
140
- computePlatform: " ECS" ,
141
- deploymentConfigName: " Canary20Percent5Minute" ,
142
- trafficRoutingConfig: {
143
- type: " TimeBasedCanary" ,
144
- timeBasedCanary: {
145
- canaryInterval: 5 ,
146
- canaryPercentage: 20 ,
147
- },
148
- },
149
- },
154
+ deploymentConfig: ecsDeploymentConfiguration .deploymentConfig ,
150
155
});
151
156
157
+ deploymentGroup .node .addDependency (ecsDeploymentConfiguration );
158
+
152
159
// @see https://github.com/cloudcomponents/cdk-constructs/tree/master/examples/blue-green-container-deployment-example/blue-green-repository
153
160
const repository = new Repository (this , ' CodeRepository' , {
154
161
repositoryName: ' blue-green-repository' ,
0 commit comments