使用AWS Cloudformation在多个子网之间自动缩放会引发错误 [英] Autoscaling across multiple subnets using AWS Cloudformation throws error
问题描述
我无法创建Cloudformation模板来跨2个不同的公共子网自动扩展。我一直收到错误消息
I am unable to create a Cloudformation template to autoscale across 2 different public subnets. I keep getting the error
CREATE_FAILED
AWS :: AutoScaling :: AutoScalingGroup
指定子网的可用区域与Auto Scaling
组不匹配
CREATE_FAILED
AWS::AutoScaling::AutoScalingGroup
The availability zones of the specified subnets and the Auto Scaling group do not match
我已经广泛研究了所有不同的模板代码可能性,我已经尝试了所有可能性,包括
I have extensively researched all the different template code possibilities and I've tried them all, including
定义像这样的精确可用区:
Defining the exact AZs like this:
AvailabilityZones" : [ us-west-2a, us-west-2b ],
改用VPCZone Identifier属性,将AvailabilityZone属性保留在资源之外:
Using the VPCZone Identifier property instead and leaving the AvailabilityZone property out of the resource:
"VPCZoneIdentifier" : [ subnet-1234, subnet-5678 ]
但这是我最近的尝试:
"ASASGS3JJ": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": {
"Fn::GetAZs": ""
},
"InstanceId": {
"Ref": "EC2I12Q2R"
},
"LoadBalancerNames": [
"ELBLB2IQL9"
],
"MaxSize": 2,
"MinSize": 2
},
不幸的是仍然出现相同的错误。我可以在正确格式化方面获得一些帮助吗?我是否需要更改Autoscaling组资源之外的任何代码?
Unfortunately still getting the same error. Can I please get some assistance on how to properly format? Do I need to change any code outside of the Autoscaling group resource?
推荐答案
我最终使用了LaunchConfiguration并删除了AvailabilityZones参数。看来已经解决了。
I ended up using a LaunchConfiguration and removing AvailabilityZones parameter. That seems to have fixed it.
这篇关于使用AWS Cloudformation在多个子网之间自动缩放会引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!