Created
April 29, 2014 06:35
-
-
Save bhouse/11392183 to your computer and use it in GitHub Desktop.
cloudformation template example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "test template for zdops workshop", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", | |
"Type" : "String" | |
} | |
}, | |
"Resources" : { | |
"Ec2Instance" : { | |
"Type" : "AWS::EC2::Instance", | |
"Properties" : { | |
"SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ], | |
"KeyName" : { "Ref" : "KeyName" }, | |
"ImageId" : "ami-aacff2ef" | |
} | |
}, | |
"InstanceSecurityGroup" : { | |
"Type" : "AWS::EC2::SecurityGroup", | |
"Properties" : { | |
"GroupDescription" : "Enable SSH access via port 22", | |
"SecurityGroupIngress" : [ { | |
"IpProtocol" : "tcp", | |
"FromPort" : "22", | |
"ToPort" : "22", | |
"CidrIp" : "0.0.0.0/0" | |
} ] | |
} | |
} | |
}, | |
"Outputs" : { | |
"InstanceId" : { | |
"Description" : "InstanceId of the newly created EC2 instance", | |
"Value" : { "Ref" : "Ec2Instance" } | |
}, | |
"AZ" : { | |
"Description" : "Availability Zone of the newly created EC2 instance", | |
"Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } | |
}, | |
"PublicIP" : { | |
"Description" : "Public IP address of the newly created EC2 instance", | |
"Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicIp" ] } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment