AWS CDK stuck while creating EcsService Cloud Formation stack using ApplicationLoadBalancedEc2Service

Viewed 104

I have the following code to create a ECS ApplicationLoadBalancedEc2Service, however it is stuck in creation for 2 hours and i don't see any errors in events.

Below is my code:

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

this.cluster.addCapacity('DefaultAutoScalingGroupCapacity', {
    instanceType: InstanceType.of(InstanceClass.R5D, InstanceSize.XLARGE24),
    minCapacity: 2,
    maxCapacity: 50,
});
this.service = new ApplicationLoadBalancedEc2Service(this, 'Service', {
            cluster: props.ecsCluster,
            memoryLimitMiB: 768000,
            taskImageOptions: {
            containerPort: 8080,
            image: new ContainerImage({
                    package: Package.fromString('ECSMatching'),
                    transformPackage: Package.fromString('ECSMatchingImage'),
                    componentName: 'service',
                }),
                taskRole: getDefaultEcsTaskInstanceRole(this),
                environment: {'STAGE': props.stage}
            },
        });

this.service.service.connections.allowFrom(
            Peer.ipv4(props.ecsCluster.vpc.vpcCidrBlock),
            Port.allTraffic(),
            'Local VPC Access'
        );

this.service.targetGroup.setAttribute('deregistration_delay.timeout_seconds', '6000');
0 Answers
Related