Skip to content

Commit 57d5a7f

Browse files
authored
Merge pull request #116 from kimisme9386/master
docs: update readme
2 parents 0dfb54d + 2ab9e28 commit 57d5a7f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/cdk-blue-green-container-deployment/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { ImageRepository } from '@cloudcomponents/cdk-container-registry';
4646
import {
4747
EcsService,
4848
DummyTaskDefinition,
49+
EcsDeploymentConfig,
4950
EcsDeploymentGroup,
5051
PushImageProject,
5152
} from '@cloudcomponents/cdk-blue-green-container-deployment';
@@ -125,7 +126,7 @@ export class BlueGreenContainerDeploymentStack extends Stack {
125126
ecsService.connections.allowFrom(loadBalancer, Port.tcp(80));
126127
ecsService.connections.allowFrom(loadBalancer, Port.tcp(8080));
127128

128-
const ecsDeploymentConfiguration = new EcsDeploymentConfiguration(
129+
const deploymentConfig = new EcsDeploymentConfig(
129130
this,
130131
'DeploymentConfig',
131132
{
@@ -151,11 +152,9 @@ export class BlueGreenContainerDeploymentStack extends Stack {
151152
prodTrafficListener: prodListener,
152153
testTrafficListener: testListener,
153154
terminationWaitTimeInMinutes: 100,
154-
deploymentConfig: ecsDeploymentConfiguration,
155+
deploymentConfig, // If you want to use default DeploymentConfig name, use static method as "EcsDeploymentConfig.CANARY_10PERCENT_15MINUTES".
155156
});
156157

157-
deploymentGroup.node.addDependency(ecsDeploymentConfiguration);
158-
159158
// @see https://github.com/cloudcomponents/cdk-constructs/tree/master/examples/blue-green-container-deployment-example/blue-green-repository
160159
const repository = new Repository(this, 'CodeRepository', {
161160
repositoryName: 'blue-green-repository',

packages/cdk-blue-green-container-deployment/src/ecs-deployment-group.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ export class EcsDeploymentGroup extends Resource implements IEcsDeploymentGroup
124124

125125
this.deploymentConfig = deploymentConfig || EcsDeploymentConfig.ALL_AT_ONCE;
126126

127+
if (Construct.isConstruct(props.deploymentConfig)) {
128+
this.node.addDependency(props.deploymentConfig);
129+
}
130+
127131
const ecsDeploymentGroup = new CustomResource(this, 'CustomResource', {
128132
serviceToken,
129133
resourceType: 'Custom::EcsDeploymentGroup',

0 commit comments

Comments
 (0)