Created
November 7, 2014 01:40
-
-
Save btashton/ca0a6f8c5315c51562d7 to your computer and use it in GitHub Desktop.
coreos-stable template
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": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", | |
"Mappings" : { | |
"RegionMap" : { | |
"eu-central-1" : { | |
"AMI" : "ami-eec6f0f3" | |
}, | |
"ap-northeast-1" : { | |
"AMI" : "ami-838eb882" | |
}, | |
"sa-east-1" : { | |
"AMI" : "ami-75922668" | |
}, | |
"ap-southeast-2" : { | |
"AMI" : "ami-1dabc627" | |
}, | |
"ap-southeast-1" : { | |
"AMI" : "ami-7878592a" | |
}, | |
"us-east-1" : { | |
"AMI" : "ami-d878c3b0" | |
}, | |
"us-west-2" : { | |
"AMI" : "ami-f52c63c5" | |
}, | |
"us-west-1" : { | |
"AMI" : "ami-856772c0" | |
}, | |
"eu-west-1" : { | |
"AMI" : "ami-58e14e2f" | |
} | |
} | |
}, | |
"Parameters": { | |
"InstanceType" : { | |
"Description" : "EC2 HVM instance type (m3.medium, etc).", | |
"Type" : "String", | |
"Default" : "m3.medium", | |
"AllowedValues" : [ "m3.medium", "m3.large", "m3.xlarge", "m3.2xlarge", "c3.large","c3.xlarge", "c3.2xlarge", "c3.4xlarge","c3.8xlarge", "cc2.8xlarge","cr1.8xlarge","hi1.4xlarge", "hs1.8xlarge", "i2.xlarge", "i2.2xlarge", "i2.4xlarge", "i2.8xlarge", "r3.large", "r3.xlarge", "r3.2xlarge","r3.4xlarge", "r3.8xlarge", "t2.micro", "t2.small", "t2.medium" ], | |
"ConstraintDescription" : "Must be a valid EC2 HVM instance type." | |
}, | |
"ClusterSize": { | |
"Default": "3", | |
"MinValue": "3", | |
"MaxValue": "12", | |
"Description": "Number of nodes in cluster (3-12).", | |
"Type": "Number" | |
}, | |
"SecurityGroupId":{ | |
"Default" : "PUT_YOUR_SG_ID", | |
"Type": "String", | |
"Description": "Security group to launch instances into. (it must exist, it won't be created.)" | |
}, | |
"SubnetId":{ | |
"Default" : "PUT_YOUR_SUBNET_ID", | |
"Type": "String", | |
"Description": "VPC group to launch instances into. (it must exist, it won't be created.)" | |
}, | |
"DiscoveryURL": { | |
"Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new", | |
"Type": "String" | |
}, | |
"AdvertisedIPAddress": { | |
"Description": "Use 'private' if your etcd cluster is within one region or 'public' if it spans regions or cloud providers.", | |
"Default": "private", | |
"AllowedValues": ["private", "public"], | |
"Type": "String" | |
}, | |
"AllowSSHFrom": { | |
"Description": "The net block (CIDR) that SSH is available to.", | |
"Default": "0.0.0.0/0", | |
"Type": "String" | |
}, | |
"KeyPair" : { | |
"Description" : "The name of an EC2 Key Pair to allow SSH access to the instance.", | |
"Type" : "String" | |
} | |
}, | |
"Resources": { | |
"CoreOSServerAutoScale": { | |
"Type": "AWS::AutoScaling::AutoScalingGroup", | |
"Properties": { | |
"AvailabilityZones": {"Fn::GetAZs": ""}, | |
"LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"}, | |
"MinSize": "3", | |
"MaxSize": "12", | |
"DesiredCapacity": {"Ref": "ClusterSize"}, | |
"Tags": [ | |
{"Key": "Name", "Value": { "Ref" : "AWS::StackName" }, "PropagateAtLaunch": true} | |
] | |
} | |
}, | |
"CoreOSServerLaunchConfig": { | |
"Type": "AWS::AutoScaling::LaunchConfiguration", | |
"Properties": { | |
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, | |
"InstanceType": {"Ref": "InstanceType"}, | |
"KeyName": {"Ref": "KeyPair"}, | |
"SecurityGroups": [{"Ref": "SecurityGroupId"}], | |
"UserData" : { "Fn::Base64": | |
{ "Fn::Join": [ "", [ | |
"#cloud-config\n\n", | |
"coreos:\n", | |
" etcd:\n", | |
" discovery: ", { "Ref": "DiscoveryURL" }, "\n", | |
" addr: $", { "Ref": "AdvertisedIPAddress" }, "_ipv4:4001\n", | |
" peer-addr: $", { "Ref": "AdvertisedIPAddress" }, "_ipv4:7001\n", | |
" units:\n", | |
" - name: etcd.service\n", | |
" command: start\n", | |
" - name: fleet.service\n", | |
" command: start\n" | |
] ] | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment