diff --git a/playbooks/base.yml b/playbooks/base.yml index a36c877..a016e39 100644 --- a/playbooks/base.yml +++ b/playbooks/base.yml @@ -20,3 +20,4 @@ InstanceType: "t2.micro" KeyName: "{{ keys }}" DeployRepo: "{{ deployrepo }}" + AvailabilityZone: "{{ availability_zone }}" diff --git a/templates/base.json b/templates/base.json index 45c5136..1359792 100644 --- a/templates/base.json +++ b/templates/base.json @@ -27,6 +27,10 @@ "DeployRepo": { "Type": "String", "Description": "URL for MIG deploy repo" + }, + "AvailabilityZone": { + "Type": "String", + "Description": "Availability zone to use for subnets" } }, "Resources": { @@ -59,6 +63,7 @@ "Properties": { "VpcId": { "Ref": "VPC" }, "CidrBlock": "10.20.0.0/24", + "AvailabilityZone": { "Ref": "AvailabilityZone" }, "Tags": [ { "Key": "Name", "Value": "mig public subnet" } ] @@ -94,6 +99,7 @@ "Properties": { "VpcId": { "Ref": "VPC" }, "CidrBlock": "10.20.1.0/24", + "AvailabilityZone": { "Ref": "AvailabilityZone" }, "MapPublicIpOnLaunch": "false", "Tags": [ { "Key": "Name", "Value": "mig private subnet" } @@ -192,6 +198,11 @@ "Value": { "Ref": "PublicSubnet" }, "Export": { "Name": {"Fn::Sub": "${AWS::StackName}-PublicSubnet" }} }, + "AvailabilityZone": { + "Description": "Availability zone", + "Value": { "Ref": "AvailabilityZone" }, + "Export": { "Name": {"Fn::Sub": "${AWS::StackName}-AvailabilityZone" }} + }, "BastionInstanceId": { "Description": "Bastion host instance ID", "Value": { "Ref": "BastionInstance" }, diff --git a/vars/default.yml b/vars/default.yml index 5e47d25..4bc54c9 100644 --- a/vars/default.yml +++ b/vars/default.yml @@ -1,5 +1,6 @@ --- region: us-west-2 +availability_zone: us-west-2a keys: "alm-keys" ami_id: ami-2709bd47 state: present