cloudformation-ruby-dsl 1.4.3 → 1.4.5

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: 1f32c98b854e3dc8fca0b487b32e2b90ce58fbad
4
- data.tar.gz: 217cddaa39ebfd41aae4d2248371417155c1235f
3
+ metadata.gz: deac34a448639ee067b89c896ebf7dfc468e2b8b
4
+ data.tar.gz: e97d281442a58b6afe721f9b4f080bc2da13d739
5
5
  SHA512:
6
- metadata.gz: f605f4569e4a04bacd29263f3f28ae0fe893a75846a48b8f2ed05b796396ddb9f0add6ba7e1b30d906070fa174ea5faa74511b727e9d22a5b3abc3835c43cee7
7
- data.tar.gz: 0a747e0ff628bbc5f7034d2ae120785fb7a999ff0cf11bd8b91100a38485ca83527ab81eb4b471e8eda333d9dba4bf3fd0fac7801835d203567f8355f7cbb646
6
+ metadata.gz: adeb8b93a2549348a4fddea6947eec68d684ce73e82e570bd17093f7da21f958a4cbc3bcc55baa7792a53977203395568a4240e2b4c8862bdc61c7c4473b29f3
7
+ data.tar.gz: d687713a78d7f47cff160da9d3613a2994bcc9bc803e5202b0db5ac3b4a786b19066f464d29b074d83daccd715e7d2bab79c2777d5d21a414ab11c65cea2a8db
@@ -3,8 +3,19 @@ require 'bundler/setup'
3
3
  require 'cloudformation-ruby-dsl/cfntemplate'
4
4
 
5
5
  tmpl = template do
6
- @stack_name = "hello-bucket-example"
7
- resource "HelloBucket", :Type => "AWS::S3::Bucket"
6
+ @stack_name = 'hello-bucket-example'
7
+
8
+ parameter 'Label',
9
+ :Description => 'The label to apply to the bucket.',
10
+ :Type => 'String',
11
+ :Default => 'cfnrdsl',
12
+ :UsePreviousValue => true
13
+
14
+ resource "HelloBucket",
15
+ :Type => 'AWS::S3::Bucket',
16
+ :Properties => {
17
+ :BucketName => ref('Label')
18
+ }
8
19
  end
9
20
 
10
21
  tmpl.exec!
@@ -286,7 +286,11 @@ template.rb create --stack-name my_stack --parameters "BucketName=bucket-s3-stat
286
286
 
287
287
  # Sort the parameter strings alphabetically to make them easily comparable
288
288
  old_parameters_string = old_parameters.sort.map { |key, value| %Q(PARAMETER "#{key}=#{value}"\n) }.join
289
- parameters_string = template.parameters.sort.map { |key, value| "PARAMETER \"#{key}=#{!(value.empty? && value.use_previous_value) ? value : old_parameters[key]}\"\n" }.join
289
+ parameters_string = template.parameters.sort.map do |key, value|
290
+ value = old_parameters[key] if value.empty? && value.use_previous_value && !old_parameters[key].to_s.empty?
291
+ value = value.default if value.empty? && !value.default.to_s.empty?
292
+ "PARAMETER \"#{key}=#{value}\"\n"
293
+ end.join
290
294
 
291
295
  # set default diff options
292
296
  Diffy::Diff.default_options.merge!(
@@ -15,7 +15,7 @@
15
15
  module Cfn
16
16
  module Ruby
17
17
  module Dsl
18
- VERSION = "1.4.3"
18
+ VERSION = "1.4.5"
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-ruby-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Smith
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-01-26 00:00:00.000000000 Z
18
+ date: 2017-03-16 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: detabulator