Created
September 25, 2015 23:16
-
-
Save fivethreeo/b10ca1f36420629efa02 to your computer and use it in GitHub Desktop.
coreos-beta-pv.template with allowedvalues
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-04bcbc19" | |
}, | |
"ap-northeast-1" : { | |
"AMI" : "ami-e09e08e0" | |
}, | |
"us-gov-west-1" : { | |
"AMI" : "ami-b935579a" | |
}, | |
"sa-east-1" : { | |
"AMI" : "ami-7735a06a" | |
}, | |
"ap-southeast-2" : { | |
"AMI" : "ami-bf2e6085" | |
}, | |
"ap-southeast-1" : { | |
"AMI" : "ami-6c81943e" | |
}, | |
"us-east-1" : { | |
"AMI" : "ami-3f43355a" | |
}, | |
"us-west-2" : { | |
"AMI" : "ami-2d98871d" | |
}, | |
"us-west-1" : { | |
"AMI" : "ami-874b8ec3" | |
}, | |
"eu-west-1" : { | |
"AMI" : "ami-6195b816" | |
} | |
} | |
}, | |
"Parameters": { | |
"InstanceType" : { | |
"Description" : "EC2 PV instance type (m3.medium, etc).", | |
"Type" : "String", | |
"Default" : "t1.micro", | |
"AllowedValues" : [ | |
"t1.micro", | |
"m1.small", | |
"m1.medium", | |
"m1.large", | |
"m1.xlarge", | |
"m2.xlarge", | |
"m2.2xlarge", | |
"m2.4xlarge", | |
"m3.2xlarge", | |
"c1.medium", | |
"c1.xlarge" | |
], | |
"ConstraintDescription" : "Must be a valid EC2 PV instance type." | |
}, | |
"ClusterSize": { | |
"Default": "3", | |
"MinValue": "3", | |
"MaxValue": "12", | |
"Description": "Number of nodes in cluster (3-12).", | |
"Type": "Number" | |
}, | |
"DiscoveryURL": { | |
"Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new?size=<your cluster size>", | |
"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": { | |
"CoreOSSecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "CoreOS SecurityGroup", | |
"SecurityGroupIngress": [ | |
{"IpProtocol": "tcp", "FromPort": "22", "ToPort": "22", "CidrIp": {"Ref": "AllowSSHFrom"}} | |
] | |
} | |
}, | |
"Ingress4001": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4001", "ToPort": "4001", "SourceSecurityGroupId": { | |
"Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] | |
} | |
} | |
}, | |
"Ingress2379": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "2379", "ToPort": "2379", "SourceSecurityGroupId": { | |
"Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] | |
} | |
} | |
}, | |
"Ingress2380": { | |
"Type": "AWS::EC2::SecurityGroupIngress", | |
"Properties": { | |
"GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "2380", "ToPort": "2380", "SourceSecurityGroupId": { | |
"Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] | |
} | |
} | |
}, | |
"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": "CoreOSSecurityGroup"}], | |
"UserData" : { "Fn::Base64": | |
{ "Fn::Join": [ "", [ | |
"#cloud-config\n\n", | |
"coreos:\n", | |
" etcd2:\n", | |
" discovery: ", { "Ref": "DiscoveryURL" }, "\n", | |
" advertise-client-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2379\n", | |
" initial-advertise-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", | |
" listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001\n", | |
" listen-peer-urls: http://$", { "Ref": "AdvertisedIPAddress" }, "_ipv4:2380\n", | |
" units:\n", | |
" - name: etcd2.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