问题描述
我有以下代码来创建 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 (将#修改为@)