cloudformation-ruby-dsl 1.4.0 → 1.4.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/README.md +14 -0
- data/lib/cloudformation-ruby-dsl/cfntemplate.rb +47 -0
- data/lib/cloudformation-ruby-dsl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 689a6e23672cf1be2ca2acaad415484f9c79fab5
|
4
|
+
data.tar.gz: 280c4250cb0a541faaac7c7ced39a67fcdac6474
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e1e94afbaf7fdcd320c748fc91de02b8cbaedf974dd66ee4f8d0d30d255c749892d1af1c188c3e73f8c9f54cc2c32ee3811d4f46590c4c8224f4dd74ce5fed
|
7
|
+
data.tar.gz: 92ed9f50c46fbc82cd01aef262dc330fa6914bcd93df806bdfe5b927db4a3ea76cd09ae4c9b57d165ef8b0e359e9ea69dcd2845e499e7f8ab3b39ce9bd30e530
|
data/README.md
CHANGED
@@ -57,6 +57,20 @@ Make the resulting file executable (`chmod +x [NEW_NAME.rb]`). It can respond to
|
|
57
57
|
- `describe-resource`: given two arguments: stack-name and logical-resource-id, get output from a stack concerning the specific resource (takes optional `--nopretty` to minimize output)
|
58
58
|
- `get-template`: get entire template output of an existing stack
|
59
59
|
|
60
|
+
Command line options similar to cloudformation commands, but parsed by the dsl.
|
61
|
+
- `--profile`
|
62
|
+
- `--stack-name`
|
63
|
+
- `--region`
|
64
|
+
- `--parameters`
|
65
|
+
- `--tag `
|
66
|
+
|
67
|
+
Any other parameters are passed directly onto cloudformation. (--disable-rollback for instance)
|
68
|
+
|
69
|
+
Using the ruby scripts:
|
70
|
+
```
|
71
|
+
template.rb create --stack-name my_stack --parameters "BucketName=bucket-s3-static;SnsQueue=mysnsqueue"
|
72
|
+
```
|
73
|
+
|
60
74
|
Below are the various functions currently available in the DSL. See [the example script](examples/cloudformation-ruby-script.rb) for more usage information.
|
61
75
|
|
62
76
|
### DSL Statements
|
@@ -109,6 +109,7 @@ end
|
|
109
109
|
|
110
110
|
def validate_action(action)
|
111
111
|
valid = %w[
|
112
|
+
help
|
112
113
|
expand
|
113
114
|
diff
|
114
115
|
validate
|
@@ -188,6 +189,52 @@ def cfn(template)
|
|
188
189
|
end
|
189
190
|
|
190
191
|
case action
|
192
|
+
when 'help'
|
193
|
+
begin
|
194
|
+
# Give some basic usage.
|
195
|
+
help_string=%q(
|
196
|
+
## Usage
|
197
|
+
|
198
|
+
To convert existing JSON templates to use the DSL, run
|
199
|
+
|
200
|
+
cfntemplate-to-ruby [EXISTING_CFN] > [NEW_NAME.rb]
|
201
|
+
|
202
|
+
You may need to preface this with `bundle exec` if you installed via Bundler.
|
203
|
+
|
204
|
+
Make the resulting file executable (`chmod +x [NEW_NAME.rb]`). It can respond to the following subcommands (which are listed if you run without parameters):
|
205
|
+
- `expand`: output the JSON template to the command line (takes optional `--nopretty` to minimize the output)
|
206
|
+
- `diff`: compare an existing stack with your template. Produces following exit codes:
|
207
|
+
```
|
208
|
+
0 - no differences, nothing to update
|
209
|
+
1 - stack does not exist, template Validation error
|
210
|
+
2 - there are differences between an existing stack and your template
|
211
|
+
```
|
212
|
+
- `validate`: run validation against the stack definition
|
213
|
+
- `create`: create a new stack from the output
|
214
|
+
- `update`: update an existing stack from the output. Produces following exit codes:
|
215
|
+
```
|
216
|
+
0 - update finished successfully
|
217
|
+
1 - no updates to perform, stack doesn't exist, unable to update immutable parameter or tag, AWS ServiceError exception
|
218
|
+
```
|
219
|
+
- `cancel-update`: cancel updating a stack
|
220
|
+
- `delete`: delete a stack (with prompt)
|
221
|
+
- `describe`: get output of an existing stack and output it (takes optional `--nopretty` to minimize output)
|
222
|
+
- `describe-resource`: given two arguments: stack-name and logical-resource-id, get output from a stack concerning the specific resource (takes optional `--nopretty` to minimize output)
|
223
|
+
- `get-template`: get entire template output of an existing stack
|
224
|
+
|
225
|
+
Command line options similar to cloudformation commands, but parsed by the dsl.
|
226
|
+
--profile --stack-name --region --parameters --tag
|
227
|
+
|
228
|
+
Any other parameters are passed directly onto cloudformation. (--disable-rollback for instance)
|
229
|
+
|
230
|
+
Using the ruby scripts:
|
231
|
+
template.rb create --stack-name my_stack --parameters "BucketName=bucket-s3-static;SnsQueue=mysnsqueue"
|
232
|
+
|
233
|
+
)
|
234
|
+
puts help_string
|
235
|
+
exit(true)
|
236
|
+
end
|
237
|
+
|
191
238
|
when 'expand'
|
192
239
|
# Write the pretty-printed JSON template to stdout and exit. [--nopretty] option writes output with minimal whitespace
|
193
240
|
# example: <template.rb> expand --parameters "Env=prod" --region eu-west-1 --nopretty
|