In AWS cloud information, is there a way to declare an EC2 instance in a VPC with an open IP address without the need to declare Elastic IP and attach to it?
In AWS :: AutoScaling :: LaunchConfiguration, you can add the "AssociatePublicIpAddress" property to say that the instances automatically take on a public IP address. I am looking for an equivalent for AWS :: EC2 :: Instance
The following is a cloud fragment for creating an EC2 instance. I cannot have a single document that mentions how to add a public IP address without first declaring Elastic IP.
"MyEc2Instance": { "Type": "AWS::EC2::Instance", "Properties": { "IamInstanceProfile": { "Ref": "MyEc2InstanceProfile" }, "ImageId": { "Fn::FindInMap": [ "MyEc2Box", { "Ref": "Region" }, "ImageId" ] }, "InstanceType": { "Fn::FindInMap": [ "MyEc2Box", { "Ref": "Region" }, "InstanceType" ] }, "KeyName": { "Ref": "DefaultKeyPair" }, "Monitoring": "true", "SecurityGroupIds": [ { "Ref": "MyEc2SecurityGroup" } ], "SubnetId": { "Ref": "MyBoxSubnet" }, "Tags": [ { "Key": "Name", "Value": "MyBox" }, ] } },
amazon-web-services amazon-cloudformation
Mechastorm
source share