Skip to content

Commit

Permalink
feat(cdk): add launch type on run-task command in script
Browse files Browse the repository at this point in the history
  • Loading branch information
briancaffey committed Nov 7, 2022
1 parent adb0f24 commit 584bfec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constructs/ad-hoc/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class AdHocApp extends Construct {

const cluster = new Cluster(this, 'Cluster', {
vpc: props.vpc,
enableFargateCapacityProviders: true,
});

const serviceDiscoveryNamespace = props.serviceDiscoveryNamespace.namespaceName;
Expand Down
2 changes: 1 addition & 1 deletion src/constructs/internal/ecs/management-command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class ManagementCommandTask extends Construct {
const executionScript = `
START_TIME=$(date +%s000)
TASK_ID=$(aws ecs run-task --cluster ${props.cluster.clusterArn} --task-definition ${taskDefinition.taskDefinitionArn} --network-configuration "awsvpcConfiguration={subnets=[${privateSubnets}],securityGroups=[${props.appSecurityGroup.securityGroupId}],assignPublicIp=ENABLED}" | jq -r '.tasks[0].taskArn')
TASK_ID=$(aws ecs run-task --cluster ${props.cluster.clusterArn} --task-definition ${taskDefinition.taskDefinitionArn} --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=[${privateSubnets}],securityGroups=[${props.appSecurityGroup.securityGroupId}],assignPublicIp=ENABLED}" | jq -r '.tasks[0].taskArn')
aws ecs wait tasks-stopped --tasks $TASK_ID --cluster ${props.cluster.clusterArn}
Expand Down

0 comments on commit 584bfec

Please sign in to comment.