aws-must 0.0.2
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 +7 -0
- data/README.md +235 -0
- data/bin/aws-must.rb +92 -0
- data/demo/0/conf.yaml +1 -0
- data/demo/0/root.mustache +1 -0
- data/demo/1/conf.yaml +1 -0
- data/demo/1/root.mustache +22 -0
- data/demo/2/conf.yaml +6 -0
- data/demo/2/root.mustache +54 -0
- data/demo/3/conf.yaml +3 -0
- data/demo/3/resources.mustache +26 -0
- data/demo/3/root.mustache +85 -0
- data/demo/4/conf.yaml +22 -0
- data/demo/4/resource.mustache +27 -0
- data/demo/4/resourceInstance.mustache +32 -0
- data/demo/4/resources.mustache +25 -0
- data/demo/4/root.mustache +95 -0
- data/demo/5/conf.yaml +32 -0
- data/demo/5/output.mustache +39 -0
- data/demo/5/resource.mustache +26 -0
- data/demo/5/resourceInstance.mustache +35 -0
- data/demo/5/resources.mustache +25 -0
- data/demo/5/root.mustache +100 -0
- data/demo/6/conf.yaml +31 -0
- data/demo/6/mappings.mustache +67 -0
- data/demo/6/output.mustache +40 -0
- data/demo/6/resource.mustache +29 -0
- data/demo/6/resourceInstance.mustache +35 -0
- data/demo/6/resources.mustache +35 -0
- data/demo/6/root.mustache +133 -0
- data/demo/7/conf.yaml +54 -0
- data/demo/7/mappings.mustache +67 -0
- data/demo/7/output.mustache +40 -0
- data/demo/7/parameter.mustache +38 -0
- data/demo/7/resource.mustache +38 -0
- data/demo/7/resourceInstance.mustache +45 -0
- data/demo/7/resourceSecurityGroup.mustache +37 -0
- data/demo/7/resources.mustache +35 -0
- data/demo/7/root.mustache +157 -0
- data/demo/7/tag.mustache +30 -0
- data/lib/aws-must/aws-must.rb +96 -0
- data/lib/aws-must/docu.rb +164 -0
- data/lib/aws-must/template.rb +81 -0
- data/lib/aws-must.rb +11 -0
- data/lib/tasks/demo.rake +139 -0
- data/lib/utils/hasher.rb +83 -0
- data/lib/utils/logger.rb +71 -0
- metadata +106 -0
@@ -0,0 +1,133 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
root.mustache: root level template,
|
4
|
+
|
5
|
+
==================================================================
|
6
|
+
STYLE section
|
7
|
+
==================================================================
|
8
|
+
|
9
|
+
++start++
|
10
|
+
<style>
|
11
|
+
h1 {
|
12
|
+
color:blue;
|
13
|
+
font-size: 2.5em;
|
14
|
+
}
|
15
|
+
h2 {
|
16
|
+
color:blue;
|
17
|
+
font-size: 1.5em;
|
18
|
+
}
|
19
|
+
h3 {
|
20
|
+
color:blue;
|
21
|
+
font-size: 1.5em;
|
22
|
+
}
|
23
|
+
.navigator {
|
24
|
+
font-size: 0.5em;
|
25
|
+
}
|
26
|
+
body {
|
27
|
+
background-color: #b0c4de;
|
28
|
+
}
|
29
|
+
</style>
|
30
|
+
|
31
|
+
++close++
|
32
|
+
|
33
|
+
|
34
|
+
==================================================================
|
35
|
+
CONTENT section
|
36
|
+
==================================================================
|
37
|
+
|
38
|
+
++start++
|
39
|
+
|
40
|
+
# <a id="top">aws-must demo 6 templates</a>
|
41
|
+
|
42
|
+
This document is generated automically from `aws-must` -demo
|
43
|
+
templates.
|
44
|
+
|
45
|
+
|
46
|
+
Output contains markdown syntax between
|
47
|
+
**++start++** and
|
48
|
+
**++close++** -tags from the template files. For
|
49
|
+
each template, it
|
50
|
+
|
51
|
+
* gives a general description of the template
|
52
|
+
|
53
|
+
* documents the attribute context e.g. `.` or `./resources/Instance`,
|
54
|
+
and attributes references of the template
|
55
|
+
|
56
|
+
* lists template actions, i.e. output from template, or template
|
57
|
+
inclusion
|
58
|
+
|
59
|
+
### Table of contents
|
60
|
+
<ul>
|
61
|
+
|
62
|
+
<li><a href="#root.mustache">root.mustache</a>: root template =
|
63
|
+
starting point of template rendering</li>
|
64
|
+
|
65
|
+
<li><a href="#mappings.mustache">mappings.mustache</a>matches a key to
|
66
|
+
a corresponding set of named values</li>
|
67
|
+
|
68
|
+
<li>Resources</li>
|
69
|
+
|
70
|
+
<ul>
|
71
|
+
|
72
|
+
<li><a href="#resources.mustache">resources.mustache</a>: fixed
|
73
|
+
resources</li>
|
74
|
+
|
75
|
+
<li><a href="#resource.mustache">resource.mustache</a>: dispatch
|
76
|
+
resource based on resource type</li> <li><a
|
77
|
+
href="#resourceInstance.mustache">resourceInstance.mustache</a>create
|
78
|
+
an EC2 instance</li>
|
79
|
+
|
80
|
+
</ul><li><a href="#output.mustache">output.mustache</a>:values in
|
81
|
+
response to describe stack calls </li> </ul>
|
82
|
+
|
83
|
+
|
84
|
+
## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
|
85
|
+
|
86
|
+
Starting point of template rendering.
|
87
|
+
|
88
|
+
**Attributes**: context= `.`
|
89
|
+
|
90
|
+
* `description`: description for the CF template
|
91
|
+
|
92
|
+
**Actions**:
|
93
|
+
|
94
|
+
* **Description**: `description`
|
95
|
+
* **include** <a href="#mappings.mustache">mappings.mustache</a>
|
96
|
+
* **include** <a href="#resources.mustache">resources.mustache</a>
|
97
|
+
* **for** `resource` **in** `resource` **include** <a href="#resource.mustache">resource.mustache</a>
|
98
|
+
* **for** `output` **in** `outputs` **include** <a href="#output.mustache">output.mustache</a>
|
99
|
+
|
100
|
+
|
101
|
+
> mappings
|
102
|
+
> resources
|
103
|
+
> resource
|
104
|
+
> output
|
105
|
+
|
106
|
+
|
107
|
+
++close++
|
108
|
+
|
109
|
+
}}
|
110
|
+
|
111
|
+
{
|
112
|
+
"AWSTemplateFormatVersion" : "2010-09-09",
|
113
|
+
|
114
|
+
"Description" : "{{description}}",
|
115
|
+
|
116
|
+
"Mappings" : {
|
117
|
+
{{> mappings }}
|
118
|
+
},
|
119
|
+
|
120
|
+
"Resources" : {
|
121
|
+
|
122
|
+
{{> resources }}
|
123
|
+
{{# resources }}{{> resource }}{{/ resources }}
|
124
|
+
|
125
|
+
},
|
126
|
+
|
127
|
+
"Outputs" : {
|
128
|
+
|
129
|
+
{{# outputs }}{{> output }}{{/ outputs }}
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
}
|
data/demo/7/conf.yaml
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
-- demo/2 : added description property
|
2
|
+
|
3
|
+
|
4
|
+
description: "demo/7 - A simple Amazon EC2 instance created using aws-must tool
|
5
|
+
- Minimum Viable Solution to Manage CloudFormation
|
6
|
+
Templates. This adds support for EC2 intance tags, parameters, and security group"
|
7
|
+
|
8
|
+
parameters:
|
9
|
+
|
10
|
+
- Name: InstanceType
|
11
|
+
Type: String
|
12
|
+
Description: EC2 reousrce instance type
|
13
|
+
Value: &Param_InstanceType t2.micro
|
14
|
+
|
15
|
+
- Name: &Param_KeyName KeyName
|
16
|
+
Type: "AWS::EC2::KeyPair::KeyName"
|
17
|
+
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
|
18
|
+
Value: demo-key
|
19
|
+
|
20
|
+
- Name: &Param_SSHLocation SSHLocation
|
21
|
+
Type: String
|
22
|
+
Description: The IP address range that can be used to SSH to the EC2 instances
|
23
|
+
Value: "0.0.0.0/0"
|
24
|
+
|
25
|
+
|
26
|
+
resources:
|
27
|
+
|
28
|
+
- InstanceSecurityGroup:
|
29
|
+
Name: &DefaultSG MyDefaultSecurityGroup
|
30
|
+
IngressRef: *Param_SSHLocation
|
31
|
+
|
32
|
+
- Instance:
|
33
|
+
Name: &Resource_1 MyEC2Instance
|
34
|
+
InstanceType: *Param_InstanceType
|
35
|
+
KeyName: *Param_KeyName
|
36
|
+
SecurityGroup: *DefaultSG
|
37
|
+
tags:
|
38
|
+
- Key: demotag1
|
39
|
+
Value: demotag1 value
|
40
|
+
|
41
|
+
|
42
|
+
outputs:
|
43
|
+
|
44
|
+
- Name: Instance1
|
45
|
+
Description: InstanceId of the newly created EC2 instance
|
46
|
+
Ref: *Resource_1
|
47
|
+
|
48
|
+
|
49
|
+
- Name: IP1
|
50
|
+
Description: Public IP address of the newly created EC2 instance
|
51
|
+
Attr:
|
52
|
+
Ref: *Resource_1
|
53
|
+
Name: PublicIp
|
54
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
++start++
|
4
|
+
|
5
|
+
## <a id="mappings.mustache"></a>mappings.mustache <a class='navigator' href='#top'">[top]</a>
|
6
|
+
|
7
|
+
|
8
|
+
Create fixed lookup tables `AWSInstanceType2Arch` and
|
9
|
+
`AWSRegionArch2AMI` implementing the table below
|
10
|
+
|
11
|
+
<code><pre>
|
12
|
+
ap-northeast-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-90815290 hvm
|
13
|
+
ap-southeast-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-0accf458 hvm
|
14
|
+
ap-southeast-2 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-1dc8b127 hvm
|
15
|
+
cn-north-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-eae27fd3 hvm
|
16
|
+
eu-central-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-3248712f hvm
|
17
|
+
eu-west-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-d74437a0 hvm
|
18
|
+
sa-east-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-0f6ced12 hvm
|
19
|
+
us-east-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-83c525e8 hvm
|
20
|
+
us-gov-west-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-51513172 hvm
|
21
|
+
us-west-1 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-61b25925 hvm
|
22
|
+
us-west-2 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami-57e8d767 hvm
|
23
|
+
</pre></code>
|
24
|
+
|
25
|
+
|
26
|
+
**Attributes**: context= `.`
|
27
|
+
|
28
|
+
* none
|
29
|
+
|
30
|
+
|
31
|
+
**Actions**:
|
32
|
+
|
33
|
+
* **AWSInstanceType2Arch**: fixed key/value mapping, currently only
|
34
|
+
**t2.micro** --> **64bit**
|
35
|
+
|
36
|
+
* **AWSRegionArch2AMI**: fixed key/value mapping created, currently
|
37
|
+
architectures only for **64bits**
|
38
|
+
|
39
|
+
|
40
|
+
++close++
|
41
|
+
|
42
|
+
|
43
|
+
==================================================================
|
44
|
+
The template
|
45
|
+
==================================================================
|
46
|
+
|
47
|
+
}}
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
"AWSInstanceType2Arch" : {
|
52
|
+
"t2.micro" : { "Arch" : "64" }
|
53
|
+
},
|
54
|
+
"AWSRegionArch2AMI" : {
|
55
|
+
"ap-northeast-1" : { "64" : "ami-90815290" },
|
56
|
+
"ap-southeast-1" : { "64" : "ami-0accf458" },
|
57
|
+
"ap-southeast-2" : { "64" : "ami-1dc8b127" },
|
58
|
+
"cn-north-1" : { "64" : "ami-eae27fd3" },
|
59
|
+
"eu-central-1" : { "64" : "ami-3248712f" },
|
60
|
+
"eu-west-1" : { "64" : "ami-d74437a0" },
|
61
|
+
"sa-east-1" : { "64" : "ami-0f6ced12" },
|
62
|
+
"us-east-1" : { "64" : "ami-83c525e8" },
|
63
|
+
"us-west-1" : { "64" : "ami-61b25925" },
|
64
|
+
"us-gov-west-1" : { "64" : "ami-51513172" },
|
65
|
+
"us-west-2" : { "64" : "ami-57e8d767" }
|
66
|
+
}
|
67
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
## <a id="output.mustache"></a>output.mustache <a class='navigator' href='#top'">[top]</a>
|
7
|
+
|
8
|
+
Create one output entry to CloudFormation JSON output section
|
9
|
+
|
10
|
+
**Attributes**: context= `./outputs`
|
11
|
+
|
12
|
+
* `Name` : of the ouput entry
|
13
|
+
* `Description`: of the output entry
|
14
|
+
* `Ref`: name of refernece
|
15
|
+
* `Attr`
|
16
|
+
* `Ref`: name of attribute reference
|
17
|
+
* `Name`: name of the attribute
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
**Actions**:
|
22
|
+
|
23
|
+
* **Name**: `Name`
|
24
|
+
* **Description**: `Description`
|
25
|
+
* **Value**: **Ref** if `Ref`
|
26
|
+
* **Value**: `Attr.Ref`, `Attr.Name` if `Attr`
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
++close++
|
31
|
+
|
32
|
+
}}
|
33
|
+
|
34
|
+
|
35
|
+
"{{Name}}": {
|
36
|
+
"Description" : "{{Description}}"
|
37
|
+
{{#Ref}}, "Value" : { "Ref" : "{{Ref}}" }{{/Ref}}
|
38
|
+
{{#Attr}}, "Value" : { "Fn::GetAtt" : [ "{{Ref}}", "{{Name}}" ] }{{/Attr}}
|
39
|
+
}{{_comma}}
|
40
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
## <a id="parameter.mustache"></a>parameter.mustache <a class='navigator' href='#top'">[top]</a>
|
7
|
+
|
8
|
+
Create one parameter entry to CloudFormation JSON parameter section
|
9
|
+
|
10
|
+
**Attributes**: context= `./parameters`
|
11
|
+
|
12
|
+
* `Name` : of the ouput entry
|
13
|
+
* `Description`: of the parameter entry
|
14
|
+
* `Type`: The data type of [CloudFormation
|
15
|
+
Parameter](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html),
|
16
|
+
e.g. `String`, `AWS::EC2::KeyPair::KeyName`
|
17
|
+
* `Value`: value of the parameter
|
18
|
+
|
19
|
+
|
20
|
+
**Actions**:
|
21
|
+
|
22
|
+
* **Name**: `Name`
|
23
|
+
* **Description**: `Description`
|
24
|
+
* **Type**: `Type`
|
25
|
+
* **Default**: `Value`
|
26
|
+
|
27
|
+
++close++
|
28
|
+
|
29
|
+
}}
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
"{{Name}}": {
|
35
|
+
"Description" : "{{Description}}{{^Description}}No description given{{/Description}}",
|
36
|
+
"Type": "{{Type}}",
|
37
|
+
"Default" : "{{Value}}"
|
38
|
+
}{{_comma}}
|
@@ -0,0 +1,38 @@
|
|
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
|
+
|
10
|
+
Dispatches resource sub-type templates based resource Type propertys
|
11
|
+
|
12
|
+
**Attributes**: context= `./resources`
|
13
|
+
|
14
|
+
* `Instance`: sub-document defining an EC instance
|
15
|
+
* `SecurityGroup`: sub-document defining an <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html">AWS::EC2::SecurityGroup</a>
|
16
|
+
|
17
|
+
|
18
|
+
**Actions**:
|
19
|
+
|
20
|
+
* **include** <a href="#resourceInstance.mustache">resourceInstance.mustache</a> **if** `Instance`
|
21
|
+
* **include** <a href="#resourceSecurityGroup.mustache">resourceSecurityGroup.mustache</a> **if** `SecurityGroup`
|
22
|
+
|
23
|
+
|
24
|
+
**Included resources**
|
25
|
+
|
26
|
+
* `resourceInstance`
|
27
|
+
|
28
|
+
> resourceInstance
|
29
|
+
> resourceSecurityGroup.mustache
|
30
|
+
|
31
|
+
++close++
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
}}
|
36
|
+
|
37
|
+
{{# Instance }}{{> resourceInstance}}{{/ Instance }}
|
38
|
+
{{# InstanceSecurityGroup }}{{> resourceSecurityGroup}}{{/ InstanceSecurityGroup }}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
|
7
|
+
## <a id="resourceInstance.mustache"></a>resourceInstance.mustache <a class='navigator' href='#top'">[top]</a>
|
8
|
+
|
9
|
+
Create an EC2 instance
|
10
|
+
|
11
|
+
**Attributes**: context= `./resources/Instance`
|
12
|
+
|
13
|
+
* `Name`: name of the EC2 instance to create
|
14
|
+
* `InstanceType` : The instance type, such as t2.micro.
|
15
|
+
* `tags` : array of tag sub-documents for EC2 instance
|
16
|
+
|
17
|
+
|
18
|
+
**Actions**:
|
19
|
+
|
20
|
+
* **Name**: `Name`
|
21
|
+
* **Type**: 'AWS::EC2::Instance'
|
22
|
+
* **for** `tag` **in** `tags` **include** <a href="#tag.mustache">tag.mustache</a>
|
23
|
+
* **SecurityGroups.Ref**: `SecurityGroup` if `SecurityGroup`
|
24
|
+
* **ImageId**: **AWSRegionArch2AMI**( 'AWS::Region', **AWSInstanceType2Arch**(`InstanceType`))
|
25
|
+
* **KeyName**: `KeyName` if `KeyName`
|
26
|
+
|
27
|
+
> tag
|
28
|
+
|
29
|
+
|
30
|
+
++close++
|
31
|
+
|
32
|
+
}}
|
33
|
+
|
34
|
+
|
35
|
+
"{{Name}}" : {
|
36
|
+
"Type" : "AWS::EC2::Instance",
|
37
|
+
"Properties" : {
|
38
|
+
"ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" },
|
39
|
+
{ "Fn::FindInMap" : [ "AWSInstanceType2Arch", "{{InstanceType}}", "Arch" ] } ] }
|
40
|
+
, "InstanceType" : "{{InstanceType}}"
|
41
|
+
, "Tags" : [ {{#tags}}{{>tag}}{{/tags}} ]
|
42
|
+
{{#SecurityGroup}}, "SecurityGroups" : [ { "Ref" : "{{SecurityGroup}}" } ]{{/SecurityGroup}}
|
43
|
+
{{#KeyName}}, "KeyName" : { "Ref" : "{{KeyName}}" }{{/KeyName}}
|
44
|
+
} {{! Propertites }}
|
45
|
+
}{{_comma}}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
|
7
|
+
## <a id="resourceSecurityGroup.mustache"></a>resourceSecurityGroup.mustache <a class='navigator' href='#top'">[top]</a>
|
8
|
+
|
9
|
+
Create an EC2 Security Group
|
10
|
+
|
11
|
+
**Attributes**: context= `./resources/InstanceSecurityGroup`
|
12
|
+
|
13
|
+
* `Name` : of the security group
|
14
|
+
* `IngressRef`: A refernce to parameter, which defined CIDR for to inbound traffic (ingress)
|
15
|
+
|
16
|
+
**Actions**:
|
17
|
+
|
18
|
+
* **Name**: `Name`
|
19
|
+
* **Type**: "AWS::EC2::SecurityGroup"
|
20
|
+
* **Properties.SecurityGroupIngress[0].CidrIp**: `IngressRef`
|
21
|
+
|
22
|
+
++close++
|
23
|
+
|
24
|
+
}}
|
25
|
+
|
26
|
+
"{{Name}}" : {
|
27
|
+
"Type" : "AWS::EC2::SecurityGroup",
|
28
|
+
"Properties" : {
|
29
|
+
"GroupDescription" : "Enable SSH access via port 22",
|
30
|
+
"SecurityGroupIngress" : [ {
|
31
|
+
"IpProtocol" : "tcp",
|
32
|
+
"FromPort" : "22",
|
33
|
+
"ToPort" : "22",
|
34
|
+
"CidrIp" : { "Ref" : "{{IngressRef}}"}
|
35
|
+
} ]
|
36
|
+
}
|
37
|
+
}{{_comma}}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
++start++
|
4
|
+
|
5
|
+
## <a id="resources.mustache"></a>resources.mustache <a class='navigator' href='#top'">[top]</a>
|
6
|
+
|
7
|
+
Empty template.
|
8
|
+
|
9
|
+
**Attributes**: context= `.`
|
10
|
+
|
11
|
+
* none
|
12
|
+
|
13
|
+
|
14
|
+
**Actions**:
|
15
|
+
|
16
|
+
* no action (i.e. empty template)
|
17
|
+
|
18
|
+
|
19
|
+
++close++
|
20
|
+
|
21
|
+
|
22
|
+
}}
|
23
|
+
{{!
|
24
|
+
|
25
|
+
Moved to YAML
|
26
|
+
|
27
|
+
"MyEC2Instance" : {
|
28
|
+
"Type" : "AWS::EC2::Instance",
|
29
|
+
"Properties" : {
|
30
|
+
"ImageId" : "ami-00dae61d",
|
31
|
+
"InstanceType" : "t2.micro"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
}}
|
@@ -0,0 +1,157 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
root.mustache: root level template,
|
4
|
+
|
5
|
+
==================================================================
|
6
|
+
STYLE section
|
7
|
+
==================================================================
|
8
|
+
|
9
|
+
++start++
|
10
|
+
<style>
|
11
|
+
h1 {
|
12
|
+
color:blue;
|
13
|
+
font-size: 2.5em;
|
14
|
+
}
|
15
|
+
h2 {
|
16
|
+
color:blue;
|
17
|
+
font-size: 1.5em;
|
18
|
+
}
|
19
|
+
h3 {
|
20
|
+
color:blue;
|
21
|
+
font-size: 1.5em;
|
22
|
+
}
|
23
|
+
.navigator {
|
24
|
+
font-size: 0.5em;
|
25
|
+
}
|
26
|
+
body {
|
27
|
+
background-color: #b0c4de;
|
28
|
+
}
|
29
|
+
</style>
|
30
|
+
|
31
|
+
++close++
|
32
|
+
|
33
|
+
|
34
|
+
==================================================================
|
35
|
+
CONTENT section
|
36
|
+
==================================================================
|
37
|
+
|
38
|
+
++start++
|
39
|
+
|
40
|
+
# <a id="top">aws-must demo 7 templates</a>
|
41
|
+
|
42
|
+
This document is generated automically from `aws-must` -demo
|
43
|
+
templates.
|
44
|
+
|
45
|
+
|
46
|
+
Output contains markdown syntax between
|
47
|
+
**++start++** and
|
48
|
+
**++close++** -tags from the template files. For
|
49
|
+
each template, it
|
50
|
+
|
51
|
+
* gives a general description of the template
|
52
|
+
|
53
|
+
* documents the attribute context e.g. `.` or `./resources/Instance`,
|
54
|
+
and attributes referenced within the template
|
55
|
+
|
56
|
+
* lists template actions, i.e. output from template, or template
|
57
|
+
inclusion
|
58
|
+
|
59
|
+
### Table of contents
|
60
|
+
<ul>
|
61
|
+
|
62
|
+
<li><a href="#root.mustache">root.mustache</a>: root template =
|
63
|
+
starting point of template rendering</li>
|
64
|
+
|
65
|
+
<li><a href="#parameter.mustache">parameter.mustache</a>: create one
|
66
|
+
parameter entry to CloudFormation JSON parameter section</li>
|
67
|
+
|
68
|
+
<li><a href="#mappings.mustache">mappings.mustache</a>matches a key to
|
69
|
+
a corresponding set of named values</li>
|
70
|
+
|
71
|
+
<li>Resources</li>
|
72
|
+
|
73
|
+
<ul>
|
74
|
+
|
75
|
+
<li><a href="#resources.mustache">resources.mustache</a>: fixed
|
76
|
+
resources</li>
|
77
|
+
|
78
|
+
<li><a href="#resource.mustache">resource.mustache</a>: dispatch
|
79
|
+
resource based on resource type</li>
|
80
|
+
|
81
|
+
<ul> <li><a
|
82
|
+
href="#resourceSecurityGroup.mustache">resourceSecurityGroup.mustache.mustache</a>:
|
83
|
+
create an security group for accessing EC2 instances</li>
|
84
|
+
|
85
|
+
<li><a
|
86
|
+
href="#resourceInstance.mustache">resourceInstance.mustache</a>:
|
87
|
+
create an EC2 instance</li>
|
88
|
+
|
89
|
+
<ul><li><a href="#tag.mustache">tag.mustache</a>: add key-value tag property
|
90
|
+
to an</li><ul>
|
91
|
+
|
92
|
+
</ul></ul></ul></ul>
|
93
|
+
|
94
|
+
<li><a href="#output.mustache">output.mustache</a>: values in
|
95
|
+
response to describe stack calls </li> </ul>
|
96
|
+
|
97
|
+
|
98
|
+
## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
|
99
|
+
|
100
|
+
Starting point of template rendering.
|
101
|
+
|
102
|
+
**Attributes**: context= `.`
|
103
|
+
|
104
|
+
* `description`: description for the CF template
|
105
|
+
* `parameters`: array of parameter sub-documents for CloudFormation Parameters -section
|
106
|
+
* `resources`: array of resource sub-documents for CloudFormation Resources -section
|
107
|
+
* `outputs`: array of output sub-documents for CloudFormation Outputs -section
|
108
|
+
|
109
|
+
|
110
|
+
**Actions**:
|
111
|
+
|
112
|
+
* **Description**: `description`
|
113
|
+
* **for** `parameter` **in** `parameters` **include** <a href="#parameter.mustache">parameter.mustache</a>
|
114
|
+
* **include** <a href="#mappings.mustache">mappings.mustache</a>
|
115
|
+
* **include** <a href="#resources.mustache">resources.mustache</a>
|
116
|
+
* **for** `resource` **in** `resource` **include** <a href="#resource.mustache">resource.mustache</a>
|
117
|
+
* **for** `output` **in** `outputs` **include** <a href="#output.mustache">output.mustache</a>
|
118
|
+
|
119
|
+
|
120
|
+
> parameter
|
121
|
+
> mappings
|
122
|
+
> resources
|
123
|
+
> resource
|
124
|
+
> output
|
125
|
+
|
126
|
+
|
127
|
+
++close++
|
128
|
+
|
129
|
+
}}
|
130
|
+
|
131
|
+
{
|
132
|
+
"AWSTemplateFormatVersion" : "2010-09-09",
|
133
|
+
|
134
|
+
"Description" : "{{description}}",
|
135
|
+
|
136
|
+
"Parameters" : {
|
137
|
+
{{# parameters }}{{> parameter }}{{/ parameters }}
|
138
|
+
},
|
139
|
+
|
140
|
+
"Mappings" : {
|
141
|
+
{{> mappings }}
|
142
|
+
},
|
143
|
+
|
144
|
+
"Resources" : {
|
145
|
+
|
146
|
+
{{> resources }}
|
147
|
+
{{# resources }}{{> resource }}{{/ resources }}
|
148
|
+
|
149
|
+
},
|
150
|
+
|
151
|
+
"Outputs" : {
|
152
|
+
|
153
|
+
{{# outputs }}{{> output }}{{/ outputs }}
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
}
|
data/demo/7/tag.mustache
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
|
4
|
+
++start++
|
5
|
+
|
6
|
+
## <a id="tag.mustache"></a>tag.mustache <a class='navigator' href='#top'">[top]</a>
|
7
|
+
|
8
|
+
One key-value pair in EC2 instance Tags -array
|
9
|
+
|
10
|
+
**Attributes**: context= `./resources/Instance/tags`
|
11
|
+
|
12
|
+
* `Key`: of the tag entry
|
13
|
+
* `Value`: of the tag entry
|
14
|
+
|
15
|
+
**Actions**:
|
16
|
+
|
17
|
+
* **Key**: `Name`
|
18
|
+
* **Value**: `Value`
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
++close++
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
}}
|
27
|
+
|
28
|
+
{ "Key" : "{{Key}}", "Value" : "{{Value}}"{{_comma}} }
|
29
|
+
|
30
|
+
|