【问题标题】:Cloudformation: AmazonEC2; Status Code: 400; Error Code: UnsupportedCloudformation:亚马逊EC2;状态码:400;错误代码:不支持
【发布时间】:2021-02-06 20:33:05
【问题描述】:

我尝试在云中部署一个新的 EC2 实例,但我收到错误“服务:AmazonEC2;状态代码:400;错误代码:不支持”

这是我的代码:

AWSTemplateFormatVersion: "2010-09-09"
Description: vm stack

Resources:
  VMParameter:
    Type: AWS::SSM::Parameter
    Properties:
      Name: Testing
      Type: "String"
      Value: !Ref VMerr
      Description: The ID of the created VM


  VMerr:
    Type: AWS::EC2::Instance
    Properties:
      AvailabilityZone: us-east-1a
      InstanceType: 't2.micro'
      ImageId: ami-007a607c4abd192db
      KeyName: pemtest
      EbsOptimized: True
    
    
      SubnetId: subnet-0ec24f346062f4527      
      SecurityGroupIds:
        - sg-092f790dccf3ed4d3
      BlockDeviceMappings: 
        - DeviceName: "/dev/sdm"
          Ebs: 
            VolumeType: "io1"
            Iops: "200"
            DeleteOnTermination: "false"
            VolumeSize: "20"
        - DeviceName: "/dev/sdk"
          NoDevice: {}

【问题讨论】:

  • us-east-1 中运行,对吗?并且 amisubnetsecurityGroup 都在该帐户的 us-east-1 中?

标签: amazon-web-services amazon-ec2 yaml amazon-cloudformation


【解决方案1】:

始终确保为所选实例类型选择正确的 AMI。您指定的 AMI 基于 arm64。因此,不适合 (unsupported) 在 t2.micro 上运行。

对于自动化,您还可以使用公共 Systems Manager 参数存储: https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/

【讨论】:

    猜你喜欢
    • 2019-08-18
    • 2020-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多