Created
August 21, 2013 23:10
-
-
Save oremj/6301365 to your computer and use it in GitHub Desktop.
Creates AWS resources described in http://coreos.com/docs/ec2/
This file contains 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": "Core ec2 example: http://coreos.com/docs/ec2/", | |
"Parameters": { | |
"InstanceType" : { | |
"Description" : "EC2 instance type", | |
"Type" : "String", | |
"Default" : "t1.micro", | |
"AllowedValues" : [ "t1.micro","m1.small","m1.medium","m1.large","m1.xlarge", "m3.xlarge", "m3.2xlarge", "m2.xlarge","m2.2xlarge","m2.4xlarge","c1.medium","c1.xlarge","cc1.4xlarge","cc2.8xlarge","cg1.4xlarge", "hi1.4xlarge", "hs1.8xlarge"], | |
"ConstraintDescription" : "must be a valid EC2 instance type." | |
}, | |
"ClusterSize": { | |
"Default": "3", | |
"Description": "Number of nodes in cluster.", | |
"Type": "Number" | |
}, | |
"SecretGist": { | |
"Description": "Url of secret gist.", | |
"Type": "String" | |
} | |
}, | |
"Resources": { | |
"CoreOSSecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "CoreOS SecurityGroup", | |
"SecurityGroupIngress": [ | |
{"IpProtocol": "tcp", "FromPort": "22", "ToPort": "22", "CidrIp": "0.0.0.0/0"} | |
] | |
} | |
}, | |
"Ingress4001": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4001", "ToPort": "4001", "SourceSecurityGroupName": {"Ref": "CoreOSSecurityGroup"} | |
} | |
}, | |
"Ingress7001": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "7001", "ToPort": "7001", "SourceSecurityGroupName": {"Ref": "CoreOSSecurityGroup"} | |
} | |
}, | |
"CoreOSServerAutoScale": { | |
"Type": "AWS::AutoScaling::AutoScalingGroup", | |
"Properties": { | |
"AvailabilityZones": {"Fn::GetAZs": ""}, | |
"LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"}, | |
"MinSize": {"Ref": "ClusterSize"}, | |
"MaxSize": "12", | |
"DesiredCapacity": {"Ref": "ClusterSize"}, | |
"Tags": [ | |
{"Key": "Name", "Value": "coreos-server", "PropagateAtLaunch": true} | |
] | |
} | |
}, | |
"CoreOSServerLaunchConfig": { | |
"Type": "AWS::AutoScaling::LaunchConfiguration", | |
"Properties": { | |
"ImageId": "ami-bf5b18d6", | |
"InstanceType": {"Ref": "InstanceType"}, | |
"SecurityGroups": [{"Ref": "CoreOSSecurityGroup"}], | |
"UserData": {"Fn::Base64": {"Ref": "SecretGist"}} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment