{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Template Edited by Alex - CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", "Mappings": { "RegionMap": { "eu-central-1": { "AMI": "ami-cfca25a0" }, "ap-northeast-1": { "AMI": "ami-72ae4313" }, "us-gov-west-1": { "AMI": "ami-c42b94a5" }, "ap-northeast-2": { "AMI": "ami-83ce05ed" }, "sa-east-1": { "AMI": "ami-038c076f" }, "ap-southeast-2": { "AMI": "ami-4b7a5428" }, "ap-southeast-1": { "AMI": "ami-d704d5b4" }, "us-east-1": { "AMI": "ami-6160910c" }, "us-west-2": { "AMI": "ami-32a85152" }, "us-west-1": { "AMI": "ami-79473c19" }, "eu-west-1": { "AMI": "ami-c36effb0" } } }, "Parameters": { "InstanceType": { "Description": "EC2 HVM instance type (m3.xlarge, etc).", "Type": "String", "Default": "m3.xlarge", "ConstraintDescription": "Must be a valid EC2 HVM instance type." }, "ClusterSize": { "Default": "1", "MinValue": "1", "MaxValue": "12", "Description": "Number of nodes in cluster (1-12).", "Type": "Number" }, "DiscoveryURL": { "Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new?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": { "InstanceSecurityGroup": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupDescription": "Free For All", "SecurityGroupIngress": [ { "IpProtocol": "tcp", "CidrIp": "0.0.0.0/0", "FromPort": "0", "ToPort": "65000" }, { "IpProtocol": "udp", "CidrIp": "0.0.0.0/0", "FromPort": "0", "ToPort": "65000" } ] }, "Metadata": { "AWS::CloudFormation::Designer": { "id": "058788dc-c071-4c53-801a-56c6857c047e" } } }, "CoreOSServerAutoScale": { "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { "AvailabilityZones": { "Fn::GetAZs": "" }, "LaunchConfigurationName": { "Ref": "CoreOSServerLaunchConfig" }, "MinSize": "1", "MaxSize": "12", "DesiredCapacity": { "Ref": "ClusterSize" }, "Tags": [ { "Key": "Name", "Value": { "Ref": "AWS::StackName" }, "PropagateAtLaunch": true } ] }, "Metadata": { "AWS::CloudFormation::Designer": { "id": "cdc255bb-45c7-4727-b32f-f586eea7a7be" } } }, "CoreOSServerLaunchConfig": { "Type": "AWS::AutoScaling::LaunchConfiguration", "Properties": { "ImageId": { "Fn::FindInMap": [ "RegionMap", { "Ref": "AWS::Region" }, "AMI" ] }, "InstanceType": { "Ref": "InstanceType" }, "KeyName": { "Ref": "KeyPair" }, "BlockDeviceMappings": [ { "DeviceName": "/dev/xvda", "Ebs": { "VolumeSize": "50", "VolumeType": "standard", "DeleteOnTermination": "true" } } ], "SecurityGroups": [ { "Ref": "InstanceSecurityGroup" } ], "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" ] ] } } }, "Metadata": { "AWS::CloudFormation::Designer": { "id": "6b761ed7-1b28-40c8-a667-636a522425fb" } } } }, "Metadata": { "AWS::CloudFormation::Designer": { "a15db9eb-da80-4272-9344-79506b9b113d": { "size": { "width": 60, "height": 60 }, "position": { "x": 60, "y": 90 }, "z": 1, "embeds": [] }, "6b761ed7-1b28-40c8-a667-636a522425fb": { "size": { "width": 60, "height": 60 }, "position": { "x": 180, "y": 90 }, "z": 1, "embeds": [], "ismemberof": [ "a15db9eb-da80-4272-9344-79506b9b113d" ] }, "cdc255bb-45c7-4727-b32f-f586eea7a7be": { "size": { "width": 60, "height": 60 }, "position": { "x": 60, "y": 210 }, "z": 1, "embeds": [], "isassociatedwith": [ "6b761ed7-1b28-40c8-a667-636a522425fb" ] } } } }