cloudformation-tool 0.4.3 → 0.5.0

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
  SHA1:
3
- metadata.gz: 89f6e35519b2dc452816d1de7d739239a0ff82b1
4
- data.tar.gz: fe7eef6f7d6f6b0d7e94fe7bbf2a3da4536b003e
3
+ metadata.gz: d9ce0c9c77f57cba29398cb97737457895e0cc14
4
+ data.tar.gz: 0a7e29cafeac6b00dd9643d1775f330b829ac8c1
5
5
  SHA512:
6
- metadata.gz: 70745be5ac9ef3596e51faa8e5a87f9531ad2614bf1e232a23435077389e553b52f358ded04e9c5a8789d1f560f553560f861b638ebc91f6751abbfdd3a5d875
7
- data.tar.gz: 8b5afc00c304caeb8351abb8a2bb632697c9d2be495f76c1c7b13c540cfa0d9fb8732a05d0061b99598b2ac7a47f88b7f3ec1fcc798a72df00a2b636d21e99a5
6
+ metadata.gz: 4bd7cce116c116f4a63fb62591b0473c5dba3475be4895eafee62eb05c177652463e7fed2531b13fff82520d35b6be8c0cff14df47da2b16477146f419932384
7
+ data.tar.gz: e46a024b20d5d9cd93a69c2cb628a499e508b882e589dd12d9368cbbe933948b5d51cf29b744fbc911ae7d710ccc151605244f481eeeabb4c7a70194f10d07c5
data/README.md CHANGED
@@ -204,11 +204,12 @@ The following commands are supported:
204
204
  their default values.
205
205
  - `compile` - Compile a CloudFormation template set (including all caching needed) and
206
206
  output the resulting valid CloudFormation template to the console.
207
- - `create` - Create or update a CloudFormation stack by compiling the specified template
207
+ - `create` - Create or update a CloudFormation stack by compiling the specified template
208
208
  set and uploading it to CloudFormation. If no stack with the specified name exists, then
209
209
  a new stack will be created, otherwise the existing stack will be updated. After sending the
210
210
  template to CloudFormation, the tool will immediately start `monitor` mode until the
211
- operation has completed successfully or with an error.
211
+ operation has completed successfully or with an error. Parameters can be specified on the
212
+ command line - like for the AWS CLI - or loaded from a file or URL.
212
213
  - `monitor` - Track and display ongoing events for the named stack.
213
214
  - `status` - Check if the names stack exists or not
214
215
  - `delete` - Delete the specified stack. After issuing the delete command, the tool will
@@ -1,3 +1,6 @@
1
+ require 'uri'
2
+ require 'net/http'
3
+
1
4
  module CloudFormationTool
2
5
  module CLI
3
6
  class Create < Clamp::Command
@@ -10,15 +13,25 @@ module CloudFormationTool
10
13
  "Use multiple times to set multiple parameters.",
11
14
  "See 'parameters' command to list the paramaters supported by the tempalte."
12
15
  ].join("\n"), multivalued: true
13
- option [ "-i", "--import" ], "FILE", "Import parameters from YAML file.", :attribute_name => :param_file
16
+ option [ "-i", "--import" ], "FILE", "Import parameters from YAML file or HTTP URL.", :attribute_name => :param_file
14
17
  option [ "-k", "--import-key" ], "KEY", [
15
18
  "When loading parameters from a YAML file, use the specified key to load a named",
16
19
  "map from the file, instead of using just the file itself as the parameter map"
17
20
  ].join("\n"), :attribute_name => :param_key
18
21
 
22
+ def read_param_file(file)
23
+ param_uri = URI(file)
24
+ case param_uri.scheme
25
+ when /^http/
26
+ Net::HTTP.get(param_uri)
27
+ else
28
+ File.read(file)
29
+ end
30
+ end
31
+
19
32
  def get_params
20
33
  params = if param_file
21
- yaml = YAML.load(File.read(param_file)).to_h
34
+ yaml = YAML.load(read_param_file param_file).to_h
22
35
  if param_key
23
36
  raise "Missing parameter section '#{param_key}' in '#{param_file}'!" unless yaml[param_key].is_a? Hash
24
37
  yaml[param_key]
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '0.4.3'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel