stack_master 0.12.0 → 0.13.0

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: 6427d9e4a3e305c6d57efd44e015b5e83a415abe
4
- data.tar.gz: e9509b938fa0646f8c35571c74278b370c4d4512
3
+ metadata.gz: decf1cea6cb689ff5f5df562e7393715a97c9a59
4
+ data.tar.gz: 6b2b11e73212a5e154f50a7350618b1e5f3a31a0
5
5
  SHA512:
6
- metadata.gz: d32fa9ae827d12afeef460c724a8db1beac7ef6b645533d621ab2bb5ecfef3e15c4b2a8eec1720a4b6f5f2b184bc1bfb532bac3b56cd0cb08c33609d0117fbad
7
- data.tar.gz: 2c7dbc03cb04804fb152b5f0040aa68b1d631d874ec3ca620698758de8f3e21b661561598fe14cdacc193d258728d9f6af419c07ab16e0f7a7bfb39b79752b27
6
+ metadata.gz: 663b7860af6120f09ebed47d50374a51b09d4b4f9f3981b7753f1876fbcefa082b62d5dc99a7ebdeee78a2b85c0f23bcb088a5619e4a69284b08a2574547d537
7
+ data.tar.gz: 65f77fc48be1584005cfc7292f07815a7f575b5b63cda9c6334572668bedfa9097f50ec5386c4aa25b642acd3e244b56a793bfc3e45ec675a1cf6a749457ed61
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1
3
4
  - 2.2
4
5
  - 2.3.1
6
+ - 2.4.0
5
7
  sudo: false
6
8
  script:
7
9
  - bundle exec rake spec features
data/README.md CHANGED
@@ -49,6 +49,7 @@ region_aliases:
49
49
  stack_defaults:
50
50
  tags:
51
51
  application: my-awesome-app
52
+ role_arn: service_role_arn
52
53
  region_defaults:
53
54
  us-east-1:
54
55
  secret_file: production.yml.gpg
@@ -19,8 +19,7 @@ module StackMaster
19
19
  :get_stack_policy,
20
20
  :describe_stack_events,
21
21
  :update_stack,
22
- :create_stack,
23
- :validate_template
22
+ :create_stack
24
23
 
25
24
  def describe_stacks(options)
26
25
  retry_with_backoff do
@@ -28,6 +27,12 @@ module StackMaster
28
27
  end
29
28
  end
30
29
 
30
+ def validate_template(options)
31
+ retry_with_backoff do
32
+ cf.validate_template(options)
33
+ end
34
+ end
35
+
31
36
  private
32
37
 
33
38
  def cf
@@ -122,6 +122,7 @@ module StackMaster
122
122
  stack_name: stack_name,
123
123
  parameters: proposed_stack.aws_parameters,
124
124
  capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
125
+ role_arn: proposed_stack.role_arn,
125
126
  notification_arns: proposed_stack.notification_arns,
126
127
  stack_policy_body: proposed_stack.stack_policy_body,
127
128
  template_method => template_value
@@ -7,6 +7,7 @@ module StackMaster
7
7
  :parameters,
8
8
  :template_body,
9
9
  :template_format,
10
+ :role_arn,
10
11
  :notification_arns,
11
12
  :outputs,
12
13
  :stack_policy_body,
@@ -52,6 +53,7 @@ module StackMaster
52
53
  template_body: template_body,
53
54
  template_format: template_format,
54
55
  outputs: outputs,
56
+ role_arn: cf_stack.role_arn,
55
57
  notification_arns: cf_stack.notification_arns,
56
58
  stack_policy_body: stack_policy_body,
57
59
  stack_status: cf_stack.stack_status)
@@ -73,6 +75,7 @@ module StackMaster
73
75
  parameters: parameters,
74
76
  template_body: template_body,
75
77
  template_format: template_format,
78
+ role_arn: stack_definition.role_arn,
76
79
  notification_arns: stack_definition.notification_arns,
77
80
  stack_policy_body: stack_policy_body)
78
81
  end
@@ -4,6 +4,7 @@ module StackMaster
4
4
  :stack_name,
5
5
  :template,
6
6
  :tags,
7
+ :role_arn,
7
8
  :notification_arns,
8
9
  :base_dir,
9
10
  :secret_file,
@@ -28,6 +29,7 @@ module StackMaster
28
29
  @stack_name == other.stack_name &&
29
30
  @template == other.template &&
30
31
  @tags == other.tags &&
32
+ @role_arn == other.role_arn &&
31
33
  @notification_arns == other.notification_arns &&
32
34
  @base_dir == other.base_dir &&
33
35
  @secret_file == other.secret_file &&
@@ -10,6 +10,7 @@ module StackMaster
10
10
  :stack_status,
11
11
  :stack_status_reason,
12
12
  :disable_rollback,
13
+ :role_arn,
13
14
  :notification_arns,
