cfndsl 0.16.13 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -2
  3. data/Gemfile +2 -0
  4. data/README.md +1 -1
  5. data/Rakefile +2 -0
  6. data/bin/cfndsl +9 -8
  7. data/cfndsl.gemspec +3 -1
  8. data/lib/cfndsl.rb +2 -0
  9. data/lib/cfndsl/aws/cloud_formation_template.rb +2 -0
  10. data/lib/cfndsl/aws/types.rb +3 -1
  11. data/lib/cfndsl/conditions.rb +2 -0
  12. data/lib/cfndsl/creation_policy.rb +2 -0
  13. data/lib/cfndsl/errors.rb +2 -0
  14. data/lib/cfndsl/external_parameters.rb +4 -0
  15. data/lib/cfndsl/globals.rb +2 -0
  16. data/lib/cfndsl/json_serialisable_object.rb +2 -0
  17. data/lib/cfndsl/jsonable.rb +2 -0
  18. data/lib/cfndsl/mappings.rb +2 -0
  19. data/lib/cfndsl/module.rb +2 -0
  20. data/lib/cfndsl/names.rb +2 -0
  21. data/lib/cfndsl/orchestration_template.rb +3 -1
  22. data/lib/cfndsl/os/heat_template.rb +2 -0
  23. data/lib/cfndsl/os/types.rb +3 -1
  24. data/lib/cfndsl/outputs.rb +2 -0
  25. data/lib/cfndsl/parameters.rb +2 -0
  26. data/lib/cfndsl/patches.rb +14 -0
  27. data/lib/cfndsl/plurals.rb +2 -0
  28. data/lib/cfndsl/properties.rb +2 -0
  29. data/lib/cfndsl/rake_task.rb +4 -2
  30. data/lib/cfndsl/ref_check.rb +2 -0
  31. data/lib/cfndsl/resources.rb +2 -0
  32. data/lib/cfndsl/specification.rb +2 -0
  33. data/lib/cfndsl/types.rb +2 -0
  34. data/lib/cfndsl/update_policy.rb +2 -0
  35. data/lib/cfndsl/version.rb +3 -1
  36. data/lib/cfnlego.rb +2 -0
  37. data/lib/cfnlego/cloudformation.rb +3 -1
  38. data/lib/cfnlego/resource.rb +2 -0
  39. data/lib/deep_merge/core.rb +3 -1
  40. data/lib/deep_merge/deep_merge.rb +2 -0
  41. data/sample/autoscale.rb +2 -0
  42. data/sample/autoscale2.rb +2 -0
  43. data/sample/circular.rb +2 -0
  44. data/sample/codedeploy.rb +3 -1
  45. data/sample/config_service.rb +2 -0
  46. data/sample/ecs.rb +3 -1
  47. data/sample/export.rb +2 -0
  48. data/sample/iam_policies.rb +2 -0
  49. data/sample/import.rb +2 -0
  50. data/sample/lambda.rb +3 -1
  51. data/sample/s3.rb +2 -0
  52. data/sample/t1.rb +2 -0
  53. data/sample/vpc_example.rb +2 -0
  54. data/sample/vpc_with_vpn_example.rb +2 -0
  55. data/spec/aws/ec2_security_group_spec.rb +2 -0
  56. data/spec/aws/ecs_task_definition_spec.rb +2 -0
  57. data/spec/aws/iam_managed_policy_spec.rb +2 -0
  58. data/spec/aws/kms_alias_spec.rb +2 -0
  59. data/spec/aws/logs_log_group_spec.rb +2 -0
  60. data/spec/aws/nested_arrays_spec.rb +2 -0
  61. data/spec/aws/rds_db_instance_spec.rb +2 -0
  62. data/spec/aws/serverless_spec.rb +2 -0
  63. data/spec/cfndsl_spec.rb +2 -0
  64. data/spec/cli_spec.rb +23 -8
  65. data/spec/cloud_formation_template_spec.rb +2 -0
  66. data/spec/deep_merge_spec.rb +2 -0
  67. data/spec/external_parameters_spec.rb +2 -0
  68. data/spec/fixtures/heattest.rb +2 -0
  69. data/spec/fixtures/test.rb +3 -1
  70. data/spec/generate_spec.rb +2 -0
  71. data/spec/heat_template_spec.rb +2 -0
  72. data/spec/jsonable_spec.rb +2 -0
  73. data/spec/metadata_spec.rb +2 -0
  74. data/spec/names_spec.rb +2 -0
  75. data/spec/output_spec.rb +2 -0
  76. data/spec/plurals_spec.rb +2 -0
  77. data/spec/resources_spec.rb +2 -0
  78. data/spec/spec_helper.rb +2 -0
  79. data/spec/support/shared_examples/orchestration_template.rb +2 -0
  80. data/spec/transform_spec.rb +2 -0
  81. data/spec/types_definition_spec.rb +2 -0
  82. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39f6058bc70de2ab78c3235b6e16e4212a572516e6aaa79be227cff3c4a73d55
