-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yaml
831 lines (753 loc) · 30.6 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
---
cog_bundle_version: 4
name: cfn
description: AWS CloudFormation
version: 0.5.13
docker:
image: cogcmd/aws-cfn
tag: 0.5.13
author: Operable <[email protected]>
homepage: https://github.com/cogcmd/aws-cfn
long_description: |
This bundle provides an opinionated interface to CloudFormation's raw capabilities, not just to make it easier to use but, easier to use well. Commands to perform all basic CloudFormation actions, such as creating and listing stacks, are available, as you would expect. But, we've also built a set of commands for managing a new concept, stack definitions.
Stack definitions are a layer on top of CloudFormation templates aimed at making them more reusable and easier to work with as a team. They're comprised of a defaults file, which is a named set of CloudFormation parameters and tags, a named CloudFormation template, and a set of overrides. All of these layers are merged together to make up all the inputs required to create a stack.
Because most engineering and operations teams require a canonical version of their infrastructure definitions to be stored in a VCS repository, templates, defaults files, and stack definitions will be stored in a git repository. Doing so supports several common use cases such as debugging and auditing.
Putting this all together results in a reusable, repeatable workflow that can easily be executed from chat, while still allowing basic CloudFormation actions when necessary.
config:
notes: |
This bundle requires access to an Amazon Web Services account and a Git repository. Detailed instructions for configuring this access are
available in the README in the GitHub repository located at the URL specified in the **Homepage** section below.
env:
- var: AWS_ACCESS_KEY_ID
description: ID of the access key used to authenticate with the AWS API. Required if IAM instance metadata not used.
- var: AWS_SECRET_ACCESS_KEY
description: Secret of the access key used to authenticate with the AWS API. Required if IAM instance metadata not used.
- var: AWS_REGION
description: Optional region used for all commands
- var: AWS_STS_ROLE_ARN
description: Optional STS role ARN of which to assume when making requests to the AWS API.
- var: S3_STACK_DEFINITON_BUCKET
description: Required bucket name where created definitions will be written and read from when used to create stacks.
- var: S3_STACK_DEFINITON_PREFIX
description: Optional bucket key prefix to use when storing definitions in a shared bucket.
- var: GIT_REMOTE_URL
description: Url of git repository used to read and write defaults files, templates, and definitions.
- var: GIT_SSH_KEY
description: SSH key used to authenticate with the above git repository. Must have read and write access.
commands:
template-show:
executable: "/home/bundle/cog-command"
description: Shows contents of a template.
long_description: Templates can either be shown by passing the name of the template or the full url if the `--s3` option is specified. When showing a template by name, the relative path without the file extension is used. Only json, yml, and yaml extensions are supported.
examples: |
Showing a template by name:
template show webapp
Showing a template in a subdirectory:
template show apps/warehouse/web
Show a template on a branch by name:
template show -b staging webapp
Showing a template by S3 url:
template show --s3 https://s3.amazonaws.com/bucket/prefix/definitions/webapp/127471284811/template.yml
arguments: "<name>"
options:
s3:
type: bool
required: false
description: Show template from an S3 URL instead of Git. <name> should be the URL.
branch:
type: string
required: false
short_flag: b
description: Branch in which to find the template. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag in which to find the template.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA in which to find the template.
rules:
- must have cfn:template-show
template-list:
executable: "/home/bundle/cog-command"
description: Lists all templates, filtered by an optional glob pattern.
long_description: |-
The names, the relative path without the file extension of all templates in all subdirectories are listed. Only json, yml, and yaml extensions are supported.
When filtering the list with a pattern, only simple patterns similar to a shell glob are accepted.
`*` - Matches any string of characters
`**` - Matches any path
`?` - Matches any one character
`[set]` - Matches any one character in the set
`{p,q}` - Matches either literal p or q
`\` - Escapes the next pattern character
examples: |
Listing all templates:
template list
Listing all templates in a subdirectory that start with "webapp":
template list "apps/warehouse/webapp*"
arguments: "[pattern]"
options:
branch:
type: string
required: false
short_flag: b
description: Branch from which to list templates. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag from which to list templates.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA from which to list templates.
rules:
- allow
stack-create:
executable: "/home/bundle/cog-command"
description: Creates a new stack based on an existing template and returns the newly created stack.
long_description: Although this command can be used on it's own to fully define and create a stack with a template url just as you would with the AWS CLI tool, it is entended to be used with a stack definition. This can be accomplished by first creating a stack definition (see `definition-create`) and then either defining that definition by name with the `--definition` option, or by piping that definition to the `stack-create` command and binding options and arguments to variables.
examples: |
Creating a stack from a definition with a single parameter:
stack create webapp3 -d webapp -p "SshKey=web-team"
Creating a stack with a definition in a pipeline:
definition show webapp3 | stack create $name $template_url -p $params -t $tags -p "SshKey=web-team"
Creating a stack without a definition:
stack create webapp3 https://s3.amazonaws.com/bucket/webapp3.yml -p "SshKey=web-team" -p "Port=8080" -t "Name=webapp3"
arguments: "<stack-name> <template-url> | [<stack-name>] --definition <definition-name>"
options:
definition:
type: string
required: false
short_flag: d
description: Name of a definition to use as default values for stack creation.
branch:
type: string
required: false
short_flag: b
description: Branch from which to read definitions. Defaults to master.
tag:
type: list
required: false
short_flag: t
description: Key-value pairs to associate with this stack. Can be specified multiple times.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA from which to read definitions.
param:
type: list
required: false
short_flag: p
description: Key-value pairs specified as 'key=value', that specify input parameters for your stack. Can be specified multiple times.
policy:
type: string
required: false
short_flag: o
description: Stack policy name.
notify:
type: list
required: false
short_flag: n
description: The Simple Notification Service (SNS) topic ARNs to publish stack related events. Can be specified multiple times.
on-failure:
type: string
required: false
short_flag: f
description: 'Determines what action will be taken if stack creation fails. Can be one of: rollback, delete or keep.'
timeout:
type: int
required: false
short_flag: e
description: The amount of time, specified in minutes, that can pass before the stack status becomes CREATE_FAILED.
capabilities:
type: list
required: false
short_flag: c
description: 'Can be one of: iam or named_iam.'
verbose:
type: bool
required: false
short_flag: v
description: Display verbose stack details, including parameters and outputs.
rules:
- must have cfn:stack
stack-delete:
executable: "/home/bundle/cog-command"
description: Deletes a stack.
arguments: "<stack-name>"
rules:
- must have cfn:stack
stack-events:
executable: "/home/bundle/cog-command"
description: Lists events for a stack. Returns all stack related events for a specified stack in reverse chronological order.
arguments: "<stack-name>"
options:
page:
type: int
required: false
short_flag: p
description: Events are paginated 10 per page. This option allows you to view a specific page.
rules:
- must have cfn:stack
stack-list:
executable: "/home/bundle/cog-command"
description: Lists stack summaries.
long_description: |-
Lists stack summaries.
The filter string can be one or more cloudformation stack status strings which include:
CREATE_IN_PROGRESS, CREATE_FAILED, CREATE_COMPLETE, ROLLBACK_IN_PROGRESS, ROLLBACK_FAILED, ROLLBACK_COMPLETE, DELETE_IN_PROGRESS, DELETE_FAILED, DELETE_COMPLETE, UPDATE_IN_PROGRESS, UPDATE_COMPLETE_CLEANUP_IN_PROGRESS, UPDATE_COMPLETE, UPDATE_ROLLBACK_IN_PROGRESS, UPDATE_ROLLBACK_FAILED, UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS, UPDATE_ROLLBACK_COMPLETE
Additionally a few special filter strings that correspond to a subset of the standard filter strings may be used:
ACTIVE, COMPLETE, FAILED, DELETED, IN_PROGRESS
examples: |
Listing all stacks:
stack list
Listing all stacks that have failed:
stack list -f FAILED
options:
filter:
type: list
required: false
short_flag: f
description: Filter results based on a filter string. Acceptable filter strings are listed in the description. Can be specified more than once. Defaults to 'ACTIVE'.
rules:
- must have cfn:stack
stack-resources:
executable: "/home/bundle/cog-command"
description: Lists stack resources.
arguments: "<stack-name>"
options:
page:
type: int
required: false
short_flag: p
description: Resources are paginated 10 per page. This option allows you to view a specific page.
rules:
- must have cfn:stack
stack-show:
executable: "/home/bundle/cog-command"
description: Shows details for a stack.
arguments: "<stack-name>"
options:
verbose:
type: bool
required: false
short_flag: v
description: Display verbose stack details, including parameters and outputs.
rules:
- must have cfn:stack
changeset-create:
executable: "/home/bundle/cog-command"
description: Creates a changeset for a stack.
arguments: "<stack-name>"
options:
definition:
type: string
required: false
short_flag: d
description: Name of a definition to use as default values for updating the stack.
branch:
type: string
required: false
short_flag: b
description: Branch from which to read definitions. Defaults to master.
tag:
type: list
required: false
short_flag: t
description: Key-value pairs, specified as 'key=value', to associate with this stack.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA from which to read definitions.
template_url:
type: string
required: false
short_flag: T
description: URL for updated CloudFormation template.
param:
type: list
required: false
short_flag: p
description: Parameter, specified as 'key=value', that specify input parameters for the change set. Can be specified multiple times.
notify:
type: list
required: false
short_flag: n
description: The Amazon Resource Names (ARNs) of Amazon Simple Notification Service (Amazon SNS) topics that AWS CloudFormation associates with the stack.
capabilities:
type: list
required: false
short_flag: c
description: 'Can be one of: iam or named_iam.'
description:
type: string
required: false
short_flag: D
description: 'A description to help you identify this change set. '
changeset-name:
type: string
required: false
description: The name of your changeset. Defaults to 'changeset<num>'
rules:
- must have cfn:changeset
changeset-list:
executable: "/home/bundle/cog-command"
description: Lists cloudformation changesets.
arguments: "<stack-name>"
rules:
- must have cfn:changeset
changeset-delete:
executable: "/home/bundle/cog-command"
description: Deletes cloudformation changesets.
arguments: "<changeset-name> <stack-name>"
rules:
- must have cfn:changeset
changeset-show:
executable: "/home/bundle/cog-command"
description: Shows a cloudformation changeset.
arguments: "<changeset-name> <stack-name>"
rules:
- must have cfn:changeset
changeset-apply:
executable: "/home/bundle/cog-command"
description: Applies a cloudformation changeset.
arguments: "<changeset-name> <stack-name>"
rules:
- must have cfn:changeset
definition-create:
executable: "/home/bundle/cog-command"
description: Creates a stack definition.
long_description: Definitions are defined with a name, a template, a set of defaults files, and a set of overrides (tags and parameters). These layers are then all merged together in the above order and stored in the defined git repository for use with the `stack-create` command.
examples: |
Creating a simple definition without overrides:
definition create webapp-prod webapp
Creating a definition with a few overrides:
definition create webapp-staging webapp -p "Port=8080" -p "InstanceType=t2.medium" -t "Env=staging"
arguments: "<definition-name> <template-name>"
options:
defaults:
type: list
required: false
short_flag: d
description: List of defaults files to use. Defaults are merged together in the order they were specified.
params:
type: list
required: false
short_flag: p
description: Stack parameters which override parameters defined in any defaults files specified. These should be provided as `<key>=<value>` strings.
tags:
type: list
required: false
short_flag: t
description: Stack tags which override tags defined in any defaults files specified. These should be provided as `<key>=<value>` strings.
branch:
type: string
required: false
short_flag: b
description: Branch from which to find defaults files. Defaults to master.
rules:
- must have cfn:definition-create
definition-list:
executable: "/home/bundle/cog-command"
description: Lists all definitions, filtered by an optional glob pattern.
long_description: |
The names of each definition are listed.
When filtering the list with a pattern, only simple patterns similar to a shell glob are accepted.
`*` - Matches any string of characters
`?` - Matches any one character
`[set]` - Matches any one character in the set
`{p,q}` - Matches either literal p or q
`\` - Escapes the next pattern character
examples: |
Listing all definitions:
definition list
Listing all definitions that start with "webapp":
definition list "webapp*"
arguments: "[pattern]"
options:
branch:
type: string
required: false
short_flag: b
description: Branch from which to list definitions. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag from which to list definitions.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA from which to list definitions.
rules:
- allow
definition-show:
executable: "/home/bundle/cog-command"
description: Shows contents of a definition.
long_description: The most recently created stack definition with the name specified is found and returned as json. Keys `params` and `tags` are formatted to be used in a pipeline. See examples for usage.
examples: |
Show a definition:
definition show webapp
Show a definition and use it in a pipeline with `stack-create`:
definition show webapp3 | stack create $name $template_url -p $params -t $tags -p "SshKey=web-team"
arguments: "<name>"
options:
branch:
type: string
required: false
short_flag: b
description: Branch in which to find the definition. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag in which to find the definition.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA in which to find the definition.
rules:
- must have cfn:definition-show
defaults-create:
executable: "/home/bundle/cog-command"
description: Creates a new defaults file.
long_description: Defaults are named sets of parameters and tags applied to templates when creating a stack. Creating a few defaults file stores the parameters and tags provided as previous command input as JSON in the specified git repository. When specifying params and tags from the previous command and via options, options are merged on top of the previous command output, overriding them.
examples: |
Create a defaults file with parameters and tags:
defaults create staging -p "Port=80" -t "Env=staging"
Create a defaults file from a previous command's output:
seed '{ "params": { "Port": "80" }, "tags": { "Env": "staging" } }' | defaults create staging
arguments: "<name>"
options:
params:
type: list
required: false
short_flag: p
description: Parameters to include in the defaults file. These should be provided as `<key>=<value>` strings.
tags:
type: list
required: false
short_flag: t
description: Tags to include in the defaults file. These should be provided as `<key>=<value>` strings.
branch:
type: string
required: false
short_flag: b
description: Branch of which to commit the new defaults file. Defaults to master.
rules:
- must have cfn:defaults-create
defaults-list:
executable: "/home/bundle/cog-command"
description: Lists all defaults files, filtered by an optional glob pattern.
long_description: |
The names of each defaults file are listed.
When filtering the list with a pattern, only simple patterns similar to a shell glob are accepted.
`*` - Matches any string of characters
`?` - Matches any one character
`[set]` - Matches any one character in the set
`{p,q}` - Matches either literal p or q
`\` - Escapes the next pattern character
examples: |
Listing all defaults files:
defaults list
Listing all defaults files that start with "webapp":
defaults list "webapp*"
arguments: "[pattern]"
options:
branch:
type: string
required: false
short_flag: b
description: Branch from which to list defaults files. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag from which to list defaults files.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA from which to list defaults files.
rules:
- allow
defaults-show:
executable: "/home/bundle/cog-command"
description: Shows contents of a defaults file.
long_description: The name and the parsed JSON data are returned for use in other pipelines or for viewing in chat.
examples: |
Show a defaults file:
defaults show staging
arguments: "<name>"
options:
branch:
type: string
required: false
short_flag: b
description: Branch in which to find the defaults file. Defaults to master.
tag:
type: string
required: false
short_flag: t
description: Tag in which to find the defaults file.
sha:
type: string
required: false
short_flag: s
description: Git commit SHA in which to find the defaults file.
rules:
- must have cfn:defaults-show
check-setup:
executable: "/home/bundle/cog-command"
description: Checks that all configuration is set correctly
long_description: This command is meant to be a sanity check for users once they have installed and configured the bundle. It will inspect provided environment variables and try to make sure that the accounts used have all the necessary permissions.
rules:
- allow
permissions:
- cfn:stack
- cfn:changeset
- cfn:template-show
- cfn:defaults-create
- cfn:defaults-show
- cfn:definition-create
- cfn:definition-show
templates:
template_list:
body: |
**CloudFormation Templates:**
~each var=$results as=template~
* ~$template.name~
~end~
template_show:
body: |
**Template:** ~$results[0].name~
**Description:** ~$results[0].description~
~if cond=$results[0].capabilities bound?~**Capabilities:** ~$results[0].capabilities[0]~~end~
**Parameters:**
~each var=$results[0].parameters~
* ~$item.parameter_key~ (~$item.parameter_type~) ~if cond=$item.default_value != ""~[~$item.default_value~]~end~
~end~
stack_show:
body: |
**Stack:** ~$results[0].stack_name~
**Description:** ~$results[0].description~
**Stack Status:** ~$results[0].stack_status~
~if cond=$results[0].last_updated_time not_empty?~**Last Update:** ~$results[0].last_updated_time~~end~
**Tags:**
~if cond=$results[0].tags empty?~None~end~
~each var=$results[0].tags as=item~
* ~$item.key~=~$item.value~
~end~
stack_event_list:
body: |
**Stack Events:** ~$results[0].meta.stack_name~
**Result Page:** ~$results[0].meta.page~
~each var=$results as=event~
**~$event.timestamp~**
- ~$event.logical_resource_id~ (~$event.resource_type~)
- ~$event.resource_status~~if cond=$event.resource_status_reason not_empty?~: ~$event.resource_status_reason~~end~
~end~
stack_list:
body: |
**CloudFormation Stacks:**
| Name | Status | Description |
|------|--------|-------------|
~each var=$results as=stack~
| ~$stack.stack_name~ | ~$stack.stack_status~ | ~$stack.template_description~ |
~end~
stack_resource_list:
body: |
**Stack Resources:** ~$results[0].meta.stack_name~
**Page:** ~$results[0].meta.page~
| Name | Status | Resource |
|------|--------|----------|
~each var=$results as=resource~
| ~$resource.logical_resource_id~ | ~$resource.resource_status~ | ~$resource.resource_type~ |
| | | ~$resource.physical_resource_id~ |
~end~
changeset_list:
body: |
**Changesets:** ~$results[0].stack_name~
~each var=$results as=changeset~
* **~$changeset.change_set_name~:** ~$changeset.execution_status~ / ~$changeset.status~
~if cond=$changeset.description not_empty?~
~$changeset.description~
~end~~end~
changeset_show:
body: |
~each var=$results as=changeset~
**Changeset:** ~$changeset.change_set_name~
**Stack:** ~$changeset.stack_name~
~if cond=$changeset.description not_empty?~**Description:** ~$changeset.description~~br~~end~~if cond=$changeset.capabilities not_empty?~**Capabilities:** ~$changeset.capabilities[0]~~br~~end~**Status:** ~$changeset.status~
**Timestamp:** ~$changeset.creation_time~
**Parameters:**
~each var=$changeset.parameters as=param~
~if cond=$param.parameter_value != ""~* ~$param.parameter_key~=~$param.parameter_value~~end~
~end~
**Changes:**
~if cond=$changeset.status != "CREATE_COMPLETE"~
Changeset still creating. Check back for detailed changes.
~end~
~if cond=$changeset.status == "CREATE_COMPLETE"~
~each var=$changeset.changes as=change~
* ~$change.resource_change.logical_resource_id~ (~$change.resource_change.action~) ~if cond=$change.resource_change.replacement == "True"~_Replace_~end~
~end~
~end~
~if cond=$changeset.tags not_empty?~
**Tags:**
~each var=$changeset.tags as=tag~
* ~$tag.key~=~$tag.value~
~end~
~end~
To apply this changeset, run:
```
cfn:changeset-apply ~$changeset.change_set_name~ ~$changeset.stack_name~
```
~end~
changeset_delete:
body: |
~each var=$results as=changeset~
Successfully deleted changeset ~$changeset.changeset_name~ for stack ~$changeset.stack_name~.
~end~
defaults_create:
body: |
~each var=$results as=defaults~
Created defaults file ~$defaults.name~
~end~
defaults_list:
body: |
**CloudFormation Defaults:**
~each var=$results~
* ~$item.name~
~end~
defaults_show:
body: |
**Defaults:** ~$results[0].meta.name~
**Params:**
~if cond=$results[0].param_list empty?~None~end~
~each var=$results[0].param_list~
* ~$item~
~end~
**Tags:**
~if cond=$results[0].tag_list empty?~None~end~
~each var=$results[0].tag_list~
* ~$item~
~end~
definition_create:
body: |
~each var=$results as=definition~
Created definition ~$definition.name~
~end~
definition_list:
body: |
**CloudFormation Definitions:**
| Name | Template | Defaults |
|------|----------|----------|
~each var=$results~
| ~$item.name~ | ~$item.data.template.name~ | ~each var=$item.data.defaults as=defaults~~$defaults.name~ ~end~ |
~end~
check_setup:
body: |
~each var=$results as=setup~
| Check | Success |
| ----- | ------- |
| Authentication with git server | ~if cond=$setup.git_auth == 1~yes~end~~if cond=$setup.git_auth == 0~no~end~ |
| Git repository exists | ~if cond=$setup.git_repo_exists == 1~yes~end~~if cond=$setup.git_repo_exists == 0~no~end~ |
| Git repository structured correctly | ~if cond=$setup.git_repo_structure == 1~yes~end~~if cond=$setup.git_repo_structure == 0~no~end~ |
| Authentication with Amazon Web Services | ~if cond=$setup.aws_auth == 1~yes~end~~if cond=$setup.aws_auth == 0~no~end~ |
| Cloudformation permissions | ~if cond=$setup.aws_cfn_permissions == 1~yes~end~~if cond=$setup.aws_cfn_permissions == 0~no~end~ |
| S3 permissions | ~if cond=$setup.aws_s3_permissions == 1~yes~end~~if cond=$setup.aws_s3_permissions== 0~no~end~ |
| S3 bucket exists | ~if cond=$setup.aws_s3_bucket == 1~yes~end~~if cond=$setup.aws_s3_bucket == 0~no~end~ |
~end~
template_body:
body: "~json var=$results[0]~\n"
definition_show:
body: |
**Definition:** ~$results[0].name~
**Template:** ~$results[0].template.name~
~if cond=$results[0].timestamp not_empty?~**Timestamp:** ~$results[0].timestamp~~end~
# ----------------------------------------------------------------------------
# Parameters
# ----------------------------------------------------------------------------
~if cond=$results[0].params not_empty?~
**Parameters:**
~each var=$results[0].params~
* ~$item~
~end~
~end~
# ----------------------------------------------------------------------------
# Tags
# ----------------------------------------------------------------------------
~if cond=$results[0].tags not_empty?~
**Tags:**
~each var=$results[0].tags~
* ~$item~
~end~
~end~
# ----------------------------------------------------------------------------
# Defaults
# ----------------------------------------------------------------------------
~if cond=$results[0].defaults not_empty?~
**Defaults:**
~each var=$results[0].defaults~
* ~$item.name~
~end~
~end~
# ----------------------------------------------------------------------------
# Override Params
# ----------------------------------------------------------------------------
~if cond=$results[0].overrides.params not_empty?~
**Override Params:**
~each var=$results[0].overrides.params~
* ~$item~
~end~
~end~
# ----------------------------------------------------------------------------
# Override Tags
# ----------------------------------------------------------------------------
~if cond=$results[0].overrides.tags not_empty?~
**Override Tags:**
~each var=$results[0].overrides.tags~
* ~$item~
~end~
~end~
# ----------------------------------------------------------------------------
error_stack_capability:
body: 'Insufficient capabilities to create stack ~$results[0].name~. Add `-c ~$results[0].capability~` to your stack-create options to proceed.
'
stack_delete:
body: |
**Stack:** ~$results[0].stack_name~
**Status:** ~$results[0].stack_status~
changeset_missing_stack_name:
body: 'Error: Unable to list stacks.'
stack_show_verbose:
body: |
**Stack:** ~$results[0].stack_name~
**Description:** ~$results[0].description~
**Stack Status:** ~$results[0].stack_status~
~if cond=$results[0].last_updated_time not_empty?~**Last Update:** ~$results[0].last_updated_time~~end~
**Parameters:**
~if cond=$results[0].parameters empty?~None~end~
~each var=$results[0].parameters~
* ~$item.parameter_key~=~$item.parameter_value~
~end~
**Outputs:**
~if cond=$results[0].outputs empty?~None~end~
~each var=$results[0].outputs as=item~
* ~$item.output_key~=~$item.output_value~
~end~
**Tags:**
~if cond=$results[0].tags empty?~None~end~
~each var=$results[0].tags as=item~
* ~$item.key~=~$item.value~
~end~