尝试使用 cloudformation 创建 ECS 服务(在 Fargate 上)但出现错误:
ARN 中的服务无效(服务:AmazonECS;状态代码:400;错误代码:InvalidParameterException;请求 ID:xxx)。
根据错误消息似乎有些ARN是错误的,但我没有找到原因,我检查了IAM角色的ARN,它是好的。其他 ARN 通过 !Ref 函数传递(因此不是拼写错误)
创建所有资源(包括来自所有其他嵌套模板、vpc、集群、alb 等),“服务”资源(ECS 服务)除外。
下面是使用的模板(嵌套模板)。所有参数都可以(从根模板传递)。参数 TaskExecutionRole 和 ServiceRole 是来自 ECS 向导创建的 IAM 角色的 ARN:
Description: >
Deploys xxx ECS service, with load balancer listener rule,
target group, task definition, service definition and auto scaling
Parameters:
EnvironmentName:
Description: An environment name that will be prefixed to resource names
Type: String
EnvironmentType:
Description: See master template
Type: String
VpcId:
Type: String
PublicSubnet1:
Type: String
PublicSubnet2:
Type: String
ALBListener: …Run Code Online (Sandbox Code Playgroud) amazon-web-services amazon-ecs aws-cloudformation aws-fargate