4
- data.tar.gz: 1d01e2cefef6a5b35fd499b4b9f3d5c2b97305937497b69ff1fabd9f2749f417
3
+ metadata.gz: 1a5775bb9e498105174a3304e86d6d7d356d68dfbfe7754d2746a9aa40be003b
4
+ data.tar.gz: e8728173d33d41f4759bdf8627e25b3173273490b0e959687e3b44af1fd1bd1e
5
5
  SHA512:
6
- metadata.gz: 5b5ef82ea45c3501f1a9e2e7e66acb1a63f335884b0698b318b5a829dad1eca547ec8c0267a1fa50f4a66ae73a4a9c9667b217dd8aaae9cd4a2faae880c9a36f
7
- data.tar.gz: 292543bb9034c01ac44d180b6ff41133029890af4ce6b1bce04970dd647fd9a5eaa281a70120ff312abe3e35084cd279417d8abcffd2ff5567c2b424bae00271
6
+ metadata.gz: 0e3a197bd97878c4eba85d5f53892c9f2b0be90e61a8c5dc2e99d4ec4ae77edd83b4cff1c993d955064ae59eb2fb8779ed9f8d5782dc662ddde53be8f421e44c
7
+ data.tar.gz: 42fc049052509fb1dfffe9c0e1acf477c72a4980ade6baf30ac22a25e17384557533a2a684dd2c2f9cfeddc2111daaa9ed46dc5c1126179d1d99f8cf5bbb98c1
@@ -1,7 +1,20 @@
1
1
  # Change Log
2
2
 
