stack_master 2.13.2 → 2.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stack_master/aws_driver/cloud_formation.rb +1 -1
- data/lib/stack_master/aws_driver/s3.rb +5 -5
- data/lib/stack_master/change_set.rb +3 -3
- data/lib/stack_master/commands/init.rb +1 -1
- data/lib/stack_master/commands/resources.rb +1 -1
- data/lib/stack_master/config.rb +1 -1
- data/lib/stack_master/identity.rb +2 -2
- data/lib/stack_master/parameter_loader.rb +1 -1
- data/lib/stack_master/parameter_resolvers/acm_certificate.rb +2 -2
- data/lib/stack_master/parameter_resolvers/ami_finder.rb +3 -3
- data/lib/stack_master/parameter_resolvers/latest_container.rb +1 -1
- data/lib/stack_master/parameter_resolvers/parameter_store.rb +3 -3
- data/lib/stack_master/parameter_resolvers/stack_output.rb +1 -1
- data/lib/stack_master/role_assumer.rb +2 -2
- data/lib/stack_master/security_group_finder.rb +1 -1
- data/lib/stack_master/sns_topic_finder.rb +1 -1
- data/lib/stack_master/stack.rb +3 -3
- data/lib/stack_master/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7bda5922dbdb5ca9d69ae6dc641800883e25daa265ce0f7d4da3fb815cff6a
|
4
|
+
data.tar.gz: 9c24527b5f7c2e4cebfad1febbdf5fa185b0a51007598ae76d81336844356065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ad5c9e33f41f60fa32ebd5f43fdc2bcd26081b1f7393057d542dcbdc6bbd7e77f6b4ffc64fdfb61d6249723129dd1f47fb0aacda40b287db16c6aa5d8999e43
|
7
|
+
data.tar.gz: 5ed1428953501a934a5021242b137f26053159a53b49f06d2413e64da9a8a116ac427f1ee1df6f6820b8d5c5958327d192fbd2b1e04884b1ead83cc5c5235766
|
@@ -17,10 +17,10 @@ module StackMaster
|
|
17
17
|
|
18
18
|
s3 = new_s3_client(region: region)
|
19
19
|
|
20
|
-
current_objects = s3.list_objects(
|
20
|
+
current_objects = s3.list_objects({
|
21
21
|
prefix: prefix,
|
22
22
|
bucket: bucket
|
23
|
-
).map(&:contents).flatten.inject({}){|h,obj|
|
23
|
+
}).map(&:contents).flatten.inject({}){|h,obj|
|
24
24
|
h.merge(obj.key => obj)
|
25
25
|
}
|
26
26
|
|
@@ -38,12 +38,12 @@ module StackMaster
|
|
38
38
|
s3_uri = "s3://#{bucket}/#{object_key}"
|
39
39
|
StackMaster.stdout.print "- #{File.basename(path)} => #{s3_uri} "
|
40
40
|
|
41
|
-
s3.put_object(
|
41
|
+
s3.put_object({
|
42
42
|
bucket: bucket,
|
43
43
|
key: object_key,
|
44
44
|
body: body,
|
45
45
|
metadata: { md5: compiled_template_md5 }
|
46
|
-
)
|
46
|
+
})
|
47
47
|
StackMaster.stdout.puts "done."
|
48
48
|
end
|
49
49
|
end
|
@@ -61,7 +61,7 @@ module StackMaster
|
|
61
61
|
private
|
62
62
|
|
63
63
|
def new_s3_client(region: nil)
|
64
|
-
Aws::S3::Client.new(region: region || @region)
|
64
|
+
Aws::S3::Client.new({ region: region || @region })
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -25,12 +25,12 @@ module StackMaster
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.delete(id)
|
28
|
-
cf.delete_change_set(change_set_name: id)
|
28
|
+
cf.delete_change_set({ change_set_name: id })
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.execute(id, stack_name)
|
32
|
-
cf.execute_change_set(change_set_name: id,
|
33
|
-
|
32
|
+
cf.execute_change_set({ change_set_name: id,
|
33
|
+
stack_name: stack_name })
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.cf
|
@@ -29,7 +29,7 @@ module StackMaster
|
|
29
29
|
|
30
30
|
if !@options.overwrite
|
31
31
|
[@stack_master_filename, @stack_json_filename, @parameters_filename, @region_parameters_filename].each do |filename|
|
32
|
-
if File.
|
32
|
+
if File.exist?(filename)
|
33
33
|
StackMaster.stderr.puts("Aborting: #{filename} already exists. Use --overwrite to force overwriting file.")
|
34
34
|
return false
|
35
35
|
end
|
@@ -17,7 +17,7 @@ module StackMaster
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def stack_resources
|
20
|
-
@stack_resources ||= cf.describe_stack_resources(stack_name: @stack_definition.stack_name).stack_resources
|
20
|
+
@stack_resources ||= cf.describe_stack_resources({ stack_name: @stack_definition.stack_name }).stack_resources
|
21
21
|
rescue Aws::CloudFormation::Errors::ValidationError
|
22
22
|
nil
|
23
23
|
end
|
data/lib/stack_master/config.rb
CHANGED
@@ -28,7 +28,7 @@ module StackMaster
|
|
28
28
|
|
29
29
|
dir = Dir.pwd
|
30
30
|
parent_dir = File.expand_path("..", Dir.pwd)
|
31
|
-
while parent_dir != dir && !File.
|
31
|
+
while parent_dir != dir && !File.exist?(File.join(dir, config_file))
|
32
32
|
dir = parent_dir
|
33
33
|
parent_dir = File.expand_path("..", dir)
|
34
34
|
end
|
@@ -31,11 +31,11 @@ module StackMaster
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def sts
|
34
|
-
@sts ||= Aws::STS::Client.new(region: region)
|
34
|
+
@sts ||= Aws::STS::Client.new({ region: region })
|
35
35
|
end
|
36
36
|
|
37
37
|
def iam
|
38
|
-
@iam ||= Aws::IAM::Client.new(region: region)
|
38
|
+
@iam ||= Aws::IAM::Client.new({ region: region })
|
39
39
|
end
|
40
40
|
|
41
41
|
def contains_account_id?(ids)
|
@@ -21,7 +21,7 @@ module StackMaster
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def self.load_parameters(file_name)
|
24
|
-
file_exists = File.
|
24
|
+
file_exists = File.exist?(file_name)
|
25
25
|
StackMaster.debug file_exists ? " #{file_name} found" : " #{file_name} not found"
|
26
26
|
file_exists ? load_file(file_name) : {}
|
27
27
|
end
|
@@ -19,9 +19,9 @@ module StackMaster
|
|
19
19
|
def all_certs
|
20
20
|
certs = []
|
21
21
|
next_token = nil
|
22
|
-
client = Aws::ACM::Client.new(region: @stack_definition.region)
|
22
|
+
client = Aws::ACM::Client.new({ region: @stack_definition.region })
|
23
23
|
loop do
|
24
|
-
resp = client.list_certificates(certificate_statuses: ['ISSUED'], next_token: next_token)
|
24
|
+
resp = client.list_certificates({ certificate_statuses: ['ISSUED'], next_token: next_token })
|
25
25
|
certs << resp.certificate_summary_list
|
26
26
|
next_token = resp.next_token
|
27
27
|
break if next_token.nil?
|
@@ -19,7 +19,7 @@ module StackMaster
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def find_latest_ami(filters, owners = ['self'])
|
22
|
-
images = ec2.describe_images(owners: owners, filters: filters).images
|
22
|
+
images = ec2.describe_images({ owners: owners, filters: filters }).images
|
23
23
|
sorted_images = images.sort do |a, b|
|
24
24
|
Time.parse(a.creation_date) <=> Time.parse(b.creation_date)
|
25
25
|
end
|
@@ -29,8 +29,8 @@ module StackMaster
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def ec2
|
32
|
-
@ec2 ||= Aws::EC2::Client.new(region: @region)
|
32
|
+
@ec2 ||= Aws::EC2::Client.new({ region: @region })
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
@@ -14,7 +14,7 @@ module StackMaster
|
|
14
14
|
end
|
15
15
|
|
16
16
|
@region = parameters['region'] || @stack_definition.region
|
17
|
-
ecr_client = Aws::ECR::Client.new(region: @region)
|
17
|
+
ecr_client = Aws::ECR::Client.new({ region: @region })
|
18
18
|
|
19
19
|
images = fetch_images(parameters['repository_name'], parameters['registry_id'], ecr_client)
|
20
20
|
|
@@ -11,11 +11,11 @@ module StackMaster
|
|
11
11
|
|
12
12
|
def resolve(value)
|
13
13
|
begin
|
14
|
-
ssm = Aws::SSM::Client.new(region: @stack_definition.region)
|
15
|
-
resp = ssm.get_parameter(
|
14
|
+
ssm = Aws::SSM::Client.new({ region: @stack_definition.region })
|
15
|
+
resp = ssm.get_parameter({
|
16
16
|
name: value,
|
17
17
|
with_decryption: true
|
18
|
-
)
|
18
|
+
})
|
19
19
|
rescue Aws::SSM::Errors::ParameterNotFound
|
20
20
|
raise ParameterNotFound, "Unable to find #{value} in Parameter Store"
|
21
21
|
end
|
@@ -53,7 +53,7 @@ module StackMaster
|
|
53
53
|
|
54
54
|
@stacks.fetch(stack_key) do
|
55
55
|
regional_cf = cf_for_region(unaliased_region)
|
56
|
-
cf_stack = regional_cf.describe_stacks(stack_name: stack_name).stacks.first
|
56
|
+
cf_stack = regional_cf.describe_stacks({ stack_name: stack_name }).stacks.first
|
57
57
|
@stacks[stack_key] = cf_stack
|
58
58
|
end
|
59
59
|
end
|
@@ -44,11 +44,11 @@ module StackMaster
|
|
44
44
|
def assume_role_credentials(account, role)
|
45
45
|
credentials_key = "#{account}:#{role}"
|
46
46
|
@credentials.fetch(credentials_key) do
|
47
|
-
@credentials[credentials_key] = Aws::AssumeRoleCredentials.new(
|
47
|
+
@credentials[credentials_key] = Aws::AssumeRoleCredentials.new({
|
48
48
|
region: StackMaster.cloud_formation_driver.region,
|
49
49
|
role_arn: "arn:aws:iam::#{account}:role/#{role}",
|
50
50
|
role_session_name: "stack-master-role-assumer"
|
51
|
-
)
|
51
|
+
})
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/stack_master/stack.rb
CHANGED
@@ -29,15 +29,15 @@ module StackMaster
|
|
29
29
|
|
30
30
|
def self.find(region, stack_name)
|
31
31
|
cf = StackMaster.cloud_formation_driver
|
32
|
-
cf_stack = cf.describe_stacks(stack_name: stack_name).stacks.first
|
32
|
+
cf_stack = cf.describe_stacks({ stack_name: stack_name }).stacks.first
|
33
33
|
return unless cf_stack
|
34
34
|
parameters = cf_stack.parameters.inject({}) do |params_hash, param_struct|
|
35
35
|
params_hash[param_struct.parameter_key] = param_struct.parameter_value
|
36
36
|
params_hash
|
37
37
|
end
|
38
|
-
template_body ||= cf.get_template(stack_name: stack_name, template_stage: 'Original').template_body
|
38
|
+
template_body ||= cf.get_template({ stack_name: stack_name, template_stage: 'Original' }).template_body
|
39
39
|
template_format = TemplateUtils.identify_template_format(template_body)
|
40
|
-
stack_policy_body ||= cf.get_stack_policy(stack_name: stack_name).stack_policy_body
|
40
|
+
stack_policy_body ||= cf.get_stack_policy({ stack_name: stack_name }).stack_policy_body
|
41
41
|
outputs = cf_stack.outputs
|
42
42
|
|
43
43
|
new(region: region,
|
data/lib/stack_master/version.rb
CHANGED
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: 2.13.
|
4
|
+
version: 2.13.3
|
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:
|
12
|
+
date: 2023-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -446,7 +446,7 @@ dependencies:
|
|
446
446
|
version: 0.6.7
|
447
447
|
- - "<"
|
448
448
|
- !ruby/object:Gem::Version
|
449
|
-
version: 0.
|
449
|
+
version: 0.9.0
|
450
450
|
type: :runtime
|
451
451
|
prerelease: false
|
452
452
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -456,7 +456,7 @@ dependencies:
|
|
456
456
|
version: 0.6.7
|
457
457
|
- - "<"
|
458
458
|
- !ruby/object:Gem::Version
|
459
|
-
version: 0.
|
459
|
+
version: 0.9.0
|
460
460
|
description: ''
|
461
461
|
email:
|
462
462
|
- steve@hodgkiss.me
|
@@ -563,8 +563,8 @@ licenses:
|
|
563
563
|
metadata:
|
564
564
|
bug_tracker_uri: https://github.com/envato/stack_master/issues
|
565
565
|
changelog_uri: https://github.com/envato/stack_master/blob/master/CHANGELOG.md
|
566
|
-
documentation_uri: https://www.rubydoc.info/gems/stack_master/2.13.
|
567
|
-
source_code_uri: https://github.com/envato/stack_master/tree/v2.13.
|
566
|
+
documentation_uri: https://www.rubydoc.info/gems/stack_master/2.13.3
|
567
|
+
source_code_uri: https://github.com/envato/stack_master/tree/v2.13.3
|
568
568
|
post_install_message:
|
569
569
|
rdoc_options: []
|
570
570
|
require_paths:
|
@@ -580,7 +580,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
580
580
|
- !ruby/object:Gem::Version
|
581
581
|
version: '0'
|
582
582
|
requirements: []
|
583
|
-
rubygems_version: 3.
|
583
|
+
rubygems_version: 3.4.5
|
584
584
|
signing_key:
|
585
585
|
specification_version: 4
|
586
586
|
summary: StackMaster is a sure-footed way of creating, updating and keeping track
|