AWS CloudFormation error with network interface

*爱你&永不变心* 提交于 2020-08-11 02:09:34

问题


I get this error whenever I launch my stack

(Network interfaces and an instance-level security groups may not be specified on the same request (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID:....))

and the status in Aws console is: ROLLBACK_COMPLETE

How I can solve this error?

EC2Instance:
Type: 'AWS::EC2::Instance'
Properties:
  SecurityGroups: 
    - !Ref SecurityGroup
  KeyName : !Ref EC2Key
  AvailabilityZone: us-east-2a
  ImageId: ami-01410f0e8f8b1acca
  InstanceType: t2.micro
  NetworkInterfaces:
    - DeviceIndex: '0'
      SubnetId: !Ref PublicSubnet

回答1:


Is there a specific reason why you want to specify network interface?

If all you need to accomplish is to deploy the instance into the specific subnet, just drop the NetworkInterfaces part and specify the subnet for the instance itself.

EC2Instance:
Type: 'AWS::EC2::Instance'
Properties:
  SecurityGroups: 
    - !Ref SecurityGroup
  KeyName : !Ref EC2Key
  AvailabilityZone: us-east-2a
  ImageId: ami-01410f0e8f8b1acca
  InstanceType: t2.micro
  SubnetId: !Ref PublicSubnet


来源:https://stackoverflow.com/questions/59950969/aws-cloudformation-error-with-network-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!