3
- ## [0.16.13](https://github.com/cfndsl/cfndsl/tree/0.16.13) (2019-03-22)
4
- [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.16.12...0.16.13)
3
+ ## [0.17.0](https://github.com/cfndsl/cfndsl/tree/0.17.0) (2019-06-16)
4
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.16.13...0.17.0)
5
+
6
+ **Closed issues:**
7
+
8
+ - Handle Transform keywork [\#406](https://github.com/cfndsl/cfndsl/issues/406)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - add the latest patches [\#411](https://github.com/cfndsl/cfndsl/pull/411) ([gergnz](https://github.com/gergnz))
13
+ - fix all the latest rubocop issues [\#410](https://github.com/cfndsl/cfndsl/pull/410) ([gergnz](https://github.com/gergnz))
14
+ - Added cfndsl patch for AWSEC2CapacityReservationTag Name Error [\#409](https://github.com/cfndsl/cfndsl/pull/409) ([sktan](https://github.com/sktan))
15
+
16
+ ## [v0.16.13](https://github.com/cfndsl/cfndsl/tree/v0.16.13) (2019-03-22)
17
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.16.12...v0.16.13)
5
18
 
6
19
  **Closed issues:**
7
20
 
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -24,7 +24,7 @@ templates by running ruby.
24
24
 
25
25
  ## Getting Started
26
26
 
27
- ruby version > 2.1.0 is required to run cfndsl
27
+ ruby version > 2.3.0 is required to run cfndsl
28
28
 
29
29
  sudo gem install cfndsl
30
30
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
  require 'cfndsl/version'
data/bin/cfndsl CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'cfndsl/globals'
4
5
  require 'cfndsl/version'
@@ -65,7 +66,7 @@ optparse = OptionParser.new do |opts|
65
66
  end
66
67
 
67
68
  opts.on('-u', '--update-specification [VERSION]', 'Update the Resource Specification file to latest, or specific version') do |file|
68
- options[:spec_version] = file || 'latest'.freeze
69
+ options[:spec_version] = file || 'latest'
69
70
  options[:update_spec] = true
70
71
  end
71
72
 
@@ -94,21 +95,21 @@ end
94
95
  optparse.parse!
95
96
 
96
97
  if options[:update_spec]
97
- STDERR.puts 'Updating specification file'
98
+ warn 'Updating specification file'
98
99
  FileUtils.mkdir_p File.dirname(CfnDsl.specification_file)
99
100
  begin
100
101
  content = open("https://d1uauaxba7bl26.cloudfront.net/#{options[:spec_version]}/gzip/CloudFormationResourceSpecification.json").read
101
102
  rescue OpenURI::HTTPError
102
- STDERR.puts "Resource Specification version #{options[:spec_version]} not found, defaulting to 'latest'"
103
+ warn "Resource Specification version #{options[:spec_version]} not found, defaulting to 'latest'"
103
104
  content = open('https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json').read
104
105
  end
105
106
  File.open(CfnDsl.specification_file, 'w') { |f| f.puts content }
106
- STDERR.puts "Specification successfully written to #{CfnDsl.specification_file}"
107
+ warn "Specification successfully written to #{CfnDsl.specification_file}"
107
108
  end
108
109
 
109
110
  if options[:assetversion]
110
111
  spec_file = JSON.parse File.read(CfnDsl.specification_file)
111
- STDERR.puts spec_file['ResourceSpecificationVersion']
112
+ warn spec_file['ResourceSpecificationVersion']
112
113
  end
113
114
 
114
115
  if options[:lego]
@@ -129,7 +130,7 @@ filename = File.expand_path(ARGV[0])
129
130
  verbose = options[:verbose] && STDERR
130
131
 
131
132
  unless CfnDsl.disable_binding?
132
- STDERR.puts <<-MSG.gsub(/^\s*/, '')
133
+ warn <<-MSG.gsub(/^\s*/, '')
133
134
  The creation of constants as config is deprecated!
134
135
  Please switch to the #external_parameters method within your templates to access variables
135
136
  See https://github.com/cfndsl/cfndsl/issues/170
@@ -137,7 +138,7 @@ unless CfnDsl.disable_binding?
137
138
  MSG
138
139
  end
139
140
 
140
- verbose.puts "Using specification file #{CfnDsl.specification_file}" if verbose
141
+ warn "Using specification file #{CfnDsl.specification_file}" if verbose
141
142
 
142
143
  require 'cfndsl'
143
144
 
@@ -145,7 +146,7 @@ model = CfnDsl.eval_file_with_extras(filename, options[:extras], verbose)
145
146
 
146
147
  output = STDOUT
147
148
  if options[:output] != '-'
148
- verbose.puts("Writing to #{options[:output]}") if verbose
149
+ puts("Writing to #{options[:output]}") if verbose
149
150
  output = File.open(File.expand_path(options[:output]), 'w')
150
151
  elsif verbose
151
152
  verbose.puts('Writing to STDOUT')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'cfndsl/version'
@@ -14,7 +16,7 @@ Gem::Specification.new do |s|
14
16
  s.license = 'MIT'
15
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
18
  s.require_paths = ['lib']
17
- s.required_ruby_version = '~> 2.2'
19
+ s.required_ruby_version = '~> 2.3'
18
20
 
19
21
  s.executables << 'cfndsl'
20
22
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'forwardable'
2
4
  require 'json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/orchestration_template'
2
4
 
3
5
  module CfnDsl
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/types'
2
4
 
3
5
  module CfnDsl
4
6
  module AWS
5
7
  # Cloud Formation Types
6
8
  module Types
7
- TYPE_PREFIX = 'aws'.freeze
9
+ TYPE_PREFIX = 'aws'
8
10
  class Type < JSONable; end
9
11
  include CfnDsl::Types
10
12
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # Keeps track of errors
3
5
  module Errors
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # Handles all external parameters
3
5
  class ExternalParameters
@@ -46,7 +48,9 @@ module CfnDsl
46
48
 
47
49
  def add_to_binding(bind, logstream)
48
50
  parameters.each_pair do |key, val|
51
+ # rubocop:disable Style/SafeNavigation
49
52
  logstream.puts("Setting local variable #{key} to #{val}") if logstream
53
+ # rubocop:enable Style/SafeNavigation
50
54
  bind.eval "#{key} = #{val.inspect}"
51
55
  end
52
56
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Global variables to adjust CfnDsl behavior
2
4
  module CfnDsl
3
5
  module_function
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # JSONSerialisableObject
3
5
  module JSONSerialisableObject
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/errors'
2
4
  require 'cfndsl/ref_check'
3
5
  require 'cfndsl/json_serialisable_object'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/plurals'
2
4
  require 'cfndsl/names'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Method name helper
2
4
  module CfnDsl
3
5
  module_function
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
  require 'cfndsl/names'
3
5
  require 'cfndsl/aws/types'
@@ -121,7 +123,7 @@ module CfnDsl
121
123
 
122
124
  return true if GLOBAL_REFS.key?(ref)
123
125
 
124
- return true if @Parameters && @Parameters.key?(ref)
126
+ return true if @Parameters&.key?(ref)
125
127
 
126
128
  return !origin || !@_resource_refs || !@_resource_refs[ref] || !@_resource_refs[ref].key?(origin) if @Resources.key?(ref)
127
129
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/orchestration_template'
2
4
 
3
5
  module CfnDsl
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/types'
2
4
 
3
5
  module CfnDsl
4
6
  module OS
5
7
  # Open Stack Types
6
8
  module Types
7
- TYPE_PREFIX = 'os'.freeze
9
+ TYPE_PREFIX = 'os'
8
10
  class Type < JSONable; end
9
11
  include CfnDsl::Types
10
12
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # Module for handling inconsistencies in the published resource specification from AWS
3
5
  # rubocop:disable Metrics/ModuleLength
@@ -117,6 +119,12 @@ module CfnDsl
117
119
  'Key' => { 'PrimitiveType' => 'String' }
118
120
  }
119
121
  },
