网络接口的AWS CloudFormation错误 [英] AWS CloudFormation error with network interface

查看:156
本文介绍了网络接口的AWS CloudFormation错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次启动堆栈时都会出现此错误

I get this error whenever I launch my stack

(网络接口和实例级安全组可能不是 在同一请求上指定(服务:AmazonEC2;状态代码:400; 错误代码:InvalidParameterCombination;请求ID:....))

(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:....))

Aws console中的状态为:ROLLBACK_COMPLETE

如何解决此错误?

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

推荐答案

要指定网络接口是否有特定原因?

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

如果您需要做的就是将实例部署到特定的子网中,只需删除NetworkInterfaces部分并为实例本身指定子网.

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

这篇关于网络接口的AWS CloudFormation错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