wombat-cli 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +23 -23
- data/.travis.yml +22 -27
- data/CHANGELOG.md +438 -423
- data/DESIGN.md +49 -49
- data/Gemfile +5 -5
- data/README.md +146 -146
- data/Rakefile +26 -26
- data/bin/wombat +24 -24
- data/generator_files/Vagrantfile +120 -120
- data/generator_files/cookbooks/automate/.gitignore +16 -16
- data/generator_files/cookbooks/automate/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/automate/.kitchen.yml +24 -24
- data/generator_files/cookbooks/automate/Berksfile +6 -6
- data/generator_files/cookbooks/automate/README.md +4 -4
- data/generator_files/cookbooks/automate/chefignore +102 -102
- data/generator_files/cookbooks/automate/libraries/_helper.rb +52 -52
- data/generator_files/cookbooks/automate/libraries/delivery_api.rb +204 -204
- data/generator_files/cookbooks/automate/libraries/delivery_project.rb +31 -31
- data/generator_files/cookbooks/automate/libraries/dsl.rb +4 -4
- data/generator_files/cookbooks/automate/metadata.rb +11 -11
- data/generator_files/cookbooks/automate/recipes/default.rb +118 -124
- data/generator_files/cookbooks/automate/recipes/update-users.rb +48 -48
- data/generator_files/cookbooks/automate/templates/delivery.erb +6 -6
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/automate/test/integration/default/automate_spec.rb +56 -56
- data/generator_files/cookbooks/build_node/.gitignore +16 -16
- data/generator_files/cookbooks/build_node/.kitchen.ec2.yml +37 -37
- data/generator_files/cookbooks/build_node/.kitchen.yml +23 -23
- data/generator_files/cookbooks/build_node/Berksfile +8 -8
- data/generator_files/cookbooks/build_node/README.md +4 -4
- data/generator_files/cookbooks/build_node/chefignore +102 -102
- data/generator_files/cookbooks/build_node/metadata.rb +12 -12
- data/generator_files/cookbooks/build_node/recipes/default.rb +38 -38
- data/generator_files/cookbooks/build_node/templates/client.erb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/recipes/default.rb +18 -18
- data/generator_files/cookbooks/build_node/test/integration/default/build-node_spec.rb +40 -40
- data/generator_files/cookbooks/chef_server/.gitignore +16 -16
- data/generator_files/cookbooks/chef_server/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/chef_server/.kitchen.yml +24 -24
- data/generator_files/cookbooks/chef_server/Berksfile +6 -6
- data/generator_files/cookbooks/chef_server/README.md +4 -4
- data/generator_files/cookbooks/chef_server/chefignore +102 -102
- data/generator_files/cookbooks/chef_server/metadata.rb +11 -11
- data/generator_files/cookbooks/chef_server/recipes/bootstrap_users.rb +91 -91
- data/generator_files/cookbooks/chef_server/recipes/default.rb +113 -113
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/recipes/default.rb +23 -23
- data/generator_files/cookbooks/chef_server/test/integration/default/chef_server_spec.rb +50 -50
- data/generator_files/cookbooks/compliance/.gitignore +16 -16
- data/generator_files/cookbooks/compliance/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/compliance/.kitchen.yml +24 -24
- data/generator_files/cookbooks/compliance/Berksfile +7 -7
- data/generator_files/cookbooks/compliance/README.md +4 -4
- data/generator_files/cookbooks/compliance/chefignore +102 -102
- data/generator_files/cookbooks/compliance/metadata.rb +11 -11
- data/generator_files/cookbooks/compliance/recipes/default.rb +57 -57
- data/generator_files/cookbooks/compliance/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/compliance/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/metadata.rb +4 -4
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/compliance/test/integration/default/compliance.rb +28 -28
- data/generator_files/cookbooks/infranodes/.gitignore +16 -16
- data/generator_files/cookbooks/infranodes/.kitchen.ec2.yml +48 -48
- data/generator_files/cookbooks/infranodes/.kitchen.yml +21 -21
- data/generator_files/cookbooks/infranodes/Berksfile +6 -6
- data/generator_files/cookbooks/infranodes/README.md +4 -4
- data/generator_files/cookbooks/infranodes/attributes/default.rb +2 -2
- data/generator_files/cookbooks/infranodes/chefignore +102 -102
- data/generator_files/cookbooks/infranodes/metadata.rb +13 -13
- data/generator_files/cookbooks/infranodes/recipes/default.rb +57 -57
- data/generator_files/cookbooks/infranodes/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/infranodes/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/infranodes/templates/default/client.rb.erb +5 -5
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/infranodes/test/integration/default/infranodes_spec.rb +22 -22
- data/generator_files/cookbooks/infranodes/test/integration/helpers/serverspec/spec_helper.rb +8 -8
- data/generator_files/cookbooks/wombat/.gitignore +16 -16
- data/generator_files/cookbooks/wombat/.kitchen.yml +43 -43
- data/generator_files/cookbooks/wombat/Berksfile +5 -5
- data/generator_files/cookbooks/wombat/README.md +4 -4
- data/generator_files/cookbooks/wombat/attributes/default.rb +79 -80
- data/generator_files/cookbooks/wombat/attributes/packer.rb +18 -18
- data/generator_files/cookbooks/wombat/chefignore +102 -102
- data/generator_files/cookbooks/wombat/metadata.rb +13 -13
- data/generator_files/cookbooks/wombat/recipes/authorized-keys.rb +20 -20
- data/generator_files/cookbooks/wombat/recipes/default.rb +111 -111
- data/generator_files/cookbooks/wombat/recipes/etc-hosts.rb +51 -51
- data/generator_files/cookbooks/workstation/.gitignore +16 -16
- data/generator_files/cookbooks/workstation/.kitchen.azure.yml +45 -0
- data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +46 -30
- data/generator_files/cookbooks/workstation/.kitchen.yml +42 -22
- data/generator_files/cookbooks/workstation/Berksfile +7 -7
- data/generator_files/cookbooks/workstation/README.md +3 -3
- data/generator_files/cookbooks/workstation/chefignore +106 -102
- data/generator_files/cookbooks/workstation/files/atom.apm.list +10 -7
- data/generator_files/cookbooks/workstation/files/atom.config.cson +6 -3
- data/generator_files/cookbooks/workstation/{templates/default/ise_profile.ps1.erb → files/ise_profile.ps1} +11 -11
- data/generator_files/cookbooks/workstation/libraries/home.rb +4 -4
- data/generator_files/cookbooks/workstation/metadata.rb +14 -14
- data/generator_files/cookbooks/workstation/recipes/browser.rb +53 -58
- data/generator_files/cookbooks/workstation/recipes/certs-keys.rb +41 -45
- data/generator_files/cookbooks/workstation/recipes/chef.rb +29 -28
- data/generator_files/cookbooks/workstation/recipes/default.rb +24 -21
- data/generator_files/cookbooks/workstation/recipes/dotnet.rb +19 -17
- data/generator_files/cookbooks/workstation/recipes/editor.rb +46 -18
- data/generator_files/cookbooks/workstation/recipes/profile.rb +14 -41
- data/generator_files/cookbooks/workstation/recipes/terminal.rb +11 -11
- data/generator_files/cookbooks/workstation/templates/default/bookmarks.html.erb +23 -23
- data/generator_files/cookbooks/workstation/templates/default/data_collector.rb.erb +2 -2
- data/generator_files/cookbooks/workstation/templates/default/knife.rb.erb +10 -10
- data/generator_files/cookbooks/workstation/templates/default/master_preferences.json.erb +28 -28
- data/generator_files/cookbooks/workstation/templates/default/ssh_config.erb +16 -16
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +77 -37
- data/generator_files/packer/automate.json +136 -136
- data/generator_files/packer/build-node.json +142 -142
- data/generator_files/packer/chef-server.json +137 -137
- data/generator_files/packer/compliance.json +133 -133
- data/generator_files/packer/infranodes-windows.json +143 -143
- data/generator_files/packer/infranodes.json +134 -134
- data/generator_files/packer/scripts/PreSysprep.ps1 +9 -0
- data/generator_files/packer/workstation.json +160 -142
- data/generator_files/templates/arm.md.json.erb +754 -754
- data/generator_files/templates/arm.vhd.json.erb +630 -630
- data/generator_files/templates/bootstrap-aws.erb +39 -39
- data/generator_files/templates/cfn.json.erb +675 -674
- data/generator_files/wombat.yml +75 -74
- data/lib/wombat/aws.rb +67 -67
- data/lib/wombat/build.rb +392 -392
- data/lib/wombat/cli.rb +254 -254
- data/lib/wombat/common.rb +420 -420
- data/lib/wombat/crypto.rb +65 -65
- data/lib/wombat/delete.rb +67 -67
- data/lib/wombat/deploy.rb +128 -128
- data/lib/wombat/init.rb +32 -32
- data/lib/wombat/latest.rb +27 -27
- data/lib/wombat/output.rb +101 -101
- data/lib/wombat/update.rb +20 -20
- data/lib/wombat/version.rb +3 -3
- data/lib/wombat.rb +8 -8
- data/spec/functional/common_spec.rb +26 -26
- data/spec/spec_helper.rb +103 -103
- data/spec/unit/common_spec.rb +116 -116
- data/terraform/README.md +13 -13
- data/terraform/templates/terraform.tfvars.erb +12 -12
- data/terraform/wombat.tf +328 -328
- data/wombat-cli.gemspec +36 -36
- metadata +6 -4
@@ -1,674 +1,675 @@
|
|
1
|
-
|
2
|
-
{
|
3
|
-
"AWSTemplateFormatVersion": "2010-09-09",
|
4
|
-
"Description": "wombat",
|
5
|
-
"Parameters": {
|
6
|
-
"AvailabilityZone": {
|
7
|
-
"Description": "Availability Zone",
|
8
|
-
"Type": "String",
|
9
|
-
"Default": "<%= @availability_zone %>"
|
10
|
-
},
|
11
|
-
"DemoName": {
|
12
|
-
"Description": "Name of the customer or organization",
|
13
|
-
"Type": "String",
|
14
|
-
"Default": "<%= @demo %>"
|
15
|
-
},
|
16
|
-
"Version": {
|
17
|
-
"Description": "Version",
|
18
|
-
"Type": "String",
|
19
|
-
"Default": "<%= @version %>"
|
20
|
-
},
|
21
|
-
"KeyName": {
|
22
|
-
"Description": "Name of an existing ec2 KeyPair to enable SSH access",
|
23
|
-
"Type": "AWS::EC2::KeyPair::KeyName",
|
24
|
-
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
|
25
|
-
},
|
26
|
-
"SSHLocation": {
|
27
|
-
"Description": "The IP address range that can be used to SSH to the EC2 instances",
|
28
|
-
"Type": "String",
|
29
|
-
"MinLength": "9",
|
30
|
-
"MaxLength": "18",
|
31
|
-
"Default": "0.0.0.0/0",
|
32
|
-
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
|
33
|
-
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
|
34
|
-
},
|
35
|
-
"TTL": {
|
36
|
-
"Description": "Time in hours for the demo to stay active. Default is 4, maximum is 720 hours (30 days).",
|
37
|
-
"Type": "Number",
|
38
|
-
"Default": <%= @ttl %>,
|
39
|
-
"MinValue": 0,
|
40
|
-
"MaxValue": 720
|
41
|
-
},
|
42
|
-
"ChefServerAMI": {
|
43
|
-
"Type": "String",
|
44
|
-
"Default": "<%= @chef_server_ami %>",
|
45
|
-
"Description": "AMI ID for the Chef Server"
|
46
|
-
},
|
47
|
-
"ComplianceAMI": {
|
48
|
-
"Type": "String",
|
49
|
-
"Default": "<%= @compliance_ami %>",
|
50
|
-
"Description": "AMI ID for the Compliance Server"
|
51
|
-
},
|
52
|
-
<% 1.upto(@build_nodes) do |i| -%>
|
53
|
-
"BuildNode<%= i.to_s %>AMI": {
|
54
|
-
"Type": "String",
|
55
|
-
"Default": "<%= @build_node_ami[i] %>",
|
56
|
-
"Description": "AMI ID for Build Node <%= i %>"
|
57
|
-
},
|
58
|
-
<% end -%>
|
59
|
-
<% @infra.each do |name, ami| -%>
|
60
|
-
"<%= name %>AMI": {
|
61
|
-
"Type": "String",
|
62
|
-
"Default": "<%= ami %>",
|
63
|
-
"Description": "AMI ID for <%= name %>"
|
64
|
-
},
|
65
|
-
<% end -%>
|
66
|
-
<% 1.upto(@workstations) do |i| -%>
|
67
|
-
"WindowsWorkstation<%= i.to_s %>AMI": {
|
68
|
-
"Type": "String",
|
69
|
-
"Default": "<%= @workstation_ami[i] %>",
|
70
|
-
"Description": "AMI ID for the Windows Workstation"
|
71
|
-
},
|
72
|
-
<% end -%>
|
73
|
-
"AutomateAMI": {
|
74
|
-
"Type": "String",
|
75
|
-
"Default": "<%= @automate_ami %>",
|
76
|
-
"Description": "AMI ID for the Automate Server"
|
77
|
-
}
|
78
|
-
},
|
79
|
-
"Resources": {
|
80
|
-
<% if @iam_roles -%>
|
81
|
-
"InstanceProfile" : {
|
82
|
-
"Type" : "AWS::IAM::InstanceProfile",
|
83
|
-
"Properties" : {
|
84
|
-
"Path" : "/",
|
85
|
-
"Roles" : <%= @iam_roles %>
|
86
|
-
}
|
87
|
-
},
|
88
|
-
<% end -%>
|
89
|
-
"VPC": {
|
90
|
-
"Type": "AWS::EC2::VPC",
|
91
|
-
"Properties": {
|
92
|
-
"CidrBlock": "172.31.0.0/16",
|
93
|
-
"EnableDnsSupport": "true",
|
94
|
-
"EnableDnsHostnames": "true",
|
95
|
-
"Tags": [
|
96
|
-
{
|
97
|
-
"Key": "Application",
|
98
|
-
"Value": {
|
99
|
-
"Ref": "AWS::StackId"
|
100
|
-
},
|
101
|
-
"Key": "Name",
|
102
|
-
"Value": {
|
103
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "VPC" ] ]
|
104
|
-
}
|
105
|
-
}
|
106
|
-
]
|
107
|
-
}
|
108
|
-
},
|
109
|
-
"SubnetAutomate": {
|
110
|
-
"Type": "AWS::EC2::Subnet",
|
111
|
-
"Properties": {
|
112
|
-
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
113
|
-
"VpcId": {
|
114
|
-
"Ref": "VPC"
|
115
|
-
},
|
116
|
-
"CidrBlock": "172.31.54.0/24",
|
117
|
-
"Tags": [
|
118
|
-
{
|
119
|
-
"Key": "Application",
|
120
|
-
"Value": {
|
121
|
-
"Ref": "AWS::StackId"
|
122
|
-
},
|
123
|
-
"Key": "Name",
|
124
|
-
"Value": {
|
125
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Automate Subnet" ] ]
|
126
|
-
}
|
127
|
-
}
|
128
|
-
]
|
129
|
-
}
|
130
|
-
},
|
131
|
-
"SubnetProd": {
|
132
|
-
"Type": "AWS::EC2::Subnet",
|
133
|
-
"Properties": {
|
134
|
-
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
135
|
-
"VpcId": {
|
136
|
-
"Ref": "VPC"
|
137
|
-
},
|
138
|
-
"CidrBlock": "172.31.62.0/24",
|
139
|
-
"Tags": [
|
140
|
-
{
|
141
|
-
"Key": "Application",
|
142
|
-
"Value": {
|
143
|
-
"Ref": "AWS::StackId"
|
144
|
-
},
|
145
|
-
"Key": "Name",
|
146
|
-
"Value": {
|
147
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Prod Subnet" ] ]
|
148
|
-
}
|
149
|
-
}
|
150
|
-
]
|
151
|
-
}
|
152
|
-
},
|
153
|
-
"SubnetWorkstations": {
|
154
|
-
"Type": "AWS::EC2::Subnet",
|
155
|
-
"Properties": {
|
156
|
-
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
157
|
-
"VpcId": {
|
158
|
-
"Ref": "VPC"
|
159
|
-
},
|
160
|
-
"CidrBlock": "172.31.10.0/24",
|
161
|
-
"Tags": [
|
162
|
-
{
|
163
|
-
"Key": "Application",
|
164
|
-
"Value": {
|
165
|
-
"Ref": "AWS::StackId"
|
166
|
-
},
|
167
|
-
"Key": "Name",
|
168
|
-
"Value": {
|
169
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Workstations Subnet" ] ]
|
170
|
-
}
|
171
|
-
}
|
172
|
-
]
|
173
|
-
}
|
174
|
-
},
|
175
|
-
"InternetGateway": {
|
176
|
-
"Type": "AWS::EC2::InternetGateway",
|
177
|
-
"Properties": {
|
178
|
-
"Tags": [
|
179
|
-
{
|
180
|
-
"Key": "Application",
|
181
|
-
"Value": {
|
182
|
-
"Ref": "AWS::StackId"
|
183
|
-
},
|
184
|
-
"Key": "Name",
|
185
|
-
"Value": {
|
186
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, " IG" ] ]
|
187
|
-
}
|
188
|
-
}
|
189
|
-
]
|
190
|
-
}
|
191
|
-
},
|
192
|
-
"AttachGateway": {
|
193
|
-
"Type": "AWS::EC2::VPCGatewayAttachment",
|
194
|
-
"Properties": {
|
195
|
-
"VpcId": {
|
196
|
-
"Ref": "VPC"
|
197
|
-
},
|
198
|
-
"InternetGatewayId": {
|
199
|
-
"Ref": "InternetGateway"
|
200
|
-
}
|
201
|
-
}
|
202
|
-
},
|
203
|
-
"RouteTable": {
|
204
|
-
"Type": "AWS::EC2::RouteTable",
|
205
|
-
"Properties": {
|
206
|
-
"VpcId": {
|
207
|
-
"Ref": "VPC"
|
208
|
-
},
|
209
|
-
"Tags": [
|
210
|
-
{
|
211
|
-
"Key": "Application",
|
212
|
-
"Value": {
|
213
|
-
"Ref": "AWS::StackId"
|
214
|
-
},
|
215
|
-
"Key": "Name",
|
216
|
-
"Value": {
|
217
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Demo RouteTable" ] ]
|
218
|
-
}
|
219
|
-
}
|
220
|
-
]
|
221
|
-
}
|
222
|
-
},
|
223
|
-
"Route": {
|
224
|
-
"Type": "AWS::EC2::Route",
|
225
|
-
"DependsOn": "AttachGateway",
|
226
|
-
"Properties": {
|
227
|
-
"RouteTableId": {
|
228
|
-
"Ref": "RouteTable"
|
229
|
-
},
|
230
|
-
"DestinationCidrBlock": "0.0.0.0/0",
|
231
|
-
"GatewayId": {
|
232
|
-
"Ref": "InternetGateway"
|
233
|
-
}
|
234
|
-
}
|
235
|
-
},
|
236
|
-
"SubnetRouteTableAssociationAutomate": {
|
237
|
-
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
238
|
-
"Properties": {
|
239
|
-
"SubnetId": {
|
240
|
-
"Ref": "SubnetAutomate"
|
241
|
-
},
|
242
|
-
"RouteTableId": {
|
243
|
-
"Ref": "RouteTable"
|
244
|
-
}
|
245
|
-
}
|
246
|
-
},
|
247
|
-
"SubnetRouteTableAssociationProd": {
|
248
|
-
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
249
|
-
"Properties": {
|
250
|
-
"SubnetId": {
|
251
|
-
"Ref": "SubnetProd"
|
252
|
-
},
|
253
|
-
"RouteTableId": {
|
254
|
-
"Ref": "RouteTable"
|
255
|
-
}
|
256
|
-
}
|
257
|
-
},
|
258
|
-
"SubnetRouteTableAssociationWorkstations": {
|
259
|
-
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
260
|
-
"Properties": {
|
261
|
-
"SubnetId": {
|
262
|
-
"Ref": "SubnetWorkstations"
|
263
|
-
},
|
264
|
-
"RouteTableId": {
|
265
|
-
"Ref": "RouteTable"
|
266
|
-
}
|
267
|
-
}
|
268
|
-
},
|
269
|
-
"NetworkAcl": {
|
270
|
-
"Type": "AWS::EC2::NetworkAcl",
|
271
|
-
"Properties": {
|
272
|
-
"VpcId": {
|
273
|
-
"Ref": "VPC"
|
274
|
-
},
|
275
|
-
"Tags": [
|
276
|
-
{
|
277
|
-
"Key": "Application",
|
278
|
-
"Value": {
|
279
|
-
"Ref": "AWS::StackId"
|
280
|
-
},
|
281
|
-
"Key": "Name",
|
282
|
-
"Value": {
|
283
|
-
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "NetworkAcl" ] ]
|
284
|
-
}
|
285
|
-
}
|
286
|
-
]
|
287
|
-
}
|
288
|
-
},
|
289
|
-
"InboundNetworkAclEntry": {
|
290
|
-
"Type": "AWS::EC2::NetworkAclEntry",
|
291
|
-
"Properties": {
|
292
|
-
"NetworkAclId": {
|
293
|
-
"Ref": "NetworkAcl"
|
294
|
-
},
|
295
|
-
"RuleNumber": "100",
|
296
|
-
"Protocol": "-1",
|
297
|
-
"RuleAction": "allow",
|
298
|
-
"Egress": "false",
|
299
|
-
"CidrBlock": "0.0.0.0/0"
|
300
|
-
}
|
301
|
-
},
|
302
|
-
"OutBoundNetworkAclEntry": {
|
303
|
-
"Type": "AWS::EC2::NetworkAclEntry",
|
304
|
-
"Properties": {
|
305
|
-
"NetworkAclId": {
|
306
|
-
"Ref": "NetworkAcl"
|
307
|
-
},
|
308
|
-
"RuleNumber": "100",
|
309
|
-
"Protocol": "-1",
|
310
|
-
"RuleAction": "allow",
|
311
|
-
"Egress": "true",
|
312
|
-
"CidrBlock": "0.0.0.0/0"
|
313
|
-
}
|
314
|
-
},
|
315
|
-
"SubnetNetworkAclAssociationAutomate": {
|
316
|
-
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
317
|
-
"Properties": {
|
318
|
-
"SubnetId": {
|
319
|
-
"Ref": "SubnetAutomate"
|
320
|
-
},
|
321
|
-
"NetworkAclId": {
|
322
|
-
"Ref": "NetworkAcl"
|
323
|
-
}
|
324
|
-
}
|
325
|
-
},
|
326
|
-
"SubnetNetworkAclAssociationProd": {
|
327
|
-
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
328
|
-
"Properties": {
|
329
|
-
"SubnetId": {
|
330
|
-
"Ref": "SubnetProd"
|
331
|
-
},
|
332
|
-
"NetworkAclId": {
|
333
|
-
"Ref": "NetworkAcl"
|
334
|
-
}
|
335
|
-
}
|
336
|
-
},
|
337
|
-
"SubnetNetworkAclAssociationPOCWorkstations": {
|
338
|
-
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
339
|
-
"Properties": {
|
340
|
-
"SubnetId": {
|
341
|
-
"Ref": "SubnetWorkstations"
|
342
|
-
},
|
343
|
-
"NetworkAclId": {
|
344
|
-
"Ref": "NetworkAcl"
|
345
|
-
}
|
346
|
-
}
|
347
|
-
},
|
348
|
-
<% 1.upto(@workstations) do |i| -%>
|
349
|
-
"WindowsWorkstation<%= i.to_s %>": {
|
350
|
-
"Type": "AWS::EC2::Instance",
|
351
|
-
"Properties": {
|
352
|
-
"InstanceType": "
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
"
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
"
|
366
|
-
"
|
367
|
-
"
|
368
|
-
"
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
"
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
<%
|
391
|
-
|
392
|
-
|
393
|
-
"
|
394
|
-
|
395
|
-
"
|
396
|
-
"
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
"
|
405
|
-
"
|
406
|
-
"
|
407
|
-
"
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
"
|
414
|
-
|
415
|
-
"
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
"
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
<%
|
432
|
-
|
433
|
-
|
434
|
-
"
|
435
|
-
|
436
|
-
"
|
437
|
-
"
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
"
|
446
|
-
"
|
447
|
-
"
|
448
|
-
"
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
"
|
455
|
-
|
456
|
-
"
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
"
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
"
|
475
|
-
|
476
|
-
"
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
"
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
"
|
492
|
-
"
|
493
|
-
"
|
494
|
-
"
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
"
|
501
|
-
|
502
|
-
"
|
503
|
-
"
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
"
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
"
|
521
|
-
|
522
|
-
"
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
"
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
"
|
538
|
-
"
|
539
|
-
"
|
540
|
-
"
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
"
|
547
|
-
|
548
|
-
"
|
549
|
-
"
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
"
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
"
|
567
|
-
|
568
|
-
"
|
569
|
-
"
|
570
|
-
|
571
|
-
|
572
|
-
"
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
"
|
584
|
-
"
|
585
|
-
"
|
586
|
-
"
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
"
|
593
|
-
|
594
|
-
"
|
595
|
-
"
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
"
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
"
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
"
|
618
|
-
|
619
|
-
|
620
|
-
"
|
621
|
-
"
|
622
|
-
"
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
"
|
629
|
-
"
|
630
|
-
"
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
"
|
635
|
-
"
|
636
|
-
"
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
"
|
641
|
-
"
|
642
|
-
"
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
"
|
647
|
-
"
|
648
|
-
"
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
"
|
653
|
-
"
|
654
|
-
"
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
<%
|
663
|
-
|
664
|
-
|
665
|
-
"
|
666
|
-
|
667
|
-
|
668
|
-
"
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
1
|
+
|
2
|
+
{
|
3
|
+
"AWSTemplateFormatVersion": "2010-09-09",
|
4
|
+
"Description": "wombat (<%= @version %>)",
|
5
|
+
"Parameters": {
|
6
|
+
"AvailabilityZone": {
|
7
|
+
"Description": "Availability Zone",
|
8
|
+
"Type": "String",
|
9
|
+
"Default": "<%= @availability_zone %>"
|
10
|
+
},
|
11
|
+
"DemoName": {
|
12
|
+
"Description": "Name of the customer or organization",
|
13
|
+
"Type": "String",
|
14
|
+
"Default": "<%= @demo %>"
|
15
|
+
},
|
16
|
+
"Version": {
|
17
|
+
"Description": "Version",
|
18
|
+
"Type": "String",
|
19
|
+
"Default": "<%= @version %>"
|
20
|
+
},
|
21
|
+
"KeyName": {
|
22
|
+
"Description": "Name of an existing ec2 KeyPair to enable SSH access",
|
23
|
+
"Type": "AWS::EC2::KeyPair::KeyName",
|
24
|
+
"ConstraintDescription": "must be the name of an existing EC2 KeyPair."
|
25
|
+
},
|
26
|
+
"SSHLocation": {
|
27
|
+
"Description": "The IP address range that can be used to SSH to the EC2 instances",
|
28
|
+
"Type": "String",
|
29
|
+
"MinLength": "9",
|
30
|
+
"MaxLength": "18",
|
31
|
+
"Default": "0.0.0.0/0",
|
32
|
+
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
|
33
|
+
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
|
34
|
+
},
|
35
|
+
"TTL": {
|
36
|
+
"Description": "Time in hours for the demo to stay active. Default is 4, maximum is 720 hours (30 days).",
|
37
|
+
"Type": "Number",
|
38
|
+
"Default": <%= @ttl %>,
|
39
|
+
"MinValue": 0,
|
40
|
+
"MaxValue": 720
|
41
|
+
},
|
42
|
+
"ChefServerAMI": {
|
43
|
+
"Type": "String",
|
44
|
+
"Default": "<%= @chef_server_ami %>",
|
45
|
+
"Description": "AMI ID for the Chef Server"
|
46
|
+
},
|
47
|
+
"ComplianceAMI": {
|
48
|
+
"Type": "String",
|
49
|
+
"Default": "<%= @compliance_ami %>",
|
50
|
+
"Description": "AMI ID for the Compliance Server"
|
51
|
+
},
|
52
|
+
<% 1.upto(@build_nodes) do |i| -%>
|
53
|
+
"BuildNode<%= i.to_s %>AMI": {
|
54
|
+
"Type": "String",
|
55
|
+
"Default": "<%= @build_node_ami[i] %>",
|
56
|
+
"Description": "AMI ID for Build Node <%= i %>"
|
57
|
+
},
|
58
|
+
<% end -%>
|
59
|
+
<% @infra.each do |name, ami| -%>
|
60
|
+
"<%= name %>AMI": {
|
61
|
+
"Type": "String",
|
62
|
+
"Default": "<%= ami %>",
|
63
|
+
"Description": "AMI ID for <%= name %>"
|
64
|
+
},
|
65
|
+
<% end -%>
|
66
|
+
<% 1.upto(@workstations) do |i| -%>
|
67
|
+
"WindowsWorkstation<%= i.to_s %>AMI": {
|
68
|
+
"Type": "String",
|
69
|
+
"Default": "<%= @workstation_ami[i] %>",
|
70
|
+
"Description": "AMI ID for the Windows Workstation"
|
71
|
+
},
|
72
|
+
<% end -%>
|
73
|
+
"AutomateAMI": {
|
74
|
+
"Type": "String",
|
75
|
+
"Default": "<%= @automate_ami %>",
|
76
|
+
"Description": "AMI ID for the Automate Server"
|
77
|
+
}
|
78
|
+
},
|
79
|
+
"Resources": {
|
80
|
+
<% if @iam_roles -%>
|
81
|
+
"InstanceProfile" : {
|
82
|
+
"Type" : "AWS::IAM::InstanceProfile",
|
83
|
+
"Properties" : {
|
84
|
+
"Path" : "/",
|
85
|
+
"Roles" : <%= @iam_roles %>
|
86
|
+
}
|
87
|
+
},
|
88
|
+
<% end -%>
|
89
|
+
"VPC": {
|
90
|
+
"Type": "AWS::EC2::VPC",
|
91
|
+
"Properties": {
|
92
|
+
"CidrBlock": "172.31.0.0/16",
|
93
|
+
"EnableDnsSupport": "true",
|
94
|
+
"EnableDnsHostnames": "true",
|
95
|
+
"Tags": [
|
96
|
+
{
|
97
|
+
"Key": "Application",
|
98
|
+
"Value": {
|
99
|
+
"Ref": "AWS::StackId"
|
100
|
+
},
|
101
|
+
"Key": "Name",
|
102
|
+
"Value": {
|
103
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "VPC" ] ]
|
104
|
+
}
|
105
|
+
}
|
106
|
+
]
|
107
|
+
}
|
108
|
+
},
|
109
|
+
"SubnetAutomate": {
|
110
|
+
"Type": "AWS::EC2::Subnet",
|
111
|
+
"Properties": {
|
112
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
113
|
+
"VpcId": {
|
114
|
+
"Ref": "VPC"
|
115
|
+
},
|
116
|
+
"CidrBlock": "172.31.54.0/24",
|
117
|
+
"Tags": [
|
118
|
+
{
|
119
|
+
"Key": "Application",
|
120
|
+
"Value": {
|
121
|
+
"Ref": "AWS::StackId"
|
122
|
+
},
|
123
|
+
"Key": "Name",
|
124
|
+
"Value": {
|
125
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Automate Subnet" ] ]
|
126
|
+
}
|
127
|
+
}
|
128
|
+
]
|
129
|
+
}
|
130
|
+
},
|
131
|
+
"SubnetProd": {
|
132
|
+
"Type": "AWS::EC2::Subnet",
|
133
|
+
"Properties": {
|
134
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
135
|
+
"VpcId": {
|
136
|
+
"Ref": "VPC"
|
137
|
+
},
|
138
|
+
"CidrBlock": "172.31.62.0/24",
|
139
|
+
"Tags": [
|
140
|
+
{
|
141
|
+
"Key": "Application",
|
142
|
+
"Value": {
|
143
|
+
"Ref": "AWS::StackId"
|
144
|
+
},
|
145
|
+
"Key": "Name",
|
146
|
+
"Value": {
|
147
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Prod Subnet" ] ]
|
148
|
+
}
|
149
|
+
}
|
150
|
+
]
|
151
|
+
}
|
152
|
+
},
|
153
|
+
"SubnetWorkstations": {
|
154
|
+
"Type": "AWS::EC2::Subnet",
|
155
|
+
"Properties": {
|
156
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
157
|
+
"VpcId": {
|
158
|
+
"Ref": "VPC"
|
159
|
+
},
|
160
|
+
"CidrBlock": "172.31.10.0/24",
|
161
|
+
"Tags": [
|
162
|
+
{
|
163
|
+
"Key": "Application",
|
164
|
+
"Value": {
|
165
|
+
"Ref": "AWS::StackId"
|
166
|
+
},
|
167
|
+
"Key": "Name",
|
168
|
+
"Value": {
|
169
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Workstations Subnet" ] ]
|
170
|
+
}
|
171
|
+
}
|
172
|
+
]
|
173
|
+
}
|
174
|
+
},
|
175
|
+
"InternetGateway": {
|
176
|
+
"Type": "AWS::EC2::InternetGateway",
|
177
|
+
"Properties": {
|
178
|
+
"Tags": [
|
179
|
+
{
|
180
|
+
"Key": "Application",
|
181
|
+
"Value": {
|
182
|
+
"Ref": "AWS::StackId"
|
183
|
+
},
|
184
|
+
"Key": "Name",
|
185
|
+
"Value": {
|
186
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, " IG" ] ]
|
187
|
+
}
|
188
|
+
}
|
189
|
+
]
|
190
|
+
}
|
191
|
+
},
|
192
|
+
"AttachGateway": {
|
193
|
+
"Type": "AWS::EC2::VPCGatewayAttachment",
|
194
|
+
"Properties": {
|
195
|
+
"VpcId": {
|
196
|
+
"Ref": "VPC"
|
197
|
+
},
|
198
|
+
"InternetGatewayId": {
|
199
|
+
"Ref": "InternetGateway"
|
200
|
+
}
|
201
|
+
}
|
202
|
+
},
|
203
|
+
"RouteTable": {
|
204
|
+
"Type": "AWS::EC2::RouteTable",
|
205
|
+
"Properties": {
|
206
|
+
"VpcId": {
|
207
|
+
"Ref": "VPC"
|
208
|
+
},
|
209
|
+
"Tags": [
|
210
|
+
{
|
211
|
+
"Key": "Application",
|
212
|
+
"Value": {
|
213
|
+
"Ref": "AWS::StackId"
|
214
|
+
},
|
215
|
+
"Key": "Name",
|
216
|
+
"Value": {
|
217
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Demo RouteTable" ] ]
|
218
|
+
}
|
219
|
+
}
|
220
|
+
]
|
221
|
+
}
|
222
|
+
},
|
223
|
+
"Route": {
|
224
|
+
"Type": "AWS::EC2::Route",
|
225
|
+
"DependsOn": "AttachGateway",
|
226
|
+
"Properties": {
|
227
|
+
"RouteTableId": {
|
228
|
+
"Ref": "RouteTable"
|
229
|
+
},
|
230
|
+
"DestinationCidrBlock": "0.0.0.0/0",
|
231
|
+
"GatewayId": {
|
232
|
+
"Ref": "InternetGateway"
|
233
|
+
}
|
234
|
+
}
|
235
|
+
},
|
236
|
+
"SubnetRouteTableAssociationAutomate": {
|
237
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
238
|
+
"Properties": {
|
239
|
+
"SubnetId": {
|
240
|
+
"Ref": "SubnetAutomate"
|
241
|
+
},
|
242
|
+
"RouteTableId": {
|
243
|
+
"Ref": "RouteTable"
|
244
|
+
}
|
245
|
+
}
|
246
|
+
},
|
247
|
+
"SubnetRouteTableAssociationProd": {
|
248
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
249
|
+
"Properties": {
|
250
|
+
"SubnetId": {
|
251
|
+
"Ref": "SubnetProd"
|
252
|
+
},
|
253
|
+
"RouteTableId": {
|
254
|
+
"Ref": "RouteTable"
|
255
|
+
}
|
256
|
+
}
|
257
|
+
},
|
258
|
+
"SubnetRouteTableAssociationWorkstations": {
|
259
|
+
"Type": "AWS::EC2::SubnetRouteTableAssociation",
|
260
|
+
"Properties": {
|
261
|
+
"SubnetId": {
|
262
|
+
"Ref": "SubnetWorkstations"
|
263
|
+
},
|
264
|
+
"RouteTableId": {
|
265
|
+
"Ref": "RouteTable"
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"NetworkAcl": {
|
270
|
+
"Type": "AWS::EC2::NetworkAcl",
|
271
|
+
"Properties": {
|
272
|
+
"VpcId": {
|
273
|
+
"Ref": "VPC"
|
274
|
+
},
|
275
|
+
"Tags": [
|
276
|
+
{
|
277
|
+
"Key": "Application",
|
278
|
+
"Value": {
|
279
|
+
"Ref": "AWS::StackId"
|
280
|
+
},
|
281
|
+
"Key": "Name",
|
282
|
+
"Value": {
|
283
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "NetworkAcl" ] ]
|
284
|
+
}
|
285
|
+
}
|
286
|
+
]
|
287
|
+
}
|
288
|
+
},
|
289
|
+
"InboundNetworkAclEntry": {
|
290
|
+
"Type": "AWS::EC2::NetworkAclEntry",
|
291
|
+
"Properties": {
|
292
|
+
"NetworkAclId": {
|
293
|
+
"Ref": "NetworkAcl"
|
294
|
+
},
|
295
|
+
"RuleNumber": "100",
|
296
|
+
"Protocol": "-1",
|
297
|
+
"RuleAction": "allow",
|
298
|
+
"Egress": "false",
|
299
|
+
"CidrBlock": "0.0.0.0/0"
|
300
|
+
}
|
301
|
+
},
|
302
|
+
"OutBoundNetworkAclEntry": {
|
303
|
+
"Type": "AWS::EC2::NetworkAclEntry",
|
304
|
+
"Properties": {
|
305
|
+
"NetworkAclId": {
|
306
|
+
"Ref": "NetworkAcl"
|
307
|
+
},
|
308
|
+
"RuleNumber": "100",
|
309
|
+
"Protocol": "-1",
|
310
|
+
"RuleAction": "allow",
|
311
|
+
"Egress": "true",
|
312
|
+
"CidrBlock": "0.0.0.0/0"
|
313
|
+
}
|
314
|
+
},
|
315
|
+
"SubnetNetworkAclAssociationAutomate": {
|
316
|
+
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
317
|
+
"Properties": {
|
318
|
+
"SubnetId": {
|
319
|
+
"Ref": "SubnetAutomate"
|
320
|
+
},
|
321
|
+
"NetworkAclId": {
|
322
|
+
"Ref": "NetworkAcl"
|
323
|
+
}
|
324
|
+
}
|
325
|
+
},
|
326
|
+
"SubnetNetworkAclAssociationProd": {
|
327
|
+
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
328
|
+
"Properties": {
|
329
|
+
"SubnetId": {
|
330
|
+
"Ref": "SubnetProd"
|
331
|
+
},
|
332
|
+
"NetworkAclId": {
|
333
|
+
"Ref": "NetworkAcl"
|
334
|
+
}
|
335
|
+
}
|
336
|
+
},
|
337
|
+
"SubnetNetworkAclAssociationPOCWorkstations": {
|
338
|
+
"Type": "AWS::EC2::SubnetNetworkAclAssociation",
|
339
|
+
"Properties": {
|
340
|
+
"SubnetId": {
|
341
|
+
"Ref": "SubnetWorkstations"
|
342
|
+
},
|
343
|
+
"NetworkAclId": {
|
344
|
+
"Ref": "NetworkAcl"
|
345
|
+
}
|
346
|
+
}
|
347
|
+
},
|
348
|
+
<% 1.upto(@workstations) do |i| -%>
|
349
|
+
"WindowsWorkstation<%= i.to_s %>": {
|
350
|
+
"Type": "AWS::EC2::Instance",
|
351
|
+
"Properties": {
|
352
|
+
"InstanceType": "c4.large",
|
353
|
+
"EbsOptimized" : "true",
|
354
|
+
<% if @iam_roles -%>
|
355
|
+
"IamInstanceProfile" : {"Ref" : "InstanceProfile"},
|
356
|
+
<% end -%>
|
357
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
358
|
+
"NetworkInterfaces": [
|
359
|
+
{
|
360
|
+
"GroupSet": [
|
361
|
+
{
|
362
|
+
"Ref": "DemoSecurityGroup"
|
363
|
+
}
|
364
|
+
],
|
365
|
+
"AssociatePublicIpAddress": "true",
|
366
|
+
"PrivateIpAddress": "172.31.54.<%= 200 + i %>",
|
367
|
+
"DeviceIndex": "0",
|
368
|
+
"DeleteOnTermination": "true",
|
369
|
+
"SubnetId": {
|
370
|
+
"Ref": "SubnetAutomate"
|
371
|
+
}
|
372
|
+
}
|
373
|
+
],
|
374
|
+
"KeyName": {
|
375
|
+
"Ref": "KeyName"
|
376
|
+
},
|
377
|
+
"ImageId": {
|
378
|
+
"Ref": "WindowsWorkstation<%= i.to_s %>AMI"
|
379
|
+
},
|
380
|
+
"Tags": [
|
381
|
+
{
|
382
|
+
"Key": "Name",
|
383
|
+
"Value": {
|
384
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Workstation" ] ]
|
385
|
+
}
|
386
|
+
}
|
387
|
+
]
|
388
|
+
}
|
389
|
+
},
|
390
|
+
<% end -%>
|
391
|
+
<% 1.upto(@build_nodes) do |i| -%>
|
392
|
+
"BuildNode<%= i.to_s %>": {
|
393
|
+
"Type": "AWS::EC2::Instance",
|
394
|
+
"Properties": {
|
395
|
+
"InstanceType": "m3.large",
|
396
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
397
|
+
"NetworkInterfaces": [
|
398
|
+
{
|
399
|
+
"GroupSet": [
|
400
|
+
{
|
401
|
+
"Ref": "DemoSecurityGroup"
|
402
|
+
}
|
403
|
+
],
|
404
|
+
"AssociatePublicIpAddress": "true",
|
405
|
+
"PrivateIpAddress": "172.31.54.<%= 50 + i %>",
|
406
|
+
"DeviceIndex": "0",
|
407
|
+
"DeleteOnTermination": "true",
|
408
|
+
"SubnetId": {
|
409
|
+
"Ref": "SubnetAutomate"
|
410
|
+
}
|
411
|
+
}
|
412
|
+
],
|
413
|
+
"KeyName": { "Ref": "KeyName" },
|
414
|
+
"UserData": { "Fn::Base64" : { "Fn::Join" : ["", [
|
415
|
+
"#!/bin/bash -xe\n",
|
416
|
+
"hostnamectl set-hostname build-node-<%= i.to_s %>\n"]]}
|
417
|
+
},
|
418
|
+
"ImageId": {
|
419
|
+
"Ref": "BuildNode<%= i.to_s %>AMI"
|
420
|
+
},
|
421
|
+
"Tags": [
|
422
|
+
{
|
423
|
+
"Key": "Name",
|
424
|
+
"Value": {
|
425
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Build Node <%= i.to_s %>" ] ]
|
426
|
+
}
|
427
|
+
}
|
428
|
+
]
|
429
|
+
}
|
430
|
+
},
|
431
|
+
<% end -%>
|
432
|
+
<% @infra.sort.each do |name, _ami| -%>
|
433
|
+
"<%= name %>": {
|
434
|
+
"Type": "AWS::EC2::Instance",
|
435
|
+
"Properties": {
|
436
|
+
"InstanceType": "m3.large",
|
437
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
438
|
+
"NetworkInterfaces": [
|
439
|
+
{
|
440
|
+
"GroupSet": [
|
441
|
+
{
|
442
|
+
"Ref": "DemoSecurityGroup"
|
443
|
+
}
|
444
|
+
],
|
445
|
+
"AssociatePublicIpAddress": "true",
|
446
|
+
"PrivateIpAddress": "172.31.54.<%= 101 + @infra.keys.find_index(name) %>",
|
447
|
+
"DeviceIndex": "0",
|
448
|
+
"DeleteOnTermination": "true",
|
449
|
+
"SubnetId": {
|
450
|
+
"Ref": "SubnetAutomate"
|
451
|
+
}
|
452
|
+
}
|
453
|
+
],
|
454
|
+
"KeyName": { "Ref": "KeyName" },
|
455
|
+
"UserData": { "Fn::Base64" : { "Fn::Join" : ["", [
|
456
|
+
"#!/bin/bash -xe\n",
|
457
|
+
"hostnamectl set-hostname <%= name %>\n"]]}
|
458
|
+
},
|
459
|
+
"ImageId": {
|
460
|
+
"Ref": "<%= name %>AMI"
|
461
|
+
},
|
462
|
+
"Tags": [
|
463
|
+
{
|
464
|
+
"Key": "Name",
|
465
|
+
"Value": {
|
466
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "<%= name %>" ] ]
|
467
|
+
}
|
468
|
+
}
|
469
|
+
]
|
470
|
+
}
|
471
|
+
},
|
472
|
+
<% end -%>
|
473
|
+
"Chef": {
|
474
|
+
"Type": "AWS::EC2::Instance",
|
475
|
+
"Properties": {
|
476
|
+
"InstanceType": "c3.xlarge",
|
477
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
478
|
+
"BlockDeviceMappings" : [
|
479
|
+
{
|
480
|
+
"DeviceName" : "/dev/sda1",
|
481
|
+
"Ebs" : { "VolumeSize" : "50" }
|
482
|
+
}
|
483
|
+
],
|
484
|
+
"NetworkInterfaces": [
|
485
|
+
{
|
486
|
+
"GroupSet": [
|
487
|
+
{
|
488
|
+
"Ref": "DemoSecurityGroup"
|
489
|
+
}
|
490
|
+
],
|
491
|
+
"AssociatePublicIpAddress": "true",
|
492
|
+
"PrivateIpAddress": "172.31.54.10",
|
493
|
+
"DeviceIndex": "0",
|
494
|
+
"DeleteOnTermination": "true",
|
495
|
+
"SubnetId": {
|
496
|
+
"Ref": "SubnetAutomate"
|
497
|
+
}
|
498
|
+
}
|
499
|
+
],
|
500
|
+
"KeyName": { "Ref": "KeyName" },
|
501
|
+
"UserData": { "Fn::Base64" : { "Fn::Join" : ["", [
|
502
|
+
"#!/bin/bash -xe\n",
|
503
|
+
"hostnamectl set-hostname chef\n",
|
504
|
+
"chef-server-ctl reconfigure\n"]]}
|
505
|
+
},
|
506
|
+
"ImageId": {
|
507
|
+
"Ref": "ChefServerAMI"
|
508
|
+
},
|
509
|
+
"Tags": [
|
510
|
+
{
|
511
|
+
"Key": "Name",
|
512
|
+
"Value": {
|
513
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Chef Server" ] ]
|
514
|
+
}
|
515
|
+
}
|
516
|
+
]
|
517
|
+
}
|
518
|
+
},
|
519
|
+
"Automate": {
|
520
|
+
"Type": "AWS::EC2::Instance",
|
521
|
+
"Properties": {
|
522
|
+
"InstanceType": "c3.xlarge",
|
523
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
524
|
+
"BlockDeviceMappings" : [
|
525
|
+
{
|
526
|
+
"DeviceName" : "/dev/sda1",
|
527
|
+
"Ebs" : { "VolumeSize" : "50" }
|
528
|
+
}
|
529
|
+
] ,
|
530
|
+
"NetworkInterfaces": [
|
531
|
+
{
|
532
|
+
"GroupSet": [
|
533
|
+
{
|
534
|
+
"Ref": "DemoSecurityGroup"
|
535
|
+
}
|
536
|
+
],
|
537
|
+
"AssociatePublicIpAddress": "true",
|
538
|
+
"PrivateIpAddress": "172.31.54.11",
|
539
|
+
"DeviceIndex": "0",
|
540
|
+
"DeleteOnTermination": "true",
|
541
|
+
"SubnetId": {
|
542
|
+
"Ref": "SubnetAutomate"
|
543
|
+
}
|
544
|
+
}
|
545
|
+
],
|
546
|
+
"KeyName": { "Ref": "KeyName" },
|
547
|
+
"UserData": { "Fn::Base64" : { "Fn::Join" : ["", [
|
548
|
+
"#!/bin/bash -xe\n",
|
549
|
+
"hostnamectl set-hostname automate\n",
|
550
|
+
"delivery-ctl reconfigure\n"]]}
|
551
|
+
},
|
552
|
+
"ImageId": {
|
553
|
+
"Ref": "AutomateAMI"
|
554
|
+
},
|
555
|
+
"Tags": [
|
556
|
+
{
|
557
|
+
"Key": "Name",
|
558
|
+
"Value": {
|
559
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Automate Server" ] ]
|
560
|
+
}
|
561
|
+
}
|
562
|
+
]
|
563
|
+
}
|
564
|
+
},
|
565
|
+
"Compliance": {
|
566
|
+
"Type": "AWS::EC2::Instance",
|
567
|
+
"Properties": {
|
568
|
+
"InstanceType": "c3.large",
|
569
|
+
"AvailabilityZone": { "Ref": "AvailabilityZone" },
|
570
|
+
"BlockDeviceMappings" : [
|
571
|
+
{
|
572
|
+
"DeviceName" : "/dev/sda1",
|
573
|
+
"Ebs" : { "VolumeSize" : "8" }
|
574
|
+
}
|
575
|
+
] ,
|
576
|
+
"NetworkInterfaces": [
|
577
|
+
{
|
578
|
+
"GroupSet": [
|
579
|
+
{
|
580
|
+
"Ref": "DemoSecurityGroup"
|
581
|
+
}
|
582
|
+
],
|
583
|
+
"AssociatePublicIpAddress": "true",
|
584
|
+
"PrivateIpAddress": "172.31.54.12",
|
585
|
+
"DeviceIndex": "0",
|
586
|
+
"DeleteOnTermination": "true",
|
587
|
+
"SubnetId": {
|
588
|
+
"Ref": "SubnetAutomate"
|
589
|
+
}
|
590
|
+
}
|
591
|
+
],
|
592
|
+
"KeyName": { "Ref": "KeyName" },
|
593
|
+
"UserData": { "Fn::Base64" : { "Fn::Join" : ["", [
|
594
|
+
"#!/bin/bash -xe\n",
|
595
|
+
"hostnamectl set-hostname compliance\n",
|
596
|
+
"chef-compliance-ctl reconfigure\n"]]}
|
597
|
+
},
|
598
|
+
"ImageId": {
|
599
|
+
"Ref": "ComplianceAMI"
|
600
|
+
},
|
601
|
+
"Tags": [
|
602
|
+
{
|
603
|
+
"Key": "Name",
|
604
|
+
"Value": {
|
605
|
+
"Fn::Join" : [ " ", [ { "Ref": "DemoName" }, "Compliance Server" ] ]
|
606
|
+
}
|
607
|
+
}
|
608
|
+
]
|
609
|
+
}
|
610
|
+
},
|
611
|
+
"DemoSecurityGroup": {
|
612
|
+
"Type": "AWS::EC2::SecurityGroup",
|
613
|
+
"Properties": {
|
614
|
+
"VpcId": {
|
615
|
+
"Ref": "VPC"
|
616
|
+
},
|
617
|
+
"GroupDescription": "Enable required ports for Chef Server",
|
618
|
+
"SecurityGroupIngress": [
|
619
|
+
{
|
620
|
+
"IpProtocol": "tcp",
|
621
|
+
"FromPort": "22",
|
622
|
+
"ToPort": "22",
|
623
|
+
"CidrIp": {
|
624
|
+
"Ref": "SSHLocation"
|
625
|
+
}
|
626
|
+
},
|
627
|
+
{
|
628
|
+
"IpProtocol": "tcp",
|
629
|
+
"FromPort": "0",
|
630
|
+
"ToPort": "65535",
|
631
|
+
"CidrIp": "172.31.0.0/16"
|
632
|
+
},
|
633
|
+
{
|
634
|
+
"IpProtocol": "tcp",
|
635
|
+
"FromPort": "3389",
|
636
|
+
"ToPort": "3389",
|
637
|
+
"CidrIp": "0.0.0.0/0"
|
638
|
+
},
|
639
|
+
{
|
640
|
+
"IpProtocol": "tcp",
|
641
|
+
"FromPort": "443",
|
642
|
+
"ToPort": "443",
|
643
|
+
"CidrIp": "0.0.0.0/0"
|
644
|
+
},
|
645
|
+
{
|
646
|
+
"IpProtocol": "icmp",
|
647
|
+
"FromPort": "8",
|
648
|
+
"ToPort": "-1",
|
649
|
+
"CidrIp": "0.0.0.0/0"
|
650
|
+
},
|
651
|
+
{
|
652
|
+
"IpProtocol": "udp",
|
653
|
+
"FromPort": "3389",
|
654
|
+
"ToPort": "3389",
|
655
|
+
"CidrIp": "0.0.0.0/0"
|
656
|
+
}
|
657
|
+
]
|
658
|
+
}
|
659
|
+
}
|
660
|
+
},
|
661
|
+
"Outputs":
|
662
|
+
<% workstations_hash = {} -%>
|
663
|
+
<% 1.upto(@workstations) do |i|
|
664
|
+
workstations_hash["WindowsWorkstation#{i.to_s}PubDNS"] = {
|
665
|
+
"Description" => "Public IP address of the Windows Workstation",
|
666
|
+
"Value" => {
|
667
|
+
"Fn::GetAtt" => [
|
668
|
+
"WindowsWorkstation#{i.to_s}",
|
669
|
+
"PublicIp"
|
670
|
+
]
|
671
|
+
}
|
672
|
+
}
|
673
|
+
end -%>
|
674
|
+
<%= workstations_hash.to_json %>
|
675
|
+
}
|