cloudformation_wrapper 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa8043c1f28252ac92be0fd5207ea86c4ad82f4cf3e41a68b4cccd488ecb06f1
4
- data.tar.gz: 64ee3c351a165a9ef8ac31ccf1a62a6671002af2b2ac670229f6a87e362a1b54
3
+ metadata.gz: 5fb093141cab1d43a626402ef2a6c426588588ae5f84e9597c6076ec9ffe86db
4
+ data.tar.gz: f478c25f69032b097076aa8c618bae1871864868014aebd169e8a590a2736086
5
5
  SHA512:
6
- metadata.gz: b22c85ab38c789d8848e1a881c18693eace8c03dd7c73c876b80f096218a790e711ba0d0990cfe16a0c27fef6c1eed023a65681f8133effc4fa73fe79cf4cdff
7
- data.tar.gz: 596fcd5a1f8f426c16ec21df7203947cc8bced15ff75642ece9e6a89ad3f7b10d1c475ae21ea835c6bae1ba194d6e111f00f049ac52974424484bfd9d1458618
6
+ metadata.gz: fdd0bc5121bbc5051639afd9c6ec8bf55dac910bafbc3c251a96c3d2c36abcfe10495cdd911142b950543418bed2e1b3f8ac179fa6c8a54b231e1b0e4e80f564
7
+ data.tar.gz: 1106e15ae5402297e490df385a0bfa3b3fa3c081c0f24744e9200961a32c4cd1813e199fc677f7f35f9fb37cb1ce72f5d4b165859e7e3e099e98ee0b35441613
@@ -21,6 +21,8 @@ module CloudFormationWrapper
21
21
 
22
22
  cf_client = verified_options[:client] || Aws::CloudFormation::Client.new(credentials: credentials, region: region)
23
23
 
24
+ ensure_template_file_exists(verified_options[:template_path], cf_client)
25
+
24
26
  deploy_stack(
25
27
  verified_options[:parameters],
26
28
  verified_options[:name],
@@ -55,6 +57,12 @@ module CloudFormationWrapper
55
57
  raise ArgumentError, 'name must be provided (String)'
56
58
  end
57
59
 
60
+ def ensure_template_file_exists(template_path, cf_client)
61
+ raise ArgumentError, 'CF Template File does not exist.' unless File.file?(template_path)
62
+ cf_client.validate_template(template_body: File.read(template_path))
63
+ puts 'Valid Template File.'
64
+ end
65
+
58
66
  def deploy_stack(parameters, stack_name, template_path, cf_client, _wait)
59
67
  template_parameters = construct_template_parameters(parameters)
60
68
  client_token = ENV.fetch('BUILD_NUMBER', SecureRandom.uuid.delete('-'))
@@ -235,8 +243,8 @@ module CloudFormationWrapper
235
243
  puts ' '
236
244
  puts "#{'Output Name'.ljust(output_name_width)} " \
237
245
  "#{'Value'.ljust(output_value_width)} "
238
- puts "#{'-',center(output_name_width, '-')} #{'-'.center(output_value_width, '-')}"
239
-
246
+ puts "#{'-'.center(output_name_width, '-')} #{'-'.center(output_value_width, '-')}"
247
+
240
248
  stack.outputs.each do |output|
241
249
  outputs[output.output_key.to_sym] = output.output_value
242
250
  puts "#{output.output_key.ljust(output_name_width)} #{output.output_value.ljust(output_value_width)}"
@@ -1,4 +1,4 @@
1
1
  module CloudFormationWrapper
2
2
  # @!visibility private
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ted Armstrong