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 +4 -4
- data/lib/cloudformation_wrapper/stack_manager.rb +10 -2
- data/lib/cloudformation_wrapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fb093141cab1d43a626402ef2a6c426588588ae5f84e9597c6076ec9ffe86db
|
4
|
+
data.tar.gz: f478c25f69032b097076aa8c618bae1871864868014aebd169e8a590a2736086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "#{'-'
|
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)}"
|