Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
160 lines (149 sloc) 4.55 KB
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description": "coreos-stable-example. Assumes you have a VPC with subnets in two AZs and only want to use two AZs",
"Parameters" : {
"KeyPair" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the coreos hosts",
"Type" : "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern" : "[-_ a-zA-Z0-9]*",
"ConstraintDescription" : "can contain only alphanumeric characters, spaces, dashes and underscores."
},
"ClusterSize": {
"Default": "3",
"MinValue": "3",
"MaxValue": "12",
"Description": "Number of nodes in cluster (3-12).",
"Type": "Number"
},
"SSHFrom" : {
"Description" : "Lockdown SSH access to the coreos hosts (default: can be accessed from anywhere)",
"Type" : "String",
"MinLength": "9",
"MaxLength": "18",
"Default" : "0.0.0.0/0",
"AllowedPattern" : "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription" : "must be a valid CIDR range of the form x.x.x.x/x."
},
"AssociatePublicIP": {
"Description": "Whether to associate a public IP address to the instances",
"Type": "String",
"Default": "false",
"AllowedValues" : [ "true", "false" ],
"ConstraintDescription" : "must be either true or false"
},
"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"
},
"InstanceType": {
"Description": "",
"Default": "m3.large",
"Type": "String"
},
"SecurityGroupIds": {
"Description": "",
"Type": "CommaDelimitedList"
},
"SubnetId1": {
"Description": "",
"Type": "String"
},
"SubnetId2": {
"Description": "",
"Type": "String"
},
"Az1": {
"Description": "",
"Type": "String"
},
"Az2": {
"Description": "",
"Type": "String"
}
},
"Mappings" : {
"CoreOSAMIs" : {
"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"
}
}
},
"Resources" : {
"CoreOSServerAutoScale": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": [
{"Ref": "Az1"},
{"Ref": "Az2"}
],
"VPCZoneIdentifier": [
{"Ref": "SubnetId1"},
{"Ref": "SubnetId2"}
],
"LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"},
"MinSize": "3",
"MaxSize": "12",
"DesiredCapacity": {"Ref": "ClusterSize"},
"Tags": [
{"Key": "Name", "Value": "lookout-coreos-hacksgiving", "PropagateAtLaunch": true}
]
}
},
"CoreOSServerLaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"ImageId" : { "Fn::FindInMap" : [ "CoreOSAMIs", { "Ref" : "AWS::Region" }, "AMI"]},
"InstanceType": {"Ref": "InstanceType"},
"KeyName": {"Ref": "KeyPair"},
"AssociatePublicIpAddress": {"Ref": "AssociatePublicIP"},
"SecurityGroups": {"Ref": "SecurityGroupIds"},
"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"
] ]}}
}
}
}
}