stack_master 2.13.2 → 2.13.4
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 +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 583b1be28160e2e7a7d483c6c98d4c04cd2a40d2af68aaac909d20d8a89d481e
|
4
|
+
data.tar.gz: 145c997f67b7ddc582f9662cdae40982de289290a844987864c1f51586f82666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f64207bb7cffe0fa1eb57bec402f96516772d7ead47ffce6ad74439ab5372df9322aa2cb0c5970af35b1f6563940a32e116275408dd4743475c1e8256bfdc024
|
7
|
+
data.tar.gz: cb54cad90ae22381bc3f410f661abc878edf1abfa9b69cfb4c42e6d85ac4f562eca9d0cf9098b24b0e35e97d2022176949ade4ba609000cd2cbb239a786304d7
|
@@ -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.4
|
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-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -269,6 +269,20 @@ dependencies:
|
|
269
269
|
- - "~>"
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '1'
|
272
|
+
- !ruby/object:Gem::Dependency
|
273
|
+
name: sorted_set
|
274
|
+
requirement: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - ">="
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '0'
|
279
|
+
type: :runtime
|
280
|
+
prerelease: false
|
281
|
+
version_requirements: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - ">="
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '0'
|
272
286
|
- !ruby/object:Gem::Dependency
|
273
287
|
name: diffy
|
274
288
|
requirement: !ruby/object:Gem::Requirement
|
@@ -446,7 +460,7 @@ dependencies:
|
|
446
460
|
version: 0.6.7
|
447
461
|
- - "<"
|
448
462
|
- !ruby/object:Gem::Version
|
449
|
-
version: 0.
|
463
|
+
version: 0.9.0
|
450
464
|
type: :runtime
|
451
465
|
prerelease: false
|
452
466
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -456,7 +470,7 @@ dependencies:
|
|
456
470
|
version: 0.6.7
|
457
471
|
- - "<"
|
458
472
|
- !ruby/object:Gem::Version
|
459
|
-
version: 0.
|
473
|
+
version: 0.9.0
|
460
474
|
description: ''
|
461
475
|
email:
|
462
476
|
- steve@hodgkiss.me
|
@@ -563,8 +577,8 @@ licenses:
|
|
563
577
|
metadata:
|
564
578
|
bug_tracker_uri: https://github.com/envato/stack_master/issues
|
565
579
|
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.
|
580
|
+
documentation_uri: https://www.rubydoc.info/gems/stack_master/2.13.4
|
581
|
+
source_code_uri: https://github.com/envato/stack_master/tree/v2.13.4
|
568
582
|
post_install_message:
|
569
583
|
rdoc_options: []
|
570
584
|
require_paths:
|
@@ -580,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
580
594
|
- !ruby/object:Gem::Version
|
581
595
|
version: '0'
|
582
596
|
requirements: []
|
583
|
-
rubygems_version: 3.
|
597
|
+
rubygems_version: 3.1.6
|
584
598
|
signing_key:
|
585
599
|
specification_version: 4
|
586
600
|
summary: StackMaster is a sure-footed way of creating, updating and keeping track
|