14
15
  :timeout_in_minutes,
15
16
  :capabilities,
@@ -1,3 +1,3 @@
1
1
  module StackMaster
2
- VERSION = "0.12.0"
2
+ VERSION = "0.13.0"
3
3
  end
@@ -15,6 +15,7 @@ region_defaults:
15
15
  environment: production
16
16
  notification_arns:
17
17
  - test_arn
18
+ role_arn: test_service_role_arn
18
19
  secret_file: production.yml.gpg
19
20
  stack_policy_file: my_policy.json
20
21
  staging:
@@ -23,6 +24,7 @@ region_defaults:
23
24
  test_override: 1
24
25
  notification_arns:
25
26
  - test_arn_3
27
+ role_arn: test_service_role_arn3
26
28
  secret_file: staging.yml.gpg
27
29
  stacks:
28
30
  us-east-1:
@@ -30,6 +32,7 @@ stacks:
30
32
  template: myapp_vpc.json
31
33
  notification_arns:
32
34
  - test_arn_2
35
+ role_arn: test_service_role_arn2
33
36
  myapp_web:
34
37
  template: myapp_web.rb
35
38
  myapp_vpc_with_secrets:
@@ -39,6 +42,7 @@ stacks:
39
42
  template: myapp_vpc.rb
40
43
  notification_arns:
41
44
  - test_arn_4
45
+ role_arn: test_service_role_arn4
42
46
  myapp_web:
43
47
  template: myapp_web
44
48
  tags:
@@ -4,12 +4,13 @@ RSpec.describe StackMaster::Commands::Apply do
4
4
  let(:region) { 'us-east-1' }
5
5
  let(:stack_name) { 'myapp-vpc' }
6
6
  let(:config) { double(find_stack: stack_definition) }
7
+ let(:role_arn) { 'test_service_role_arn' }
7
8
  let(:notification_arn) { 'test_arn' }
8
9
  let(:stack_definition) { StackMaster::StackDefinition.new(base_dir: '/base_dir', region: region, stack_name: stack_name) }
9
10
  let(:template_body) { '{}' }
10
11
  let(:template_format) { :json }
11
12
  let(:parameters) { { 'param_1' => 'hello' } }
12
- let(:proposed_stack) { StackMaster::Stack.new(template_body: template_body, template_format: template_format, tags: { 'environment' => 'production' } , parameters: parameters, notification_arns: [notification_arn], stack_policy_body: stack_policy_body ) }
13
+ let(:proposed_stack) { StackMaster::Stack.new(template_body: template_body, template_format: template_format, tags: { 'environment' => 'production' } , parameters: parameters, role_arn: role_arn, notification_arns: [notification_arn], stack_policy_body: stack_policy_body ) }
13
14
  let(:stack_policy_body) { '{}' }
14
15
 
15
16
  before do
@@ -47,6 +48,7 @@ RSpec.describe StackMaster::Commands::Apply do
47
48
  { parameter_key: 'param_1', parameter_value: 'hello' }
48
49
  ],
49
50
  capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
51
+ role_arn: role_arn,
50
52
  notification_arns: [notification_arn],
51
53
  stack_policy_body: stack_policy_body
52
54
  )
@@ -134,6 +136,7 @@ RSpec.describe StackMaster::Commands::Apply do
134
136
  value: 'production'
135
137
  }],
136
138
  capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
139
+ role_arn: role_arn,
137
140
  notification_arns: [notification_arn],
138
141
  stack_policy_body: stack_policy_body,
139
142
  on_failure: 'ROLLBACK'
@@ -10,6 +10,7 @@ RSpec.describe StackMaster::Config do
10
10
  tags: { 'application' => 'my-awesome-blog', 'environment' => 'production' },
11
11
  s3: { 'bucket' => 'my-bucket', 'region' => 'us-east-1' },
12
12
  notification_arns: ['test_arn', 'test_arn_2'],
13
+ role_arn: 'test_service_role_arn2',
13
14
  base_dir: base_dir,
14
15
  secret_file: 'production.yml.gpg',
15
16
  stack_policy_file: 'my_policy.json',
@@ -87,12 +88,14 @@ RSpec.describe StackMaster::Config do
87
88
  expect(loaded_config.region_defaults).to eq({
88
89
  'us-east-1' => {
89
90
  'tags' => { 'environment' => 'production' },
91
+ 'role_arn' => 'test_service_role_arn',
90
92
  'notification_arns' => ['test_arn'],
91
93
  'secret_file' => 'production.yml.gpg',
92
94
  'stack_policy_file' => 'my_policy.json'
93
95
  },
94
96
  'ap-southeast-2' => {
95
97
  'tags' => {'environment' => 'staging', 'test_override' => 1 },
98
+ 'role_arn' => 'test_service_role_arn3',
96
99
  'notification_arns' => ['test_arn_3'],
97
100
  'secret_file' => 'staging.yml.gpg'
98
101
  }
@@ -117,6 +120,7 @@ RSpec.describe StackMaster::Config do
117
120
  'test_override' => 1
118
121
  },
119
122
  s3: { 'bucket' => 'my-bucket', 'region' => 'us-east-1' },
123
+ role_arn: 'test_service_role_arn4',
120
124
  notification_arns: ['test_arn_3', 'test_arn_4'],
121
125
  template: 'myapp_vpc.rb',
122
126
  base_dir: base_dir,
@@ -133,6 +137,7 @@ RSpec.describe StackMaster::Config do
133
137
  'test_override' => 2
134
138
  },
