aws-must 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -20
- data/demo/0/root.mustache +13 -1
- data/demo/2/conf.yaml +1 -5
- data/demo/{8 → 2}/resources.mustache +6 -15
- data/demo/2/root.mustache +13 -54
- data/demo/2.old/conf.yaml +5 -0
- data/demo/2.old/root.mustache +85 -0
- data/demo/3/conf.yaml +18 -2
- data/demo/3/resource.mustache +27 -0
- data/demo/3/resourceInstance.mustache +32 -0
- data/demo/3/resources.mustache +9 -8
- data/demo/3/root.mustache +17 -17
- data/demo/4/conf.yaml +19 -14
- data/demo/{8 → 4}/output.mustache +1 -2
- data/demo/4/resource.mustache +1 -1
- data/demo/4/resourceInstance.mustache +10 -5
- data/demo/4/resourceSecurityGroup.mustache +37 -0
- data/demo/4/root.mustache +16 -9
- data/demo/5/conf.yaml +3 -4
- data/demo/{8 → 5}/mappings.mustache +0 -0
- data/demo/5/output.mustache +2 -1
- data/demo/5/resource.mustache +3 -0
- data/demo/5/resourceInstance.mustache +4 -4
- data/demo/5/resources.mustache +12 -2
- data/demo/5/root.mustache +42 -9
- data/demo/6/conf.yaml +27 -8
- data/demo/{8 → 6}/parameter.mustache +0 -0
- data/demo/6/resource.mustache +10 -1
- data/demo/6/resourceInstance.mustache +13 -3
- data/demo/{8 → 6}/resourceSecurityGroup.mustache +0 -0
- data/demo/6/root.mustache +48 -15
- data/demo/{8 → 6}/tag.mustache +0 -0
- data/demo/7/conf.yaml +8 -3
- data/demo/7/resourceInstance.mustache +5 -2
- data/demo/{8 → 7}/resourceInstanceChef.mustache +0 -0
- data/demo/7/root.mustache +11 -3
- data/lib/tasks/demo.rake +6 -7
- metadata +14 -13
- data/demo/8/conf.yaml +0 -61
- data/demo/8/resource.mustache +0 -38
- data/demo/8/resourceInstance.mustache +0 -50
- data/demo/8/root.mustache +0 -191
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8326b8dfa72e7fea5dc9d0b4f20d7f02e2071f50
|
4
|
+
data.tar.gz: 7c2ea2b9ad369395c758e60e1bd655e4c32225be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231f3f0d6c8ae16b2cbe73bdbc5a84004c167c2a622c2a69c65338502fc16311545108994c7bb69b8a78fc82c1b1eea538ed73ea56b2872f7b10fa68a1ffe22a
|
7
|
+
data.tar.gz: 5990bcc8e7bcd562356d4c99edce55530458086066cad26900c7e41c0c280cc17058c7ae72b19c89119aeae5e66df667dc6e4bf792ffd971b752d05191b94e9b
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# aws-must - Minimum Viable Solution to Manage CloudFormation Templates - $Release:0.0.
|
1
|
+
# aws-must - Minimum Viable Solution to Manage CloudFormation Templates - $Release:0.0.6$
|
2
2
|
|
3
3
|
`aws-must` is a tool, which allows separating infrastructure
|
4
4
|
configuration and Amazon related syntax in CloudFormation JSON
|
@@ -6,6 +6,13 @@ templates using [YAML](http://learnxinyminutes.com/docs/yaml) and
|
|
6
6
|
[Mustache templates](https://mustache.github.io/).
|
7
7
|
|
8
8
|
|
9
|
+
See blog posts
|
10
|
+
[1](https://jarjuk.wordpress.com/2015/06/15/love-aws-part1-5),
|
11
|
+
[2](https://jarjuk.wordpress.com/2015/06/15/love-aws-part2-2), and
|
12
|
+
[3](https://jarjuk.wordpress.com/2015/06/15/love-aws-part3-2/) for
|
13
|
+
background information on this tool.
|
14
|
+
|
15
|
+
|
9
16
|
## The Problem
|
10
17
|
|
11
18
|
[Amazon CloudFormation](http://aws.amazon.com/cloudformation/) gives
|
@@ -53,10 +60,10 @@ above. With the tool users may
|
|
53
60
|
3. use YAML anchors to express dependencies between infrastructure
|
54
61
|
elements.
|
55
62
|
|
56
|
-
4. add comments in YAML and Mustache templates. The tool supports
|
63
|
+
4. add comments in YAML and Mustache templates. The tool supports a
|
57
64
|
simple tag syntax (**++start++**
|
58
|
-
**++close++** -tags)
|
59
|
-
|
65
|
+
**++close++** -tags) allowing documentation to
|
66
|
+
be extracted directly from template files.
|
60
67
|
|
61
68
|
5. use Mustache partials to get rid of repeating similar sections in
|
62
69
|
JSON configuration.
|
@@ -66,8 +73,9 @@ above. With the tool users may
|
|
66
73
|
|
67
74
|
## Installation
|
68
75
|
|
69
|
-
Add following
|
76
|
+
Add following lines to `Gemfile`
|
70
77
|
|
78
|
+
source 'https://rubygems.org'
|
71
79
|
gem 'aws-must'
|
72
80
|
|
73
81
|
|
@@ -76,6 +84,8 @@ and run
|
|
76
84
|
bundle install
|
77
85
|
|
78
86
|
|
87
|
+
**Notice**: requires Ruby version ~> 2.0.
|
88
|
+
|
79
89
|
## Usage
|
80
90
|
|
81
91
|
### CLI Usage
|
@@ -134,8 +144,8 @@ run
|
|
134
144
|
**NOTICE:**: The [jq](http://stedolan.github.io/jq/) must be installed
|
135
145
|
for diff target to work.
|
136
146
|
|
137
|
-
To show html documentation extracted from demo case `i
|
138
|
-
|
147
|
+
To show html documentation extracted from demo case `i`, run rake task
|
148
|
+
`demo:html-i`. For example, for demo case `3` run
|
139
149
|
|
140
150
|
rake demo:html-3
|
141
151
|
|
@@ -148,13 +158,13 @@ line argument `browser`, e.g. `rake demo:html-3[chromium-browser]`.
|
|
148
158
|
|
149
159
|
#### Use Demo to Bootstrap Own Configuration
|
150
160
|
|
151
|
-
To create a copy of templates and YAML configuration for demo case
|
152
|
-
|
161
|
+
To create a copy of templates and YAML configuration for demo case `i`,
|
162
|
+
run rake task `demo:bootstrap-i`, and pass template and
|
153
163
|
configuration directories as command line arguments. For example, to
|
154
|
-
copy demo case `
|
164
|
+
copy demo case `4` templates to directory `tmp/tmpl`, and
|
155
165
|
configurations to directory `tmp/conf`, run
|
156
166
|
|
157
|
-
rake demo:bootstrap-
|
167
|
+
rake demo:bootstrap-4[tmp/tmpl,tmp/conf]
|
158
168
|
|
159
169
|
|
160
170
|
|
@@ -170,18 +180,17 @@ Prerequisites:
|
|
170
180
|
* [Install Amazon AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/installing.html)
|
171
181
|
* [Configure AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)
|
172
182
|
|
173
|
-
To list demo targets
|
183
|
+
To list demo targets provisioning Amazon run
|
174
184
|
|
175
185
|
rake -T demo:stack-create
|
176
186
|
|
177
|
-
**NOTICE**:
|
178
|
-
|
179
|
-
|
180
|
-
|
187
|
+
**NOTICE**: the region constraint in the output. Some of the templates
|
188
|
+
use fixed AMI configuration, which means that they work only if aws
|
189
|
+
-tool defines correct region (typically in set in `~/.aws/config`
|
190
|
+
file).
|
181
191
|
|
182
192
|
|
183
|
-
To create a `demo` stack for demo case `
|
184
|
-
run
|
193
|
+
To create a `demo` stack for demo case `7` run
|
185
194
|
|
186
195
|
rake demo:stack-create-7
|
187
196
|
|
@@ -193,8 +202,8 @@ To show status of `demo` stack run
|
|
193
202
|
|
194
203
|
rake demo:stack-status
|
195
204
|
|
196
|
-
EC2 instances created in demo cases `7,8,...` accept ssh
|
197
|
-
|
205
|
+
EC2 instances created in demo cases `7,8,...` accept ssh connections
|
206
|
+
via port 22.
|
198
207
|
|
199
208
|
Demo target `demo:stack-ssh` locates an ip address from a stack output
|
200
209
|
variable given as a parameter, and makes ssh connection to this ip
|
data/demo/0/root.mustache
CHANGED
@@ -1 +1,13 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"AWSTemplateFormatVersion" : "2010-09-09",
|
3
|
+
"Description" : "A simple Amazon EC2 instance. Initial copy",
|
4
|
+
"Resources" : {
|
5
|
+
"MyEC2Instance" : {
|
6
|
+
"Type" : "AWS::EC2::Instance",
|
7
|
+
"Properties" : {
|
8
|
+
"ImageId" : "ami-00dae61d",
|
9
|
+
"InstanceType" : "t2.micro"
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
data/demo/2/conf.yaml
CHANGED
@@ -1,28 +1,21 @@
|
|
1
1
|
{{!
|
2
2
|
|
3
|
+
resources.mustache - fixed resources
|
4
|
+
|
3
5
|
++start++
|
4
6
|
|
5
7
|
## <a id="resources.mustache"></a>resources.mustache <a class='navigator' href='#top'">[top]</a>
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
**Attributes**: context= `.`
|
10
|
-
|
11
|
-
* none
|
12
|
-
|
13
|
-
|
14
|
-
**Actions**:
|
15
|
-
|
16
|
-
* no action (i.e. empty template)
|
9
|
+
Create an EC2 with following fixed parameters
|
17
10
|
|
11
|
+
* `ImageId` : "ami-00dae61d",
|
12
|
+
* `InstanceType` : "t2.micro"
|
18
13
|
|
19
14
|
++close++
|
20
15
|
|
21
16
|
|
22
17
|
}}
|
23
|
-
{{!
|
24
18
|
|
25
|
-
Moved to YAML
|
26
19
|
|
27
20
|
"MyEC2Instance" : {
|
28
21
|
"Type" : "AWS::EC2::Instance",
|
@@ -30,6 +23,4 @@ Empty template.
|
|
30
23
|
"ImageId" : "ami-00dae61d",
|
31
24
|
"InstanceType" : "t2.micro"
|
32
25
|
}
|
33
|
-
}
|
34
|
-
|
35
|
-
}}
|
26
|
+
}
|
data/demo/2/root.mustache
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
{{!
|
2
2
|
|
3
|
-
++start++
|
4
3
|
|
4
|
+
==================================================================
|
5
|
+
STYLE section
|
6
|
+
==================================================================
|
7
|
+
|
8
|
+
++start++
|
5
9
|
<style>
|
6
10
|
h1 {
|
7
11
|
color:blue;
|
@@ -15,71 +19,26 @@ body {
|
|
15
19
|
background-color: #b0c4de;
|
16
20
|
}
|
17
21
|
</style>
|
22
|
+
++close++
|
23
|
+
}}
|
18
24
|
|
25
|
+
{{!
|
26
|
+
++start++
|
19
27
|
|
20
28
|
# <a id="top">aws-must demo 2 template</a>
|
21
29
|
|
22
|
-
|
23
|
-
|
24
|
-
Create an EC2 with following fixed parameters
|
25
|
-
|
26
|
-
* `ImageId` : "ami-00dae61d",
|
27
|
-
* `InstanceType` : "t2.micro"
|
28
|
-
|
29
|
-
Supports only region `eu-central-1`. No ssh connection allowed by
|
30
|
-
default.
|
31
|
-
|
32
|
-
**Parameters**:
|
33
|
-
|
34
|
-
* no parameters
|
35
|
-
|
36
|
-
|
37
|
-
## Document Content
|
38
|
-
|
39
|
-
This document is generated automically from `aws-must` -demo
|
40
|
-
templates.
|
41
|
-
|
42
|
-
|
43
|
-
Output contains markdown syntax between
|
44
|
-
**++start++** and
|
45
|
-
**++close++** -tags from the template files. For
|
46
|
-
each template, it
|
47
|
-
|
48
|
-
* gives a general description of the template
|
49
|
-
|
50
|
-
* documents the attribute context e.g. `.` or `./resources/Instance`,
|
51
|
-
and attributes references of the template
|
52
|
-
|
53
|
-
* lists template actions, i.e. output from template, or template
|
54
|
-
inclusion
|
55
|
-
|
56
|
-
|
57
|
-
## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
|
58
|
-
|
59
|
-
|
60
|
-
**Attributes**: context= `.`
|
61
|
-
|
62
|
-
* `description`: description for the CF template
|
63
|
-
|
64
|
-
**Actions**:
|
65
|
-
|
66
|
-
* **Description**: `description`
|
30
|
+
Create an EC2 with following fixed parnameters `ImageId`
|
31
|
+
("ami-00dae61d") and `InstanceType` ("t2.micro")
|
67
32
|
|
33
|
+
> resources
|
68
34
|
|
69
35
|
++close++
|
70
|
-
|
71
36
|
}}
|
72
37
|
|
73
38
|
{
|
74
39
|
"AWSTemplateFormatVersion" : "2010-09-09",
|
75
40
|
"Description" : "{{description}}",
|
76
41
|
"Resources" : {
|
77
|
-
|
78
|
-
"Type" : "AWS::EC2::Instance",
|
79
|
-
"Properties" : {
|
80
|
-
"ImageId" : "ami-00dae61d",
|
81
|
-
"InstanceType" : "t2.micro"
|
82
|
-
}
|
83
|
-
}
|
42
|
+
{{> resources }}
|
84
43
|
}
|
85
44
|
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
++start++
|
4
|
+
|
5
|
+
<style>
|
6
|
+
h1 {
|
7
|
+
color:blue;
|
8
|
+
font-size: 2.5em;
|
9
|
+
}
|
10
|
+
h2 {
|
11
|
+
color:blue;
|
12
|
+
font-size: 1.5em;
|
13
|
+
}
|
14
|
+
body {
|
15
|
+
background-color: #b0c4de;
|
16
|
+
}
|
17
|
+
</style>
|
18
|
+
|
19
|
+
|
20
|
+
# <a id="top">aws-must demo 2 template</a>
|
21
|
+
|
22
|
+
## root.mustache
|
23
|
+
|
24
|
+
Create an EC2 with following fixed parameters
|
25
|
+
|
26
|
+
* `ImageId` : "ami-00dae61d",
|
27
|
+
* `InstanceType` : "t2.micro"
|
28
|
+
|
29
|
+
Supports only region `eu-central-1`. No ssh connection allowed by
|
30
|
+
default.
|
31
|
+
|
32
|
+
**Parameters**:
|
33
|
+
|
34
|
+
* no parameters
|
35
|
+
|
36
|
+
|
37
|
+
## Document Content
|
38
|
+
|
39
|
+
This document is generated automically from `aws-must` -demo
|
40
|
+
templates.
|
41
|
+
|
42
|
+
|
43
|
+
Output contains markdown syntax between
|
44
|
+
**++start++** and
|
45
|
+
**++close++** -tags from the template files. For
|
46
|
+
each template, it
|
47
|
+
|
48
|
+
* gives a general description of the template
|
49
|
+
|
50
|
+
* documents the attribute context e.g. `.` or `./resources/Instance`,
|
51
|
+
and attributes references of the template
|
52
|
+
|
53
|
+
* lists template actions, i.e. output from template, or template
|
54
|
+
inclusion
|
55
|
+
|
56
|
+
|
57
|
+
## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
|
58
|
+
|
59
|
+
|
60
|
+
**Attributes**: context= `.`
|
61
|
+
|
62
|
+
* `description`: description for the CF template
|
63
|
+
|
64
|
+
**Actions**:
|
65
|
+
|
66
|
+
* **Description**: `description`
|
67
|
+
|
68
|
+
|
69
|
+
++close++
|
70
|
+
|
71
|
+
}}
|
72
|
+
|
73
|
+
{
|
74
|
+
"AWSTemplateFormatVersion" : "2010-09-09",
|
75
|
+
"Description" : "{{description}}",
|
76
|
+
"Resources" : {
|
77
|
+
"MyEC2Instance" : {
|
78
|
+
"Type" : "AWS::EC2::Instance",
|
79
|
+
"Properties" : {
|
80
|
+
"ImageId" : "ami-00dae61d",
|
81
|
+
"InstanceType" : "t2.micro"
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
data/demo/3/conf.yaml
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
-- demo/2 : added description property
|
1
2
|
|
2
|
-
|
3
|
-
|
3
|
+
|
4
|
+
description: "demo/3: a simple Amazon EC2 instance created using aws-must tool"
|
5
|
+
|
6
|
+
parameters:
|
7
|
+
|
8
|
+
- Name: InstanceType
|
9
|
+
Type: String
|
10
|
+
Description: EC2 reousrce instance type
|
11
|
+
Value: &Param_InstanceType t2.micro
|
12
|
+
|
13
|
+
|
14
|
+
resources:
|
15
|
+
|
16
|
+
- Instance:
|
17
|
+
Name: MyEC2Instance
|
18
|
+
ImageId: ami-00dae61d
|
19
|
+
InstanceType: t2.micro
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
resource.mustache
|
4
|
+
|
5
|
+
++start++
|
6
|
+
|
7
|
+
## <a id="resource.mustache"></a>resource.mustache <a class='navigator' href='#top'">[top]</a>
|
8
|
+
|
9
|
+
Dispatches resource sub-type templates based resource Type propertys
|
10
|
+
|
11
|
+
**Attributes**: context= `./resources`
|
12
|
+
|
13
|
+
* `Instance`: sub-document defining an EC instance
|
14
|
+
|
15
|
+
|
16
|
+
**Actions**:
|
17
|
+
|
18
|
+
* include <a href="#resourceInstance.mustache">resourceInstance.mustache</a> if `Instance`
|
19
|
+
|
20
|
+
> resourceInstance
|
21
|
+
|
22
|
+
++close++
|
23
|
+
|
24
|
+
|
25
|
+
}}
|
26
|
+
|
27
|
+
{{# Instance }}{{> resourceInstance}}{{/ Instance }}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
## <a id="resourceInstance.mustache"></a>resourceInstance.mustache <a class='navigator' href='#top'">[top]</a>
|
7
|
+
|
8
|
+
Create an EC2 instance
|
9
|
+
|
10
|
+
**Attributes**: context= `./resources/Instance`
|
11
|
+
|
12
|
+
* `Name`: name of the EC2 instance to create
|
13
|
+
* `ImageId`: AIM id to create
|
14
|
+
|
15
|
+
**Actions**:
|
16
|
+
|
17
|
+
* **Name**: `Name`
|
18
|
+
* **Type**: 'AWS::EC2::Instance'
|
19
|
+
* **ImageId**: `ImageId`
|
20
|
+
|
21
|
+
++close++
|
22
|
+
|
23
|
+
}}
|
24
|
+
|
25
|
+
|
26
|
+
"{{Name}}" : {
|
27
|
+
"Type" : "AWS::EC2::Instance",
|
28
|
+
"Properties" : {
|
29
|
+
"ImageId" : "{{ImageId}}",
|
30
|
+
"InstanceType" : "{{InstanceType}}"
|
31
|
+
}
|
32
|
+
}{{_comma}}
|
data/demo/3/resources.mustache
CHANGED
@@ -1,21 +1,19 @@
|
|
1
1
|
{{!
|
2
2
|
|
3
|
-
resources.mustache - fixed resources
|
4
|
-
|
5
3
|
++start++
|
6
4
|
|
7
|
-
##
|
8
|
-
|
9
|
-
Create an EC2 with following fixed parameters
|
5
|
+
## resources.mustache
|
10
6
|
|
11
|
-
|
12
|
-
* `InstanceType` : "t2.micro"
|
7
|
+
Nothing created here
|
13
8
|
|
14
9
|
++close++
|
15
10
|
|
16
11
|
|
17
12
|
}}
|
13
|
+
{{!
|
18
14
|
|
15
|
+
Fixed resource 'MyEC2Instance' not used anymore.
|
16
|
+
Use YAML resource configuration instead!
|
19
17
|
|
20
18
|
"MyEC2Instance" : {
|
21
19
|
"Type" : "AWS::EC2::Instance",
|
@@ -23,4 +21,7 @@ Create an EC2 with following fixed parameters
|
|
23
21
|
"ImageId" : "ami-00dae61d",
|
24
22
|
"InstanceType" : "t2.micro"
|
25
23
|
}
|
26
|
-
}
|
24
|
+
}
|
25
|
+
|
26
|
+
}}
|
27
|
+
{{# resources }}{{> resource }}{{/ resources }}
|
data/demo/3/root.mustache
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
{{!
|
2
2
|
|
3
|
+
root.mustache: root level template,
|
3
4
|
|
4
5
|
==================================================================
|
5
6
|
STYLE section
|
6
7
|
==================================================================
|
7
8
|
|
8
9
|
++start++
|
10
|
+
|
9
11
|
<style>
|
10
12
|
h1 {
|
11
13
|
color:blue;
|
@@ -15,12 +17,18 @@ h2 {
|
|
15
17
|
color:blue;
|
16
18
|
font-size: 1.5em;
|
17
19
|
}
|
20
|
+
h3 {
|
21
|
+
color:blue;
|
22
|
+
font-size: 1.5em;
|
23
|
+
}
|
18
24
|
body {
|
19
25
|
background-color: #b0c4de;
|
20
26
|
}
|
21
27
|
</style>
|
28
|
+
|
22
29
|
++close++
|
23
30
|
|
31
|
+
|
24
32
|
==================================================================
|
25
33
|
CONTENT section
|
26
34
|
==================================================================
|
@@ -29,10 +37,8 @@ CONTENT section
|
|
29
37
|
|
30
38
|
# <a id="top">aws-must demo 3 template</a>
|
31
39
|
|
32
|
-
|
33
|
-
|
34
|
-
* `ImageId` : "ami-00dae61d",
|
35
|
-
* `InstanceType` : "t2.micro"
|
40
|
+
Creates a EC2 instances using YAML configuration defining `ImageId`
|
41
|
+
(e.g. ami-00dae61d) and `InstanceType` (e.g. t2.micro).
|
36
42
|
|
37
43
|
|
38
44
|
Supports only region `eu-central-1`. No ssh connection allowed by
|
@@ -40,13 +46,13 @@ default.
|
|
40
46
|
|
41
47
|
**Parameters**:
|
42
48
|
|
43
|
-
*
|
49
|
+
* `InstanceType`: EC2 resource instance type, (default: t2.micro)
|
44
50
|
|
45
51
|
|
46
52
|
## Document Content
|
47
53
|
|
48
54
|
This document is generated automically from `aws-must` -demo
|
49
|
-
templates.
|
55
|
+
templates.
|
50
56
|
|
51
57
|
|
52
58
|
Output contains markdown syntax between
|
@@ -62,40 +68,34 @@ each template, it
|
|
62
68
|
* lists template actions, i.e. output from template, or template
|
63
69
|
inclusion
|
64
70
|
|
71
|
+
## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
|
65
72
|
|
66
73
|
|
67
|
-
|
74
|
+
Root template
|
68
75
|
|
69
|
-
Create an EC2 instance
|
70
76
|
|
71
77
|
**Attributes**: context= `.`
|
72
78
|
|
73
79
|
* `description`: description for the CF template
|
74
80
|
|
81
|
+
|
75
82
|
**Actions**:
|
76
83
|
|
77
84
|
* **Description**: `description`
|
78
85
|
* **include** <a href="#resources.mustache">resources.mustache</a>
|
86
|
+
* **for** `resource` **in** `resource` **include** <a href="#resource.mustache">resource.mustache</a>
|
79
87
|
|
80
88
|
> resources
|
89
|
+
> resource
|
81
90
|
|
82
91
|
++close++
|
83
92
|
|
84
|
-
==================================================================
|
85
|
-
|
86
93
|
}}
|
87
94
|
|
88
95
|
{
|
89
96
|
"AWSTemplateFormatVersion" : "2010-09-09",
|
90
|
-
|
91
97
|
"Description" : "{{description}}",
|
92
|
-
|
93
|
-
|
94
|
-
|
95
98
|
"Resources" : {
|
96
|
-
|
97
99
|
{{> resources }}
|
98
|
-
|
99
100
|
}
|
100
|
-
|
101
101
|
}
|
data/demo/4/conf.yaml
CHANGED
@@ -1,22 +1,27 @@
|
|
1
|
-
|
1
|
+
description: "demo/4: A simple Amazon EC2 instance created using aws-must tool"
|
2
2
|
|
3
|
+
resources:
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
- InstanceSecurityGroup:
|
6
|
+
Name: &DefaultSG MyDefaultSecurityGroup
|
7
|
+
IngressCidrIp: "0.0.0.0/0"
|
7
8
|
|
9
|
+
- Instance:
|
10
|
+
Name: &Resource_1 MyEC2Instance
|
11
|
+
ImageId: ami-00dae61d
|
12
|
+
InstanceType: t2.micro
|
13
|
+
SecurityGroup: *DefaultSG
|
8
14
|
|
9
|
-
parameters:
|
10
15
|
|
11
|
-
|
12
|
-
Type: String
|
13
|
-
Description: EC2 reousrce instance type
|
14
|
-
Value: &Param_InstanceType t2.micro
|
16
|
+
outputs:
|
15
17
|
|
18
|
+
- Name: InstanceId1
|
19
|
+
Description: InstanceId of the newly created EC2 instance
|
20
|
+
Ref: *Resource_1
|
16
21
|
|
17
|
-
resources:
|
18
22
|
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
- Name: IP1
|
24
|
+
Description: Public IP address of the newly created EC2 instance
|
25
|
+
Attr:
|
26
|
+
Ref: *Resource_1
|
27
|
+
Name: PublicIp
|
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
## <a id="output.mustache"></a>output.mustache <a class='navigator' href='#top'">[top]</a>
|
7
7
|
|
8
|
+
|
8
9
|
Create one output entry to CloudFormation JSON output section
|
9
10
|
|
10
11
|
**Attributes**: context= `./outputs`
|
@@ -25,8 +26,6 @@ Create one output entry to CloudFormation JSON output section
|
|
25
26
|
* **Value**: **Ref** if `Ref`
|
26
27
|
* **Value**: `Attr.Ref`, `Attr.Name` if `Attr`
|
27
28
|
|
28
|
-
|
29
|
-
|
30
29
|
++close++
|
31
30
|
|
32
31
|
}}
|
data/demo/4/resource.mustache
CHANGED
@@ -12,7 +12,6 @@ Dispatches resource sub-type templates based resource Type propertys
|
|
12
12
|
|
13
13
|
* `Instance`: sub-document defining an EC instance
|
14
14
|
|
15
|
-
|
16
15
|
**Actions**:
|
17
16
|
|
18
17
|
* include <a href="#resourceInstance.mustache">resourceInstance.mustache</a> if `Instance`
|
@@ -25,3 +24,4 @@ Dispatches resource sub-type templates based resource Type propertys
|
|
25
24
|
}}
|
26
25
|
|
27
26
|
{{# Instance }}{{> resourceInstance}}{{/ Instance }}
|
27
|
+
{{# InstanceSecurityGroup }}{{> resourceSecurityGroup}}{{/ InstanceSecurityGroup }}
|