amazon-web-services - 当我尝试部署 CloudFormation 模板时,我得到 "The availability zones of the specified subnets and the AutoScalingGroup do not match"

标签 amazon-web-services amazon-ec2 aws-cloudformation

我有一个正在尝试部署的 CloudFormation 模板。

它是为us-west-2制作的。我正在尝试将其部署在 us-east-1 中。

我已尝试进行所需的所有更改,但我不断收到错误:

CREATE_FAILED

周围:

Type:AWS::AutoScaling::AutoScalingGroup Logical ID: WebServerScalingGroup Reason: The availability zones of the specified subnets and the AutoScalingGroup do not match

下面是我的模板引用“WebServerScalingGroup”的一部分。

"WebServerScalingGroup":{
      "Type":"AWS::AutoScaling::AutoScalingGroup",
      "UpdatePolicy":{
        "AutoScalingRollingUpdate":{
          "MinInstancesInService":{
            "Ref":"MinWebServers"
          },
          "MaxBatchSize":"1",
          "PauseTime":"PT5M"
        }
      },
      "Properties":{
        "AvailabilityZones":{
          "Fn::FindInMap":[
            "AWSRegions2AZ",
            {
              "Ref":"Region"
            },
            "AZ"
          ]
        },
        "VPCZoneIdentifier":{
          "Ref":"WebServerSubnetsID"
        },
        "LaunchConfigurationName":{
          "Ref":"WebServerLaunchConfig"
        },
        "MinSize":{
          "Ref":"MinWebServers"
        },
        "MaxSize":{
          "Ref":"MaxWebServers"
        },
        "DesiredCapacity":{
          "Ref":"DesiredNumberOfWebServers"
        },
        "LoadBalancerNames":[
          {
            "Ref":"ElasticLoadBalancer"
          }
        ],
        "Tags":[
          {
            "Key":"Network",
            "Value":"Private",
            "PropagateAtLaunch":"true"
          },
          {
            "Key":"Name",
            "Value": {
              "Fn::Join":[
                    "",
                    [
                      "vidly-mediadrop-app-",
                      {
                        "Ref":"EnvironmentType"
                      }
                    ]
              ]
            },
            "PropagateAtLaunch":"true"
          }
        ]
      }
    },

编辑:下面是AWSRegions2AZ

"AWSRegions2AZ":{
      "us-east-1":{
        "AZ":[
          "us-east-1b",
          "us-east-1c",
          "us-east-1d",
          "us-east-1e"
        ]
      }

最佳答案

从您提供的代码片段中很难看出,但从您收到的消息来看,我想说您在 WebServerSubnetsID 中提供的子网 ID 与不同的集合(或子网的子集)相关联。 ) 由 AWSRegions2AZ 返回的可用区域。

您是否在每个可用区中创建了子网?

关于amazon-web-services - 当我尝试部署 CloudFormation 模板时,我得到 "The availability zones of the specified subnets and the AutoScalingGroup do not match",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31858660/

相关文章:

amazon-web-services - 没有 dns 的 Kubernetes Kops

amazon-web-services - 在 EC2 Ubuntu 或 Linux 中记录每个请求和输出

amazon-s3 - AWS : Ways of keeping cost down while backing up S3 files to Glacier?

amazon-web-services - 将带有过滤器的 AWS CLI 命令输出到不带 jq 的 CSV

javascript - AWS DynamoDb DocumentClient - 从项目数组创建 batchWrite - node.js

amazon-web-services - 在 Web 应用程序中公开 AWS S3 签名 URL?

postgresql - 从 S3 挂载 postgresql 数据库

amazon-web-services - CloudFront ForwardedValues 不明确的文档

amazon-web-services - 如何使用cloudformation迁移sns和sqs?

json - 在Cloudformation中传递标签的json文件