cloudformation-tool 1.5.12 → 1.5.14

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: 6a319ecaf3ad4f3b1e1e38db7f634ade7dfa0956a260355a57037a0e483d21f0
4
- data.tar.gz: 68a70165c686f2ed56ffc78d3230640130576be98d44bd02b23248cedfd49ecf
3
+ metadata.gz: a9db3672b97a22828e57d6c906a78831153a620bca1632f9f9748f72e27c9db7
4
+ data.tar.gz: ad0eca7cc6ae46eaf3b0a55c57fd8e85695a27b8c97f71e55492e0a95bd208d2
5
5
  SHA512:
6
- metadata.gz: 988632fc9975609c94f587cb31858d4086f95d0205bf43f06259424fddad2d5fff7dd6ee6c991d96936397f506690c2d3dcf6f38c2658f72ff744d97a179ddee
7
- data.tar.gz: 8e02c56f4f99cdd8f9bccd85963b7e60665de292dc8d91d20f51bfecc5aee0660834f1d791bee19d9688325ffa1634c27bb8f023ac1539c779bebe5027ccc687
6
+ metadata.gz: 0452d98f9e5426f6924cc8caf53430b8936fc9ac38187abda7ff9d780cf921330f0f85b592cab7be9b26918e3f54585892e61548e747721dfc46973ec64e04aa
7
+ data.tar.gz: 6d50f5dd121f968799fd5754a6f54726cd0c64925ce9bd79a27f4360ee710c65a914fc36f3d740536664c4ffc1c1a03b5f055c21848deb2e976900c3f2060dc1
@@ -41,7 +41,7 @@ module CloudFormationTool
41
41
  resp = awscf.update_stack({
42
42
  stack_name: @name,
43
43
  template_url: url,
44
- capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM),
44
+ capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND),
45
45
  parameters: params.collect do |k,v|
46
46
  {
47
47
  parameter_key: k.to_s,
@@ -63,7 +63,7 @@ module CloudFormationTool
63
63
  resp = awscf.create_stack({
64
64
  stack_name: @name,
65
65
  template_url: url,
66
- capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM),
66
+ capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND),
67
67
  on_failure: "DO_NOTHING", ##"ROLLBACK",
68
68
  parameters: params.collect do |k,v|
69
69
  {
@@ -301,4 +301,4 @@ module CloudFormationTool
301
301
  end
302
302
 
303
303
  end
304
- end
304
+ end
@@ -121,17 +121,34 @@ module CloudFormationTool
121
121
  end
122
122
  end
123
123
  else
124
- # warn against duplicate entities, resources or outputs
125
- (@data[category] ||= {}).keys.each do |key|
126
- if catdata.has_key? key
127
- raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - duplicate '#{category}' item: #{key}"
128
- end
124
+ case catdata
125
+ when Hash
126
+ # warn against duplicate entities, resources or outputs
127
+ (@data[category] ||= {}).keys.each do |key|
128
+ if catdata.has_key? key
129
+ raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - duplicate '#{category}' item: #{key}"
130
+ end
131
+ end
132
+ catdata = fixrefs(catdata, rewrites)
133
+ # add included properties
134
+ @data[category].merge! catdata
135
+ when Array
136
+ if @data[category].nil?
137
+ @data[category] = catdata
138
+ elsif @data[category].is_a? Array
139
+ @data[category] += catdata
140
+ else
141
+ raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - conflicting types for '#{category}'"
142
+ end
143
+ else
144
+ if @data[category].nil?
145
+ @data[category] = catdata
146
+ else
147
+ raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - I do not know how to merge non-list non-dictionary '#{category}'!"
148
+ end
129
149
  end
130
- catdata = fixrefs(catdata, rewrites)
131
150
  end
132
151
 
133
- # add included properties
134
- @data[category].merge! catdata
135
152
  end
136
153
  end
137
154
  end
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '1.5.12'
2
+ VERSION = '1.5.14'
3
3
  end
@@ -135,8 +135,16 @@ module CloudFormationTool
135
135
  def s3_bucket_name(region)
136
136
  name = nil
137
137
  # see if we already have a cf-templates bucket for this region
138
- bucket = awss3.list_buckets.buckets.select do |b|
139
- b.name =~ /cf-templates-(\w+)-#{region}/
138
+ bucket = awss3(region).list_buckets.buckets.select do |b|
139
+ b.name =~ /cf-templates-(\w+)-#{region}/
140
+ end.select do |b|
141
+ # S3 started showing us buckets that were deleted, and can't actually be accessible, so filter those
142
+ begin
143
+ Aws::S3::Bucket.new(b.name, client: awss3(region)).objects.first
144
+ true
145
+ rescue Aws::S3::Errors::NoSuchBucket => e
146
+ false
147
+ end
140
148
  end.first
141
149
 
142
150
  # otherwise try to create one
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.12
4
+ version: 1.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-20 00:00:00.000000000 Z
11
+ date: 2023-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake