I am using below cloud formation template to launch an instance in already created VPC. This instance is getting created in required VPC. But I need this instance to be provisioned with Public IP as well. Tried many options and couldn't solve it. Please can some one help me.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Ec2 block device mapping",
"Resources": {
"MyEC2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"ImageId": "ami-0bbd146b",
"AvailabilityZone": "us-west-2a",
"SubnetId": "subnet-e1b24b86",
"SecurityGroupIds": [ "sg-fad0c383" ],
"KeyName": "TibcoBuild",
"Tags": [{
"Key": "Name",
"Value": "VPCTest"
}]
}
}
}
}
What did you try? It's actually pretty straightforward and documented here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html