135
139
  s3: { 'bucket' => 'my-bucket', 'region' => 'us-east-1' },
140
+ role_arn: 'test_service_role_arn3',
136
141
  notification_arns: ['test_arn_3'],
137
142
  template: 'myapp_web',
138
143
  base_dir: base_dir,
@@ -19,7 +19,7 @@ RSpec.describe StackMaster::Stack do
19
19
  ]
20
20
  }
21
21
  before do
22
- cf.stub_responses(:describe_stacks, stacks: [{ stack_id: stack_id, stack_name: stack_name, creation_time: Time.now, stack_status: 'UPDATE_COMPLETE', parameters: parameters, notification_arns: ['test_arn']}])
22
+ cf.stub_responses(:describe_stacks, stacks: [{ stack_id: stack_id, stack_name: stack_name, creation_time: Time.now, stack_status: 'UPDATE_COMPLETE', parameters: parameters, notification_arns: ['test_arn'], role_arn: 'test_service_role_arn'}])
23
23
  cf.stub_responses(:get_template, template_body: "{}")
24
24
  cf.stub_responses(:get_stack_policy, stack_policy_body: stack_policy_body)
25
25
  end
@@ -36,6 +36,10 @@ RSpec.describe StackMaster::Stack do
36
36
  expect(stack.parameters).to eq({'param1' => 'value1', 'param2' => 'value2'})
37
37
  end
38
38
 
39
+ it 'sets role_arn' do
40
+ expect(stack.role_arn).to eq('test_service_role_arn')
41
+ end
42
+
39
43
  it 'sets notification_arns' do
40
44
  expect(stack.notification_arns).to eq(['test_arn'])
41
45
  end
@@ -70,7 +74,7 @@ RSpec.describe StackMaster::Stack do
70
74
 
71
75
  describe '.generate' do
72
76
  let(:tags) { { 'tag1' => 'value1' } }
73
- let(:stack_definition) { StackMaster::StackDefinition.new(region: region, stack_name: stack_name, tags: tags, base_dir: '/base_dir', template: template_file_name, notification_arns: ['test_arn'], stack_policy_file: 'no_replace_rds.json') }
77
+ let(:stack_definition) { StackMaster::StackDefinition.new(region: region, stack_name: stack_name, tags: tags, base_dir: '/base_dir', template: template_file_name, notification_arns: ['test_arn'], role_arn: 'test_service_role_arn', stack_policy_file: 'no_replace_rds.json') }
74
78
  let(:config) { StackMaster::Config.new({'stacks' => {}}, '/base_dir') }
75
79
  subject(:stack) { StackMaster::Stack.generate(stack_definition, config) }
76
80
  let(:parameter_hash) { { 'DbPassword' => { 'secret' => 'db_password' } } }
@@ -107,6 +111,10 @@ RSpec.describe StackMaster::Stack do
107
111
  expect(stack.template_body).to eq template_body
108
112
  end
109
113
 
114
+ it 'has role_arn' do
115
+ expect(stack.role_arn).to eq 'test_service_role_arn'
116
+ end
117
+
110
118
  it 'has notification_arns' do
111
119
  expect(stack.notification_arns).to eq ['test_arn']
112
120
  end
data/stack_master.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
+ spec.required_ruby_version = ">= 2.1.0"
20
21
 
21
22
  spec.add_development_dependency "bundler", "~> 1.5"
22
23
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodgkiss
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-07 00:00:00.000000000 Z
12
+ date: 2017-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -442,7 +442,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
442
442
  requirements:
443
443
  - - ">="
444
444
  - !ruby/object:Gem::Version
445
- version: '0'
445
+ version: 2.1.0
446
446
  required_rubygems_version: !ruby/object:Gem::Requirement
447
447
  requirements:
448
448
  - - ">="
@@ -450,7 +450,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
450
450
  version: '0'
451
451
  requirements: []
452
452
  rubyforge_project:
453
- rubygems_version: 2.5.1
453
+ rubygems_version: 2.6.8
454
454
  signing_key:
455
455
  specification_version: 4
456
456
  summary: StackMaster is a sure-footed way of creating, updating and keeping track