Skip to content

Commit a5ffe79

Browse files
committed
fix: Use taskdef containerport as default
1 parent c548de1 commit a5ffe79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ export class EcsService extends Construct implements IConnectable, IEcsService {
3838
launchType = LaunchType.FARGATE,
3939
platformVersion = '1.4.0',
4040
desiredCount = 1,
41-
containerPort = 80,
4241
prodTargetGroup,
4342
taskDefinition,
4443
} = props;
4544

45+
const containerPort = props.containerPort ?? taskDefinition.containerPort;
46+
4647
const { vpc } = cluster;
4748

4849
const securityGroups = props.securityGroups || [
@@ -54,7 +55,7 @@ export class EcsService extends Construct implements IConnectable, IEcsService {
5455

5556
const serviceToken = CustomResourceProvider.getOrCreate(this, 'Custom::BlueGreenService', {
5657
codeDirectory: path.join(__dirname, 'lambdas', 'ecs-service'),
57-
runtime: CustomResourceProviderRuntime.NODEJS_12,
58+
runtime: CustomResourceProviderRuntime.NODEJS_12_X,
5859
policyStatements: [
5960
{
6061
Effect: Effect.ALLOW,

0 commit comments

Comments
 (0)