微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AWS CDK 在使用 ApplicationLoadBalancedEc2Service 创建 EcsService Cloud Formation 堆栈时卡住

如何解决AWS CDK 在使用 ApplicationLoadBalancedEc2Service 创建 EcsService Cloud Formation 堆栈时卡住

我有以下代码来创建 ECS ApplicationLoadBalancedEc2Service,但是它在创建过程中卡住了 2 个小时,我没有看到任何事件错误

下面是我的代码

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');

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。