Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Network interface. and an instance-level subnet ID may not be specified on same request Cloud-Formation

template used

I am trying to build an aws cloud-formation stack following the example http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer-walkthrough-createbasicwebserver.html

However the stack is failing on creation of an ec2 isntance with an error Network interfaces and an instance-level subnet ID may not be specified on the same request

Could let me know what is missing. I have checked the parameters they all looks to be fine. template used is shared

like image 881
Ruchir Bharadwaj Avatar asked Mar 24 '17 09:03

Ruchir Bharadwaj


1 Answers

it was an PublicSubnet properties defined mutlipe times caused this issue .i.e. it is once defined in "Network Interface" and one separability in SubnetId": { "Ref": "PublicSubnet".

The particular snippet was pasted below which was causing this problem

"NetworkInterfaces": [
{
"GroupSet": [
{
"Ref": "webserverSG"
}
],
"AssociatePublicIpAddress": "true",
 "DeviceIndex": "0",
"DeleteOnTermination": "true",
 "SubnetId": {
"Ref": "PublicSubnet"
}
}
],
"UserData": {
"Fn::Base64": {
 xxxx
 xxxxx
 xxxx

 "SubnetId": {
 "Ref": "PublicSubnet" 
  }
like image 139
Ruchir Bharadwaj Avatar answered Sep 21 '22 11:09

Ruchir Bharadwaj