122
+ 'AWS::EC2::CapacityReservation.Tag' => {
123
+ 'Properties' => {
124
+ 'Value' => { 'PrimitiveType' => 'String' },
125
+ 'Key' => { 'PrimitiveType' => 'String' }
126
+ }
127
+ },
120
128
  'AWS::DLM::LifecyclePolicy.Tag' => {
121
129
  'Properties' => {
122
130
  'Value' => { 'PrimitiveType' => 'String' },
@@ -129,6 +137,12 @@ module CfnDsl
129
137
  'Key' => { 'PrimitiveType' => 'String' }
130
138
  }
131
139
  },
140
+ 'AWS::EC2::ClientVpnEndpoint.Tag' => {
141
+ 'Properties' => {
142
+ 'Value' => { 'PrimitiveType' => 'String' },
143
+ 'Key' => { 'PrimitiveType' => 'String' }
144
+ }
145
+ },
132
146
  'AWS::Serverless::SimpleTable.PrimaryKey' => {
133
147
  'Properties' => {
134
148
  'Name' => { 'PrimitiveType' => 'String' },
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # Plural names for lists of content objects
3
5
  module Plurals
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake'
2
4
  require 'rake/tasklib'
3
5
 
@@ -35,7 +37,7 @@ module CfnDsl
35
37
 
36
38
  def log(opts)
37
39
  type = opts[:output].nil? ? 'STDOUT' : opts[:output]
38
- verbose.puts("Writing to #{type}") if verbose
40
+ verbose&.puts("Writing to #{type}")
39
41
  end
40
42
 
41
43
  def outputter(opts)
@@ -45,7 +47,7 @@ module CfnDsl
45
47
  def model(filename)
46
48
  raise "#{filename} doesn't exist" unless File.exist?(filename)
47
49
 
48
- verbose.puts("using extras #{extra}") if verbose
50
+ verbose&.puts("using extras #{extra}")
49
51
  CfnDsl.eval_file_with_extras(filename, extra, verbose)
50
52
  end
51
53
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This module defines some methods for walking the reference tree
2
4
  # of various objects.
3
5
  module RefCheck
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
  require 'cfndsl/properties'
3
5
  require 'cfndsl/update_policy'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
4
  # Helper module for bridging the gap between a static types file included in the repo
3
5
  # and dynamically generating the types directly from the AWS specification
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'cfndsl/jsonable'
3
5
  require 'cfndsl/plurals'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl/jsonable'
2
4
 
3
5
  module CfnDsl
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CfnDsl
2
- VERSION = '0.16.13'.freeze
4
+ VERSION = '0.17.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'erb'
3
5
  require 'cfnlego/cloudformation'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Cfnlego
2
4
  module Cfnlego
3
5
  # CloudFormation
4
6
  class CloudFormation
5
- TEMPLATE = "#{File.dirname(__FILE__)}/cloudformation.erb".freeze
7
+ TEMPLATE = "#{File.dirname(__FILE__)}/cloudformation.erb"
6
8
 
7
9
  attr_reader :resources
8
10
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'net/http'
3
5
  require 'uri'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # rubocop:disable Metrics/AbcSize, Metrics/BlockNesting, Metrics/CyclomaticComplexity, Metrics/MethodLength
2
4
  # rubocop:disable Metrics/ModuleLength, Metrics/PerceivedComplexity, Style/IfInsideElse, Style/Semicolon
3
5
  #
@@ -5,7 +7,7 @@
5
7
  module DeepMerge
6
8
  class InvalidParameter < StandardError; end
7
9
 
8
- DEFAULT_FIELD_KNOCKOUT_PREFIX = '--'.freeze
10
+ DEFAULT_FIELD_KNOCKOUT_PREFIX = '--'
9
11
 
10
12
  # Deep Merge core documentation.
11
13
  # deep_merge! method permits merging of arbitrary child elements. The two top level
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Totally borrowed from https://github.com/danielsdeleo/deep_merge
2
4
  require 'deep_merge/core'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # We start things off by calling the CloudFormation function.
2
4
  CloudFormation do
3
5
  # Declare the template format version
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # We start things off by calling the CloudFormation function.
2
4
  CloudFormation do
3
5
  # Declare the template format version
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  AWSTemplateFormatVersion '2010-09-09'
3
5
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
- DESCRIPTION ||= 'CodeDeploy description'.freeze
4
+ DESCRIPTION ||= 'CodeDeploy description'
3
5
 
4
6
  Description DESCRIPTION
5
7
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  AWSTemplateFormatVersion '2010-09-09'
3
5
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
- DESCRIPTION ||= 'ecs description'.freeze
4
+ DESCRIPTION ||= 'ecs description'
3
5
 
4
6
  Description DESCRIPTION
5
7
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  EC2_SecurityGroup(:webSecurityGroup) do
3
5
  GroupDescription 'Allow incoming HTTP traffic from anywhere'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  AWSTemplateFormatVersion '2010-09-09'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  EC2_SecurityGroup(:databaseSecurityGroup) do
3
5
  GroupDescription 'Allow access from only web instances'
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
- DESCRIPTION ||= 'lambda description'.freeze
4
+ DESCRIPTION ||= 'lambda description'
3
5
 
4
6
  Description DESCRIPTION
5
7
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  S3_Bucket('Bucket') do
3
5
  BucketName 'MyBucket'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
4
  description = external_parameters.fetch(:description, 'default description')
3
5
  machines = external_parameters.fetch(:machines, 1).to_i
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl'
2
4
 
3
5
  CloudFormation do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfndsl'
2
4
 
3
5
  CloudFormation do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  def read_json_fixture(filename)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl do
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
- WORKING_SPEC_VERSION = '2.19.0'.freeze
5
+ WORKING_SPEC_VERSION = '2.19.0'
4
6
 
5
7
  describe 'cfndsl', type: :aruba do
6
8
  let(:usage) do
@@ -48,6 +50,17 @@ describe 'cfndsl', type: :aruba do
48
50
  end
49
51
  end
50
52
 
53
+ context 'cfndsl -u' do
54
+ it 'updates the specification file' do
55
+ run_command 'cfndsl -u'
56
+ expect(last_command_started).to have_output_on_stderr(<<-OUTPUT.gsub(/^ {8}/, '').chomp)
57
+ Updating specification file
58
+ Specification successfully written to #{ENV['HOME']}/.cfndsl/resource_specification.json
59
+ OUTPUT
60
+ expect(last_command_started).to have_exit_status(0)
61
+ end
62
+ end
63
+
51
64
  context 'cfndsl -a' do
52
65
  it 'prints out the specification file version' do
53
66
  run_command 'cfndsl -a'
@@ -162,13 +175,15 @@ describe 'cfndsl', type: :aruba do
162
175
 
163
176
  it 'displays the variables as they are interpolated in the CloudFormation template' do
164
177
  run_command_and_stop 'cfndsl template.rb --yaml params.yaml --verbose'
165
- verbose = /
166
- Using \s specification \s file .* \.json \n
167
- Loading \s YAML \s file \s .* params\.yaml \n
168
- Setting \s local \s variable \s DESC \s to \s yaml \n
169
- Loading \s template \s file \s .* template.rb \n
170
- Writing \s to \s STDOUT
171
- /x
178
+ verbose = %r{The creation of constants as config is deprecated!
179
+ Please switch to the #external_parameters method within your templates to access variables
180
+ See https://github.com/cfndsl/cfndsl/issues/170
181
+ Use the --disable-binding flag to suppress this message
182
+ Using specification file .*\.json
183
+ Loading YAML file .*params\.yaml
184
+ Setting local variable DESC to yaml
185
+ Loading template file .*template\.rb
186
+ Writing to STDOUT}
172
187
  template = '{"AWSTemplateFormatVersion":"2010-09-09","Description":"yaml"}'
173
188
  expect(last_command_started).to have_output_on_stderr(verbose)
174
189
  expect(last_command_started).to have_output_on_stdout(template)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::CloudFormationTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  describe DeepMerge do
3
5
  source = { key1: { keya1: 1, keya2: 2 }, key2: [1, 2] }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::ExternalParameters do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Heat do
2
4
  Description 'Test'
3
5
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  CloudFormation do
2
- TEST ||= 'no value set'.freeze
4
+ TEST ||= 'no value set'
3
5
  puts TEST
4
6
 
5
7
  Description external_parameters[:test]
@@ -1,3 +1,4 @@
1
+ # rubocop:disable Style/FrozenStringLiteralComment
1
2
  require 'spec_helper'
2
3
  describe Cfnlego do
3
4
  let(:template) { Cfnlego.run(resources: ['AWS::EC2::EIP,EIP']) }
@@ -13,3 +14,4 @@ describe Cfnlego do
13
14
  end
14
15
  end
15
16
  end
17
+ # rubocop:enable Style/FrozenStringLiteralComment
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::HeatTemplate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::JSONable do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Metadata' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::OutputDefinition do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::Plurals do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe CfnDsl::ResourceDefinition do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'aruba/rspec'
2
4
 
3
5
  if ENV['CFNDSL_COV']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  shared_examples 'an orchestration template' do
2
4
  context '#valid_ref?' do
3
5
  it 'returns true if ref is global' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Transform' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  # This is a somewhat temporary test class to compare functionality
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfndsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.13
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-03-22 00:00:00.000000000 Z
14
+ date: 2019-06-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -143,14 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '2.2'
146
+ version: '2.3'
147
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.0.3
153
+ rubygems_version: 3.0.4
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: AWS Cloudformation DSL