gantree 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 890bed9626d0352db659957aace15b0a9ea3f8bf
4
- data.tar.gz: 6b972f89c7ddaf288d0ca33b69d70973cde45a27
3
+ metadata.gz: 38b556ec92f83ad61517d9e30778ee06c6a8b3c2
4
+ data.tar.gz: 25ad1a639842604005fd550b7a38c9d491f18534
5
5
  SHA512:
6
- metadata.gz: 3ed0c4b291bbc0b76b2a5b9bac17a5b816640c68cac7139ea2217705fc6c4bac044f100db35385cb91341eb0e252158f3822168643b831e1f420d341781323d1
7
- data.tar.gz: 55595e357a63d12e515048fde094a2089ff2d96bcb820d8256c0fc92cf3d35f5bf7ecac7f17fe303ecede792dfe6682d365acff2648c9438a7382f2ce1ffe487
6
+ metadata.gz: d2d8b7cc209df5ee1c97f3f4cf354922acf0fcabffb85911095211853eb950f5117ea53a0a2ebd05f3ff06f932e775858aa605e2be4ada505afd3995302eb425
7
+ data.tar.gz: daf36190d1034eea57ada9817dd4df28aa65ec590f8722b6a1d0e4708aec06a8fcb88131b9a9efa903a2117db9b595e4b8dfc52ab0d0ff601af4475cc02b67d2
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ cfn/*
data/Gemfile CHANGED
@@ -7,5 +7,4 @@ gem "guard", group: :test
7
7
  gem "rspec", group: :test
8
8
  gem "rake"
9
9
  gem "guard-rspec", require: false
10
- gem "webmock"
11
- gem "cloudformation-ruby-dsl"
10
+ gem "webmock"
@@ -9,14 +9,11 @@ GEM
9
9
  nokogiri (>= 1.4.4)
10
10
  celluloid (0.15.2)
11
11
  timers (~> 1.1.0)
12
- cloudformation-ruby-dsl (0.4.6)
13
- detabulator
14
12
  codeclimate-test-reporter (0.4.0)
15
13
  simplecov (>= 0.7.1, < 1.0.0)
16
14
  coderay (1.1.0)
17
15
  crack (0.4.2)
18
16
  safe_yaml (~> 1.0.0)
19
- detabulator (0.1.0)
20
17
  diff-lcs (1.2.5)
21
18
  docile (1.1.5)
22
19
  ffi (1.9.3)
@@ -79,7 +76,6 @@ PLATFORMS
79
76
 
80
77
  DEPENDENCIES
81
78
  aws-sdk
82
- cloudformation-ruby-dsl
83
79
  codeclimate-test-reporter
84
80
  guard
85
81
  guard-rspec
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "aws-sdk"
23
23
  spec.add_dependency "hashie"
24
24
  spec.add_dependency "colorize"
25
+ spec.add_dependency "rubyzip"
26
+ spec.add_dependency "cloudformation-ruby-dsl"
25
27
 
26
28
  spec.add_development_dependency "bundler", "~> 1.3"
27
29
  spec.add_development_dependency "rake"
@@ -10,6 +10,7 @@ module Gantree
10
10
  :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
11
11
  :secret_access_key => ENV['AWS_SECRET_ACCES_KEY'])
12
12
  @s3 = AWS::S3.new
13
+ @cfm = AWS::CloudFormation.new
13
14
  @requirements = "#!/usr/bin/env ruby
14
15
  require 'bundler/setup'
15
16
  require 'cloudformation-ruby-dsl/cfntemplate'
@@ -21,7 +22,9 @@ module Gantree
21
22
  stack_name: @stack_name,
22
23
  requirements: @requirements,
23
24
  cfn_bucket: "br-templates",
24
- env: @env
25
+ env: @env,
26
+ stag_domain: "sbleacherreport.com",
27
+ prod_domain: "bleacherreport.com"
25
28
  }
26
29
  end
27
30
 
@@ -29,13 +32,14 @@ module Gantree
29
32
  generate("master", MasterTemplate.new(@params).create)
30
33
  generate("beanstalk", BeanstalkTemplate.new(@params).create)
31
34
  generate("resources", ResourcesTemplate.new(@params).create)
35
+ create_aws_cfn_stack
32
36
  end
33
37
 
34
38
  def generate(template_name, template)
35
39
  IO.write("cfn/#{template_name}.rb", template)
36
40
  json = `ruby cfn/#{template_name}.rb expand`
37
41
  Dir.mkdir 'cfn' rescue Errno::ENOENT
38
- template_file_name = "#{@params[:env]}-#{template_name}.cfn.json"
42
+ template_file_name = "#{@env}-#{template_name}.cfn.json"
39
43
  IO.write("cfn/#{template_file_name}", json)
40
44
  puts "Created #{template_file_name} in the cfn directory"
41
45
  FileUtils.rm("cfn/#{template_name}.rb")
@@ -58,8 +62,8 @@ module Gantree
58
62
 
59
63
  def create_aws_cfn_stack
60
64
  puts "Creating stack on aws..."
61
- cfm = AWS::CloudFormation.new
62
- stack = cfm.stacks.create(stack_name, template)
65
+ template = AWS::S3.new.buckets["#{@params[:cfn_bucket]}/#{@env}"].objects["#{@env}-master.cfn.json"]
66
+ stack = @cfm.stacks.create(@params[:stack_name], template,{ :disable_rollback => true })
63
67
  end
64
68
 
65
69
  end
@@ -3,6 +3,8 @@ class BeanstalkTemplate
3
3
  def initialize params
4
4
  @stack_name = params[:stack_name]
5
5
  @env = params[:env]
6
+ @prod_domain = params[:prod_domain]
7
+ @stag_domain = params[:stag_domain]
6
8
  @requirements = params[:requirements]
7
9
  end
8
10
 
@@ -19,8 +21,8 @@ class BeanstalkTemplate
19
21
  :prod => { :name => 'production' }
20
22
 
21
23
  mapping 'HostedZoneName',
22
- :stag => { :name => 'sbleacherreport.com' },
23
- :prod => { :name => 'bleacherreport.com' }
24
+ :stag => { :name => '#{@stag_domain}' },
25
+ :prod => { :name => '#{@prod_domain}' }
24
26
 
25
27
  parameter 'KeyName',
26
28
  :Description => 'The Key Pair to launch instances with',
@@ -39,26 +41,27 @@ class BeanstalkTemplate
39
41
  parameter 'ApplicationName',
40
42
  :Description => 'The name of the Elastic Beanstalk Application',
41
43
  :Type => 'String',
42
- :Default => ref('ApplicationName')
44
+ :Default => '#{@env}'
43
45
 
44
46
  parameter 'Environment',
45
- :Type => 'String'
47
+ :Type => 'String',
48
+ :Default => 'stag'
46
49
 
47
50
  parameter 'IamInstanceProfile',
48
51
  :Type => 'String',
49
52
  :Default => 'EbApp'
50
53
 
51
54
  resource 'Application', :Type => 'AWS::ElasticBeanstalk::Application', :Properties => {
52
- :Description => ref('ApplicationName'),
53
- :ApplicationName => join('-', ref('ApplicationName'), ref('Environment')),
55
+ :Description => '#{@env}',
56
+ :ApplicationName => '#{@env}',
54
57
  }
55
58
 
56
59
  resource 'ApplicationVersion', :Type => 'AWS::ElasticBeanstalk::ApplicationVersion', :Properties => {
57
60
  :ApplicationName => ref('Application'),
58
61
  :Description => 'Initial Version',
59
62
  :SourceBundle => {
60
- :S3Bucket => join('/','br-repos',ref('Environment')),
61
- :S3Key => join('',ref('Environment'), '-Dockerrun.aws.json'),
63
+ :S3Bucket => 'elasticbeanstalk-samples-us-east-1',
64
+ :S3Key => 'docker-sample.zip',
62
65
  },
63
66
  }
64
67
 
@@ -75,7 +78,7 @@ class BeanstalkTemplate
75
78
  {
76
79
  :Namespace => 'aws:elasticbeanstalk:application:environment',
77
80
  :OptionName => 'RACK_ENV',
78
- :Value => find_in_map('LongName', ref('Environment'), 'name'),
81
+ :Value => find_in_map('LongName', '#{env_type}', 'name'),
79
82
  },
80
83
  {
81
84
  :Namespace => 'aws:autoscaling:launchconfiguration',
@@ -95,7 +98,7 @@ class BeanstalkTemplate
95
98
  {
96
99
  :Namespace => 'aws:autoscaling:launchconfiguration',
97
100
  :OptionName => 'SecurityGroups',
98
- :Value => join(',', join('-', ref('Environment'), 'br'), ref('InstanceSecurityGroup')),
101
+ :Value => join(',', join('-', '#{env_type}', 'br'), ref('InstanceSecurityGroup')),
99
102
  },
100
103
  { :Namespace => 'aws:autoscaling:updatepolicy:rollingupdate', :OptionName => 'RollingUpdateEnabled', :Value => 'true' },
101
104
  { :Namespace => 'aws:autoscaling:updatepolicy:rollingupdate', :OptionName => 'MaxBatchSize', :Value => '1' },
@@ -105,8 +108,8 @@ class BeanstalkTemplate
105
108
  }
106
109
 
107
110
  resource 'EbEnvironment', :Type => 'AWS::ElasticBeanstalk::Environment', :Properties => {
108
- :ApplicationName => ref('Application'),
109
- :EnvironmentName => join('-', ref('Environment'), ref('ApplicationName'), 'app'),
111
+ :ApplicationName => '#{@env}',
112
+ :EnvironmentName => '#{@stack_name}',
110
113
  :Description => 'Default Environment',
111
114
  :VersionLabel => ref('ApplicationVersion'),
112
115
  :TemplateName => ref('ConfigurationTemplate'),
@@ -115,8 +118,8 @@ class BeanstalkTemplate
115
118
 
116
119
  resource 'HostRecord', :Type => 'AWS::Route53::RecordSet', :Properties => {
117
120
  :Comment => 'DNS name for my stack',
118
- :HostedZoneName => join('', find_in_map('HostedZoneName', ref('Environment'), 'name'), '.'),
119
- :Name => join('.', ref('ApplicationName'), find_in_map('HostedZoneName', ref('Environment'), 'name')),
121
+ :HostedZoneName => join('', find_in_map('HostedZoneName', '#{env_type}', 'name'), '.'),
122
+ :Name => join('.', ref('ApplicationName'), find_in_map('HostedZoneName', '#{env_type}', 'name')),
120
123
  :ResourceRecords => [ get_att('EbEnvironment', 'EndpointURL') ],
121
124
  :TTL => '60',
122
125
  :Type => 'CNAME',
@@ -129,4 +132,15 @@ class BeanstalkTemplate
129
132
  end.exec!
130
133
  "
131
134
  end
135
+
136
+ def env_type
137
+ if @env.include?("prod")
138
+ "prod"
139
+ elsif @env.include?("stag")
140
+ "stag"
141
+ else
142
+ ""
143
+ end
144
+ end
145
+
132
146
  end
@@ -3,6 +3,7 @@ class MasterTemplate
3
3
  def initialize params
4
4
  @stack_name = params[:stack_name]
5
5
  @env = params[:env]
6
+ @bucket = params[:cfn_bucket]
6
7
  @requirements = params[:requirements]
7
8
  end
8
9
 
@@ -20,9 +21,10 @@ class MasterTemplate
20
21
  parameter 'AppTemplate',
21
22
  :Description => 'The key of the template for the EB app/env substack',
22
23
  :Type => 'String',
23
- :Default => '#{@env}-elasticbeanstalk.cfn.json'
24
+ :Default => '#{@env}-beanstalk.cfn.json'
24
25
 
25
26
  parameter 'KeyName',
27
+ :Type => 'String',
26
28
  :Default => 'default'
27
29
 
28
30
  parameter 'InstanceType',
@@ -31,23 +33,23 @@ class MasterTemplate
31
33
 
32
34
  parameter 'ApplicationName',
33
35
  :Type => 'String',
34
- :Default => '#{@stack_name}'
36
+ :Default => '#{@env}'
35
37
 
36
38
  parameter 'Environment',
37
39
  :Type => 'String',
38
- :Default => '#{@env}'
40
+ :Default => '#{env_type}'
39
41
 
40
42
  parameter 'IamInstanceProfile',
41
43
  :Type => 'String',
42
44
  :Default => 'EbApp'
43
45
 
44
46
  resource 'AppResources', :Type => 'AWS::CloudFormation::Stack', :Properties => {
45
- :TemplateURL => join('/', 'http://s3.amazonaws.com/br-templates', ref('ApplicationName'), ref('ResourcesTemplate')),
47
+ :TemplateURL => join('/', 'http://s3.amazonaws.com', '#{@bucket}', '#{@env}', ref('ResourcesTemplate')),
46
48
  :Parameters => { :ApplicationName => ref('ApplicationName') },
47
49
  }
48
50
 
49
51
  resource 'App', :Type => 'AWS::CloudFormation::Stack', :Properties => {
50
- :TemplateURL => join('/', 'http://s3.amazonaws.com/#{@cfn_bucket}', ref('ApplicationName'), ref('AppTemplate')),
52
+ :TemplateURL => join('/', 'http://s3.amazonaws.com','#{@bucket}', '#{@env}', ref('AppTemplate')),
51
53
  :Parameters => {
52
54
  :KeyName => ref('KeyName'),
53
55
  :InstanceSecurityGroup => get_att('AppResources', 'Outputs.InstanceSecurityGroup'),
@@ -64,4 +66,14 @@ class MasterTemplate
64
66
 
65
67
  end.exec!"
66
68
  end
69
+
70
+ def env_type
71
+ if @env.include?("prod")
72
+ "prod"
73
+ elsif @env.include?("stag")
74
+ "stag"
75
+ else
76
+ ""
77
+ end
78
+ end
67
79
  end
@@ -16,11 +16,10 @@ class ResourcesTemplate
16
16
 
17
17
  parameter 'ApplicationName',
18
18
  :Type => 'String',
19
- :Default => ref('ApplicationName')
19
+ :Default => '#{@env}'
20
20
 
21
21
  resource 'InstanceSecurityGroup', :Type => 'AWS::EC2::SecurityGroup', :Properties => {
22
- :GroupDescription => join('', 'an EC2 instance security group created for ', ref('ApplicationName')),
23
- :SecurityGroupIngress => [],
22
+ :GroupDescription => join('', 'an EC2 instance security group created for #{@env}')
24
23
  }
25
24
 
26
25
  output 'InstanceSecurityGroup',
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gantree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubyzip
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: cloudformation-ruby-dsl
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: bundler
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -153,9 +181,9 @@ files:
153
181
  - README.md
154
182
  - Rakefile
155
183
  - bin/gantree
156
- - cfn/knarr-stag-s3-beanstalk.cfn.json
157
- - cfn/knarr-stag-s3-master.cfn.json
158
- - cfn/knarr-stag-s3-resources.cfn.json
184
+ - cfn/knarr-prod-s5-beanstalk.cfn.json
185
+ - cfn/knarr-prod-s5-master.cfn.json
186
+ - cfn/knarr-prod-s5-resources.cfn.json
159
187
  - gantree.gemspec
160
188
  - lib/gantree.rb
161
189
  - lib/gantree/cfn.rb
@@ -1,311 +0,0 @@
1
- {
2
- "AWSTemplateFormatVersion": "2010-09-09",
3
- "Description": "Knarr Service Parent Template (2014-08-15)",
4
- "Mappings": {
5
- "LongName": {
6
- "stag": {
7
- "name": "staging"
8
- },
9
- "prod": {
10
- "name": "production"
11
- }
12
- },
13
- "HostedZoneName": {
14
- "stag": {
15
- "name": "sbleacherreport.com"
16
- },
17
- "prod": {
18
- "name": "bleacherreport.com"
19
- }
20
- }
21
- },
22
- "Parameters": {
23
- "KeyName": {
24
- "Description": "The Key Pair to launch instances with",
25
- "Type": "String",
26
- "Default": "default"
27
- },
28
- "InstanceSecurityGroup": {
29
- "Type": "String"
30
- },
31
- "InstanceType": {
32
- "Description": "EC2 Instance Type",
33
- "Type": "String",
34
- "AllowedValues": [
35
- "t1.micro",
36
- "m1.small",
37
- "m3.medium",
38
- "m3.large",
39
- "m3.xlarge",
40
- "m3.2xlarge",
41
- "c3.large",
42
- "c3.xlarge",
43
- "c3.2xlarge",
44
- "c3.4xlarge",
45
- "c3.8xlarge"
46
- ],
47
- "Default": "m3.large"
48
- },
49
- "ApplicationName": {
50
- "Description": "The name of the Elastic Beanstalk Application",
51
- "Type": "String",
52
- "Default": "knarr"
53
- },
54
- "Environment": {
55
- "Type": "String"
56
- },
57
- "IamInstanceProfile": {
58
- "Type": "String",
59
- "Default": "EbApp"
60
- }
61
- },
62
- "Resources": {
63
- "Application": {
64
- "Type": "AWS::ElasticBeanstalk::Application",
65
- "Properties": {
66
- "Description": {
67
- "Ref": "ApplicationName"
68
- },
69
- "ApplicationName": {
70
- "Fn::Join": [
71
- "-",
72
- [
73
- {
74
- "Ref": "ApplicationName"
75
- },
76
- {
77
- "Ref": "Environment"
78
- }
79
- ]
80
- ]
81
- }
82
- }
83
- },
84
- "ApplicationVersion": {
85
- "Type": "AWS::ElasticBeanstalk::ApplicationVersion",
86
- "Properties": {
87
- "ApplicationName": {
88
- "Ref": "Application"
89
- },
90
- "Description": "Initial Version",
91
- "SourceBundle": {
92
- "S3Bucket": "br-repos",
93
- "S3Key": {
94
- "Fn::Join": [
95
- "",
96
- [
97
- {
98
- "Ref": "ApplicationName"
99
- },
100
- "-",
101
- {
102
- "Ref": "Environment"
103
- },
104
- ".zip"
105
- ]
106
- ]
107
- }
108
- }
109
- }
110
- },
111
- "ConfigurationTemplate": {
112
- "Type": "AWS::ElasticBeanstalk::ConfigurationTemplate",
113
- "Properties": {
114
- "ApplicationName": {
115
- "Ref": "Application"
116
- },
117
- "SolutionStackName": "64bit Amazon Linux 2014.03 v1.0.1 running Docker 1.0.0",
118
- "Description": "Default Configuration Version 1.0 - with SSH access",
119
- "OptionSettings": [
120
- {
121
- "Namespace": "aws:elasticbeanstalk:application:environment",
122
- "OptionName": "AWS_REGION",
123
- "Value": "us-east-1"
124
- },
125
- {
126
- "Namespace": "aws:elasticbeanstalk:application:environment",
127
- "OptionName": "RACK_ENV",
128
- "Value": {
129
- "Fn::FindInMap": [
130
- "LongName",
131
- {
132
- "Ref": "Environment"
133
- },
134
- "name"
135
- ]
136
- }
137
- },
138
- {
139
- "Namespace": "aws:autoscaling:launchconfiguration",
140
- "OptionName": "EC2KeyName",
141
- "Value": {
142
- "Ref": "KeyName"
143
- }
144
- },
145
- {
146
- "Namespace": "aws:autoscaling:launchconfiguration",
147
- "OptionName": "IamInstanceProfile",
148
- "Value": {
149
- "Ref": "IamInstanceProfile"
150
- }
151
- },
152
- {
153
- "Namespace": "aws:autoscaling:launchconfiguration",
154
- "OptionName": "InstanceType",
155
- "Value": {
156
- "Ref": "InstanceType"
157
- }
158
- },
159
- {
160
- "Namespace": "aws:autoscaling:launchconfiguration",
161
- "OptionName": "SecurityGroups",
162
- "Value": {
163
- "Fn::Join": [
164
- ",",
165
- [
166
- {
167
- "Fn::Join": [
168
- "-",
169
- [
170
- {
171
- "Ref": "Environment"
172
- },
173
- "br"
174
- ]
175
- ]
176
- },
177
- {
178
- "Ref": "InstanceSecurityGroup"
179
- }
180
- ]
181
- ]
182
- }
183
- },
184
- {
185
- "Namespace": "aws:autoscaling:updatepolicy:rollingupdate",
186
- "OptionName": "RollingUpdateEnabled",
187
- "Value": "true"
188
- },
189
- {
190
- "Namespace": "aws:autoscaling:updatepolicy:rollingupdate",
191
- "OptionName": "MaxBatchSize",
192
- "Value": "1"
193
- },
194
- {
195
- "Namespace": "aws:autoscaling:updatepolicy:rollingupdate",
196
- "OptionName": "MinInstancesInService",
197
- "Value": "2"
198
- },
199
- {
200
- "Namespace": "aws:elasticbeanstalk:hostmanager",
201
- "OptionName": "LogPublicationControl",
202
- "Value": "true"
203
- }
204
- ]
205
- }
206
- },
207
- "EbEnvironment": {
208
- "Type": "AWS::ElasticBeanstalk::Environment",
209
- "Properties": {
210
- "ApplicationName": {
211
- "Ref": "Application"
212
- },
213
- "EnvironmentName": {
214
- "Fn::Join": [
215
- "-",
216
- [
217
- {
218
- "Ref": "Environment"
219
- },
220
- {
221
- "Ref": "ApplicationName"
222
- },
223
- "app"
224
- ]
225
- ]
226
- },
227
- "Description": "Default Environment",
228
- "VersionLabel": {
229
- "Ref": "ApplicationVersion"
230
- },
231
- "TemplateName": {
232
- "Ref": "ConfigurationTemplate"
233
- },
234
- "OptionSettings": [
235
-
236
- ]
237
- }
238
- },
239
- "HostRecord": {
240
- "Type": "AWS::Route53::RecordSet",
241
- "Properties": {
242
- "Comment": "DNS name for my stack",
243
- "HostedZoneName": {
244
- "Fn::Join": [
245
- "",
246
- [
247
- {
248
- "Fn::FindInMap": [
249
- "HostedZoneName",
250
- {
251
- "Ref": "Environment"
252
- },
253
- "name"
254
- ]
255
- },
256
- "."
257
- ]
258
- ]
259
- },
260
- "Name": {
261
- "Fn::Join": [
262
- ".",
263
- [
264
- {
265
- "Ref": "ApplicationName"
266
- },
267
- {
268
- "Fn::FindInMap": [
269
- "HostedZoneName",
270
- {
271
- "Ref": "Environment"
272
- },
273
- "name"
274
- ]
275
- }
276
- ]
277
- ]
278
- },
279
- "ResourceRecords": [
280
- {
281
- "Fn::GetAtt": [
282
- "EbEnvironment",
283
- "EndpointURL"
284
- ]
285
- }
286
- ],
287
- "TTL": "60",
288
- "Type": "CNAME"
289
- }
290
- }
291
- },
292
- "Outputs": {
293
- "URL": {
294
- "Description": "URL of the AWS Elastic Beanstalk Environment",
295
- "Value": {
296
- "Fn::Join": [
297
- "",
298
- [
299
- "http://",
300
- {
301
- "Fn::GetAtt": [
302
- "EbEnvironment",
303
- "EndpointURL"
304
- ]
305
- }
306
- ]
307
- ]
308
- }
309
- }
310
- }
311
- }
@@ -1,113 +0,0 @@
1
- {
2
- "AWSTemplateFormatVersion": "2010-09-09",
3
- "Description": "stag-knarr-app-s3 Master Template",
4
- "Parameters": {
5
- "ResourcesTemplate": {
6
- "Description": "The key of the template for the resources required to run the app",
7
- "Type": "String",
8
- "Default": "stag-knarr-app-s3-resources.cfn.json"
9
- },
10
- "AppTemplate": {
11
- "Description": "The key of the template for the EB app/env substack",
12
- "Type": "String",
13
- "Default": "stag-knarr-app-s3-elasticbeanstalk.cfn.json"
14
- },
15
- "KeyName": {
16
- "Default": "default"
17
- },
18
- "InstanceType": {
19
- "Type": "String",
20
- "Default": "t1.micro"
21
- },
22
- "ApplicationName": {
23
- "Type": "String"
24
- },
25
- "Environment": {
26
- "Type": "String",
27
- "Default": "knarr-stag-s3"
28
- },
29
- "IamInstanceProfile": {
30
- "Type": "String",
31
- "Default": "EbApp"
32
- }
33
- },
34
- "Resources": {
35
- "AppResources": {
36
- "Type": "AWS::CloudFormation::Stack",
37
- "Properties": {
38
- "TemplateURL": {
39
- "Fn::Join": [
40
- "/",
41
- [
42
- "http://s3.amazonaws.com/br-templates",
43
- {
44
- "Ref": "ApplicationName"
45
- },
46
- {
47
- "Ref": "ResourcesTemplate"
48
- }
49
- ]
50
- ]
51
- },
52
- "Parameters": {
53
- "ApplicationName": {
54
- "Ref": "ApplicationName"
55
- }
56
- }
57
- }
58
- },
59
- "App": {
60
- "Type": "AWS::CloudFormation::Stack",
61
- "Properties": {
62
- "TemplateURL": {
63
- "Fn::Join": [
64
- "/",
65
- [
66
- "http://s3.amazonaws.com/",
67
- {
68
- "Ref": "ApplicationName"
69
- },
70
- {
71
- "Ref": "AppTemplate"
72
- }
73
- ]
74
- ]
75
- },
76
- "Parameters": {
77
- "KeyName": {
78
- "Ref": "KeyName"
79
- },
80
- "InstanceSecurityGroup": {
81
- "Fn::GetAtt": [
82
- "AppResources",
83
- "Outputs.InstanceSecurityGroup"
84
- ]
85
- },
86
- "InstanceType": {
87
- "Ref": "InstanceType"
88
- },
89
- "ApplicationName": {
90
- "Ref": "ApplicationName"
91
- },
92
- "Environment": {
93
- "Ref": "Environment"
94
- },
95
- "IamInstanceProfile": {
96
- "Ref": "IamInstanceProfile"
97
- }
98
- }
99
- }
100
- }
101
- },
102
- "Outputs": {
103
- "URL": {
104
- "Description": "URL of the AWS Elastic Beanstalk Environment",
105
- "Value": {
106
- "Fn::GetAtt": [
107
- "App",
108
- "Outputs.URL"
109
- ]
110
- }
111
- }
112
- }
113
- }
@@ -1,40 +0,0 @@
1
- {
2
- "AWSTemplateFormatVersion": "2010-09-09",
3
- "Description": "knarr-stag-s3 Services Resources (2014-06-30)",
4
- "Parameters": {
5
- "ApplicationName": {
6
- "Type": "String",
7
- "Default": {
8
- "Ref": "ApplicationName"
9
- }
10
- }
11
- },
12
- "Resources": {
13
- "InstanceSecurityGroup": {
14
- "Type": "AWS::EC2::SecurityGroup",
15
- "Properties": {
16
- "GroupDescription": {
17
- "Fn::Join": [
18
- "",
19
- [
20
- "an EC2 instance security group created for ",
21
- {
22
- "Ref": "ApplicationName"
23
- }
24
- ]
25
- ]
26
- },
27
- "SecurityGroupIngress": [
28
-
29
- ]
30
- }
31
- }
32
- },
33
- "Outputs": {
34
- "InstanceSecurityGroup": {
35
- "Value": {
36
- "Ref": "InstanceSecurityGroup"
37
- }
38
- }
39
- }
40
- }