[英]AWS ECS cluster Capacity Provider
I'm using this cloudformation template to create capacity providers for ECS cluster with the autoscaling group specified in the ecs capacity provider:我正在使用此 cloudformation 模板为 ECS 集群创建容量提供程序,并在 ecs 容量提供程序中指定自动缩放组:
"ECSCapacityProvider": {
"Type": "AWS::ECS::CapacityProvider",
"Properties": {
"AutoScalingGroupProvider": {
"AutoScalingGroupArn": { "Ref" : "AutoScalingGroup" }
}
},
"DependsOn" : "AutoScalingGroup"
},
"DRCluster": {
"Type": "AWS::ECS::Cluster",
"Properties": {
"ClusterName": { "Ref" : "WindowsECSCluster" },
"CapacityProviders" : "ECSCapacityProvider",
"Tags": [
{
"Key": "environment",
"Value": "dr"
}
]
},
"DependsOn" : "ECSCapacityProvider"
}
But while creating the stack it resulted in the following error:但是在创建堆栈时会导致以下错误:
Model validation failed (#/CapacityProviders: expected type: JSONArray, found: String)
I could not find proper documentation for the capacity providers.我找不到容量提供者的适当文档。 I'm using it to attach the Auto Scaling group to the cluster, which i hope is the correct way to do so.
我正在使用它将 Auto Scaling 组附加到集群,我希望这是正确的方法。 I'm new to cloudformation, any help is much appreciated.
我是 cloudformation 的新手,非常感谢任何帮助。
CapacityProviders is a List of String , not a String
like you have now: CapacityProviders是一个String 列表,而不是像现在这样的
String
:
"CapacityProviders" : "ECSCapacityProvider",
Therefore, in you DRCluster
you can use the following instead:因此,在您的
DRCluster
中,您可以改用以下内容:
"CapacityProviders" : [ {"Ref": "ECSCapacityProvider"} ],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.