stack_master 1.13.0 → 1.13.1

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
  SHA256:
3
- metadata.gz: 9a87f4e8bba6538fbfa5b96a5a174041337a99926caff31a24c43f7c096f5d7e
4
- data.tar.gz: fd350bfe4fd773aafe28a2a17b77b44699142d0c1f9616e284550a9b06f3ca77
3
+ metadata.gz: 3c61a62b352e2b92b35889b4adbf9f723c65b815cbb04c81f9716cc10000d220
4
+ data.tar.gz: 02f8827f12a3f1321c4f51984a23f23e66d1ad5c82e28612c56e64b8c7553cbc
5
5
  SHA512:
6
- metadata.gz: 78045df223e775f46f30c6068479213382532f57538583b478e4ec78ab88413f069cafc352e677fe4235a5dc28b538092a246c2624ac05097af59f2d05afe5b5
7
- data.tar.gz: e3d1115bfd423da6acc76b20e71659bd9d0d92787f1b93ff6c125bb73d138ead9f08f45e62d86f11c5201f9db19ea4bf4c626c4da35ed1c785025b9ef40f8c7c
6
+ metadata.gz: c0990e86ffb2dd1d8c745a74b2e39c24adfb430fc7678f647ab88bdd6153bbf45a9aa0bd744f00c3a527165bee5ce6b5f6980c161403f86950e0737ab52f4dd9
7
+ data.tar.gz: d0941fc85e852593683bfd976cbc5e872c260ab9e5f297938dbacfb16ec1c73b7c56e52eebb4e7b4f897c423383961fa6b4768b7361bb2e6ff1dded2a4d2dc0e
@@ -0,0 +1,22 @@
1
+ module StackMaster
2
+ module AwsDriver
3
+ class STS
4
+ def set_region(region)
5
+ @region = region
6
+ end
7
+
8
+ def get_account_id
9
+ sts = new_sts_client
10
+ # This should always work as you cannot allow/deny access to this API
11
+ identity = sts.get_caller_identity
12
+ return identity['account']
13
+ end
14
+
15
+ private
16
+
17
+ def new_sts_client
18
+ Aws::STS::Client.new(region: @region)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -211,7 +211,7 @@ module StackMaster
211
211
  end
212
212
 
213
213
  def execute_stacks_command(command, args, options)
214
- command_results = []
214
+ success = true
215
215
  config = load_config(options.config)
216
216
  args = [nil, nil] if args.size == 0
217
217
  args.each_slice(2) do |aliased_region, stack_name|
@@ -220,7 +220,7 @@ module StackMaster
220
220
  stack_definitions = config.filter(region, stack_name)
221
221
  if stack_definitions.empty?
222
222
  StackMaster.stdout.puts "Could not find stack definition #{stack_name} in region #{region}"
223
- command_results.push false
223
+ success = false
224
224
  end
225
225
  stack_definitions = stack_definitions.select do |stack_definition|
226
226
  StackStatus.new(config, stack_definition).changed?
@@ -228,12 +228,10 @@ module StackMaster
228
228
  stack_definitions.each do |stack_definition|
229
229
  StackMaster.cloud_formation_driver.set_region(stack_definition.region)
230
230
  StackMaster.stdout.puts "Executing #{command.command_name} on #{stack_definition.stack_name} in #{stack_definition.region}"
231
- command_results.push command.perform(config, stack_definition, options).success?
231
+ success = false unless command.perform(config, stack_definition, options).success?
232
232
  end
233
233
  end
234
-
235
- # fail command execution if something went wrong
236
- @kernel.exit 1 unless command_results.all?
234
+ success
237
235
  end
238
236
  end
239
237
  end
@@ -0,0 +1,13 @@
1
+ module StackMaster
2
+ class TargetDefinition
3
+ attr_reader :region,
4
+ :account_id,
5
+ :stack_definition
6
+
7
+ def initialize(region:, account_id:, stack_definition:)
8
+ @region = region
9
+ @account_id = account_id
10
+ @stack_definition = stack_definition
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ module StackMaster
2
+ module TestDriver
3
+ class STS
4
+ attr_accessor :account_id
5
+ def initialize
6
+ reset
7
+ end
8
+
9
+ def reset
10
+ @account_id = "12345678910"
11
+ end
12
+
13
+ def set_region(region)
14
+ @region = region
15
+ end
16
+
17
+ def get_account_id
18
+ @account_id
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module StackMaster
2
- VERSION = "1.13.0"
2
+ VERSION = "1.13.1"
3
3
  end
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: 1.13.0
4
+ version: 1.13.1
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: 2019-02-17 00:00:00.000000000 Z
12
+ date: 2019-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -417,6 +417,7 @@ files:
417
417
  - lib/stack_master.rb
418
418
  - lib/stack_master/aws_driver/cloud_formation.rb
419
419
  - lib/stack_master/aws_driver/s3.rb
420
+ - lib/stack_master/aws_driver/sts.rb
420
421
  - lib/stack_master/change_set.rb
421
422
  - lib/stack_master/cli.rb
422
423
  - lib/stack_master/command.rb
@@ -478,6 +479,7 @@ files:
478
479
  - lib/stack_master/stack_events/streamer.rb
479
480
  - lib/stack_master/stack_states.rb
480
481
  - lib/stack_master/stack_status.rb
482
+ - lib/stack_master/target_definition.rb
481
483
  - lib/stack_master/template_compiler.rb
482
484
  - lib/stack_master/template_compilers/cfndsl.rb
483
485
  - lib/stack_master/template_compilers/json.rb
@@ -486,6 +488,7 @@ files:
486
488
  - lib/stack_master/template_utils.rb
487
489
  - lib/stack_master/test_driver/cloud_formation.rb
488
490
  - lib/stack_master/test_driver/s3.rb
491
+ - lib/stack_master/test_driver/sts.rb
489
492
  - lib/stack_master/testing.rb
490
493
  - lib/stack_master/utils.rb
491
494
  - lib/stack_master/validator.rb
@@ -513,8 +516,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
513
516
  - !ruby/object:Gem::Version
514
517
  version: '0'
515
518
  requirements: []
516
- rubyforge_project:
517
- rubygems_version: 2.7.6
519
+ rubygems_version: 3.0.3
518
520
  signing_key:
519
521
  specification_version: 4
520
522
  summary: StackMaster is a sure-footed way of creating, updating and keeping track