aws-must 0.0.6 → 0.0.7

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -5
  3. data/bin/aws-must.rb +42 -2
  4. data/demo/1/root.mustache +3 -0
  5. data/demo/2/resources.mustache +7 -3
  6. data/demo/2/root.mustache +41 -5
  7. data/demo/3/resource.mustache +6 -7
  8. data/demo/3/resourceInstance.mustache +6 -7
  9. data/demo/3/resources.mustache +7 -2
  10. data/demo/3/root.mustache +42 -17
  11. data/demo/4/output.mustache +6 -10
  12. data/demo/4/resource.mustache +6 -8
  13. data/demo/4/resourceInstance.mustache +6 -11
  14. data/demo/4/resourceSecurityGroup.mustache +6 -8
  15. data/demo/4/resources.mustache +8 -4
  16. data/demo/4/root.mustache +44 -17
  17. data/demo/5/mappings.mustache +5 -2
  18. data/demo/5/output.mustache +5 -11
  19. data/demo/5/resource.mustache +6 -10
  20. data/demo/5/resourceInstance.mustache +7 -9
  21. data/demo/5/resources.mustache +8 -5
  22. data/demo/5/root.mustache +44 -10
  23. data/demo/6/mappings.mustache +6 -3
  24. data/demo/6/output.mustache +8 -11
  25. data/demo/6/parameter.mustache +7 -11
  26. data/demo/6/resource.mustache +7 -17
  27. data/demo/6/resourceInstance.mustache +8 -16
  28. data/demo/6/resourceSecurityGroup.mustache +7 -8
  29. data/demo/6/resources.mustache +11 -5
  30. data/demo/6/root.mustache +53 -25
  31. data/demo/6/tag.mustache +6 -12
  32. data/demo/7/mappings.mustache +6 -3
  33. data/demo/7/output.mustache +8 -13
  34. data/demo/7/parameter.mustache +7 -11
  35. data/demo/7/resource.mustache +8 -17
  36. data/demo/7/resourceInstance.mustache +8 -16
  37. data/demo/7/resourceInstanceChef.mustache +6 -10
  38. data/demo/7/resourceSecurityGroup.mustache +8 -8
  39. data/demo/7/resources.mustache +10 -5
  40. data/demo/7/root.mustache +51 -25
  41. data/demo/7/tag.mustache +6 -10
  42. data/lib/aws-must/docu.rb +31 -7
  43. data/lib/aws-must/template.rb +23 -0
  44. data/lib/utils/hasher.rb +3 -1
  45. metadata +2 -2
data/demo/6/root.mustache CHANGED
@@ -6,7 +6,7 @@
6
6
  STYLE section
7
7
  ==================================================================
8
8
 
9
- ++start++
9
+ +++start+++
10
10
  <style>
11
11
  h1 {
12
12
  color:blue;
@@ -26,16 +26,32 @@ h3 {
26
26
  body {
27
27
  background-color: #b0c4de;
28
28
  }
29
+ /* Support fold-on/fold-off toggle */
30
+ div.fold {
31
+ width: 90%; padding: .42rem; border-radius: 5px; margin: 1rem;
32
+
33
+ }
34
+ div.fold div {
35
+ height: 0px; margin: .2rem; overflow: hidden;
36
+ }
37
+ div.toggle ~ div { height: 0px; margin: .2rem; overflow: hidden; }
38
+ input.toggle:checked ~ div {
39
+ height: auto;
40
+ color: white;
41
+ background: #c6a24b;
42
+ font-family: monospace;
43
+ white-space: pre;
44
+ }
29
45
  </style>
30
46
 
31
- ++close++
47
+ +++close+++
32
48
 
33
49
 
34
50
  ==================================================================
35
51
  CONTENT section
36
52
  ==================================================================
37
53
 
38
- ++start++
54
+ +++start+++
39
55
 
40
56
  # <a id="top">aws-must demo 6 template</a>
41
57
 
@@ -79,8 +95,7 @@ each template, it
79
95
  * documents the attribute context e.g. `.` or `./resources/Instance`,
80
96
  and attributes referenced within the template
81
97
 
82
- * lists template actions, i.e. output from template, or template
83
- inclusion
98
+ * checkbox to show template implementation
84
99
 
85
100
  ### Table of contents
86
101
  <ul>
@@ -118,10 +133,11 @@ to an</li><ul>
118
133
  </ul></ul></ul></ul>
119
134
 
120
135
  <li><a href="#output.mustache">output.mustache</a>: values in
121
- response to describe stack calls </li> </ul>
136
+ response to describe stack calls </li>
122
137
 
138
+ </ul>
123
139
 
124
- ## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
140
+ ## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'>[top]</a>
125
141
 
126
142
  Starting point of template rendering.
127
143
 
@@ -133,27 +149,12 @@ Starting point of template rendering.
133
149
  * `outputs`: array of output sub-documents for CloudFormation Outputs -section
134
150
 
135
151
 
136
- **Actions**:
137
-
138
- * **Description**: `description`
139
- * **for** `parameter` **in** `parameters` **include** <a href="#parameter.mustache">parameter.mustache</a>
140
- * **include** <a href="#mappings.mustache">mappings.mustache</a>
141
- * **include** <a href="#resources.mustache">resources.mustache</a>
142
- * **for** `resource` **in** `resource` **include** <a href="#resource.mustache">resource.mustache</a>
143
- * **for** `output` **in** `outputs` **include** <a href="#output.mustache">output.mustache</a>
144
-
145
-
146
- > parameter
147
- > mappings
148
- > resources
149
- > resource
150
- > output
151
-
152
-
153
- ++close++
152
+ +++close+++
154
153
 
155
154
  }}
156
155
 
156
+ {{! +++fold-on+++ }}
157
+
157
158
  {
158
159
  "AWSTemplateFormatVersion" : "2010-09-09",
159
160
 
@@ -181,3 +182,30 @@ Starting point of template rendering.
181
182
  }
182
183
 
183
184
  }
185
+
186
+ {{! +++fold-off+++ }}
187
+
188
+ 2
189
+ {{!
190
+
191
+ ==================================================================
192
+ INCLUDED templates
193
+ ==================================================================
194
+
195
+ +++start+++
196
+
197
+
198
+ > parameter
199
+ > mappings
200
+ > resources
201
+ > resource
202
+ > resourceInstance
203
+ > resourceSecurityGroup
204
+ > tag
205
+ > output
206
+
207
+
208
+ +++close+++
209
+
210
+ }}
211
+
data/demo/6/tag.mustache CHANGED
@@ -1,9 +1,9 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
- ## <a id="tag.mustache"></a>tag.mustache <a class='navigator' href='#top'">[top]</a>
6
+ ## <a id="tag.mustache"></a>tag.mustache <a class='navigator' href='#top'>[top]</a>
7
7
 
8
8
  One key-value pair in EC2 instance Tags -array
9
9
 
@@ -12,19 +12,13 @@ One key-value pair in EC2 instance Tags -array
12
12
  * `Key`: of the tag entry
13
13
  * `Value`: of the tag entry
14
14
 
15
- **Actions**:
16
-
17
- * **Key**: `Name`
18
- * **Value**: `Value`
19
-
20
-
21
-
22
- ++close++
23
-
24
-
15
+ +++close+++
25
16
 
26
17
  }}
27
18
 
19
+ {{! +++fold-on+++ }}
20
+
28
21
  { "Key" : "{{Key}}", "Value" : "{{Value}}"{{_comma}} }
29
22
 
23
+ {{! +++fold-off+++ }}
30
24
 
@@ -1,8 +1,8 @@
1
1
  {{!
2
2
 
3
- ++start++
3
+ +++start+++
4
4
 
5
- ## <a id="mappings.mustache"></a>mappings.mustache <a class='navigator' href='#top'">[top]</a>
5
+ ## <a id="mappings.mustache"></a>mappings.mustache <a class='navigator' href='#top'>[top]</a>
6
6
 
7
7
 
8
8
  Create fixed lookup tables `AWSInstanceType2Arch` and
@@ -37,7 +37,7 @@ us-west-2 trusty 14.04 LTS amd64 hvm:ebs-ssd 20150528 ami
37
37
  architectures only for **64bits**
38
38
 
39
39
 
40
- ++close++
40
+ +++close+++
41
41
 
42
42
 
43
43
  ==================================================================
@@ -46,6 +46,7 @@ The template
46
46
 
47
47
  }}
48
48
 
49
+ {{! +++fold-on+++ }}
49
50
 
50
51
 
51
52
  "AWSInstanceType2Arch" : {
@@ -65,3 +66,5 @@ The template
65
66
  "us-west-2" : { "64" : "ami-57e8d767" }
66
67
  }
67
68
 
69
+
70
+ {{! +++fold-off+++ }}
@@ -1,9 +1,9 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
- ## <a id="output.mustache"></a>output.mustache <a class='navigator' href='#top'">[top]</a>
6
+ ## <a id="output.mustache"></a>output.mustache <a class='navigator' href='#top'>[top]</a>
7
7
 
8
8
  Create one output entry to CloudFormation JSON output section
9
9
 
@@ -17,20 +17,12 @@ Create one output entry to CloudFormation JSON output section
17
17
  * `Name`: name of the attribute
18
18
 
19
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++
20
+ +++close+++
31
21
 
32
22
  }}
33
23
 
24
+ {{! +++fold-on+++ }}
25
+
34
26
 
35
27
  "{{Name}}": {
36
28
  "Description" : "{{Description}}"
@@ -38,3 +30,6 @@ Create one output entry to CloudFormation JSON output section
38
30
  {{#Attr}}, "Value" : { "Fn::GetAtt" : [ "{{Ref}}", "{{Name}}" ] }{{/Attr}}
39
31
  }{{_comma}}
40
32
 
33
+
34
+
35
+ {{! +++fold-off+++ }}
@@ -1,9 +1,9 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
- ## <a id="parameter.mustache"></a>parameter.mustache <a class='navigator' href='#top'">[top]</a>
6
+ ## <a id="parameter.mustache"></a>parameter.mustache <a class='navigator' href='#top'>[top]</a>
7
7
 
8
8
  Create one parameter entry to CloudFormation JSON parameter section
9
9
 
@@ -17,22 +17,18 @@ Create one parameter entry to CloudFormation JSON parameter section
17
17
  * `Value`: value of the parameter
18
18
 
19
19
 
20
- **Actions**:
21
-
22
- * **Name**: `Name`
23
- * **Description**: `Description`
24
- * **Type**: `Type`
25
- * **Default**: `Value`
26
-
27
- ++close++
20
+ +++close+++
28
21
 
29
22
  }}
30
23
 
31
24
 
25
+ {{! +++fold-on+++ }}
32
26
 
33
27
 
34
28
  "{{Name}}": {
35
29
  "Description" : "{{Description}}{{^Description}}No description given{{/Description}}",
36
30
  "Type": "{{Type}}",
37
31
  "Default" : "{{Value}}"
38
- }{{_comma}}
32
+ }{{_comma}}
33
+
34
+ {{! +++fold-off+++ }}
@@ -2,9 +2,9 @@
2
2
 
3
3
  resource.mustache
4
4
 
5
- ++start++
5
+ +++start+++
6
6
 
7
- ## <a id="resource.mustache"></a>resource.mustache <a class='navigator' href='#top'">[top]</a>
7
+ ## <a id="resource.mustache"></a>resource.mustache <a class='navigator' href='#top'>[top]</a>
8
8
 
9
9
 
10
10
  Dispatches resource sub-type templates based resource Type propertys
@@ -15,24 +15,15 @@ Dispatches resource sub-type templates based resource Type propertys
15
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
16
 
17
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++
18
+ +++close+++
32
19
 
20
+ }}
33
21
 
34
22
 
35
- }}
23
+ {{! +++fold-on+++ }}
36
24
 
37
25
  {{# Instance }}{{> resourceInstance}}{{/ Instance }}
38
26
  {{# InstanceSecurityGroup }}{{> resourceSecurityGroup}}{{/ InstanceSecurityGroup }}
27
+
28
+
29
+ {{! +++fold-off+++ }}
@@ -1,10 +1,10 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
6
 
7
- ## <a id="resourceInstance.mustache"></a>resourceInstance.mustache <a class='navigator' href='#top'">[top]</a>
7
+ ## <a id="resourceInstance.mustache"></a>resourceInstance.mustache <a class='navigator' href='#top'>[top]</a>
8
8
 
9
9
  Create an EC2 instance
10
10
 
@@ -16,23 +16,13 @@ Create an EC2 instance
16
16
  * `InstallChef`: add UserData to install Chef
17
17
 
18
18
 
19
- **Actions**:
20
19
 
21
- * **Name**: `Name`
22
- * **Type**: 'AWS::EC2::Instance'
23
- * **for** `tag` **in** `tags` **include** <a href="#tag.mustache">tag.mustache</a>
24
- * **SecurityGroups.Ref**: `SecurityGroup` if `SecurityGroup`
25
- * **ImageId**: **AWSRegionArch2AMI**( 'AWS::Region', **AWSInstanceType2Arch**(`InstanceType`))
26
- * **KeyName**: `KeyName` if `KeyName`
27
- * **include** <a href="#resourceInstanceChef.mustache">resourceInstanceChef.mustache</a> if `InstallChef`
28
-
29
- > tag
30
- > resourceInstanceChef
31
-
32
- ++close++
20
+ +++close+++
33
21
 
34
22
  }}
35
23
 
24
+ {{! +++fold-on+++ }}
25
+
36
26
 
37
27
  "{{Name}}" : {
38
28
  "Type" : "AWS::EC2::Instance",
@@ -45,4 +35,6 @@ Create an EC2 instance
45
35
  {{#KeyName}}, "KeyName" : { "Ref" : "{{KeyName}}" }{{/KeyName}}
46
36
  {{#InstallChef }}, "UserData": { {{> resourceInstanceChef }} }{{/ InstallChef }}
47
37
  }
48
- }{{_comma}}
38
+ }{{_comma}}
39
+
40
+ {{! +++fold-off+++ }}
@@ -1,10 +1,10 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
6
 
7
- ## <a id="resourceInstanceChef.mustache"></a>resourceInstanceChef.mustache<a class='navigator' href='#top'"> [top]</a>
7
+ ## <a id="resourceInstanceChef.mustache"></a>resourceInstanceChef.mustache<a class='navigator' href='#top'> [top]</a>
8
8
 
9
9
  UserData -script to install Chef
10
10
 
@@ -12,19 +12,14 @@ UserData -script to install Chef
12
12
 
13
13
  * `Version`: Chef version to install
14
14
 
15
- **Actions**:
16
15
 
17
- * /bin/bash
18
- * CHEF_VERSION=`Version`
19
- * LOG="/tmp/install.log"
20
- * `curl -L https://www.chef.io/chef/install.sh | sudo bash -s -- -v $CHEF_VERSION >>$LOG 2>&1`
21
-
22
-
23
- ++close++
16
+ +++close+++
24
17
 
25
18
  }}
26
19
 
27
20
 
21
+ {{! +++fold-on+++ }}
22
+
28
23
 
29
24
  "Fn::Base64": { "Fn::Join": [
30
25
  "\n",
@@ -46,3 +41,4 @@ UserData -script to install Chef
46
41
 
47
42
 
48
43
 
44
+ {{! +++fold-off+++ }}
@@ -1,10 +1,10 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
6
 
7
- ## <a id="resourceSecurityGroup.mustache"></a>resourceSecurityGroup.mustache <a class='navigator' href='#top'">[top]</a>
7
+ ## <a id="resourceSecurityGroup.mustache"></a>resourceSecurityGroup.mustache <a class='navigator' href='#top'>[top]</a>
8
8
 
9
9
  Create an EC2 Security Group
10
10
 
@@ -13,16 +13,14 @@ Create an EC2 Security Group
13
13
  * `Name` : of the security group
14
14
  * `IngressRef`: A refernce to parameter, which defined CIDR for to inbound traffic (ingress)
15
15
 
16
- **Actions**:
17
16
 
18
- * **Name**: `Name`
19
- * **Type**: "AWS::EC2::SecurityGroup"
20
- * **Properties.SecurityGroupIngress[0].CidrIp**: `IngressRef`
21
-
22
- ++close++
17
+ +++close+++
23
18
 
24
19
  }}
25
20
 
21
+ {{! +++fold-on+++ }}
22
+
23
+
26
24
  "{{Name}}" : {
27
25
  "Type" : "AWS::EC2::SecurityGroup",
28
26
  "Properties" : {
@@ -35,3 +33,5 @@ Create an EC2 Security Group
35
33
  } ]
36
34
  }
37
35
  }{{_comma}}
36
+
37
+ {{! +++fold-off+++ }}
@@ -1,8 +1,8 @@
1
1
  {{!
2
2
 
3
- ++start++
3
+ +++start+++
4
4
 
5
- ## <a id="resources.mustache"></a>resources.mustache <a class='navigator' href='#top'">[top]</a>
5
+ ## <a id="resources.mustache"></a>resources.mustache <a class='navigator' href='#top'>[top]</a>
6
6
 
7
7
  Empty template.
8
8
 
@@ -13,13 +13,16 @@ Empty template.
13
13
 
14
14
  **Actions**:
15
15
 
16
- * no action (i.e. empty template)
16
+ * no action (i.e. template commented out)
17
17
 
18
18
 
19
- ++close++
19
+ +++close+++
20
20
 
21
21
 
22
22
  }}
23
+
24
+ {{! +++fold-on+++ }}
25
+
23
26
  {{!
24
27
 
25
28
  Moved to YAML
@@ -32,4 +35,6 @@ Empty template.
32
35
  }
33
36
  }
34
37
 
35
- }}
38
+ }}
39
+
40
+ {{! +++fold-off+++ }}
data/demo/7/root.mustache CHANGED
@@ -6,7 +6,7 @@
6
6
  STYLE section
7
7
  ==================================================================
8
8
 
9
- ++start++
9
+ +++start+++
10
10
  <style>
11
11
  h1 {
12
12
  color:blue;
@@ -26,16 +26,32 @@ h3 {
26
26
  body {
27
27
  background-color: #b0c4de;
28
28
  }
29
+ /* Support fold-on/fold-off toggle */
30
+ div.fold {
31
+ width: 90%; padding: .42rem; border-radius: 5px; margin: 1rem;
32
+
33
+ }
34
+ div.fold div {
35
+ height: 0px; margin: .2rem; overflow: hidden;
36
+ }
37
+ div.toggle ~ div { height: 0px; margin: .2rem; overflow: hidden; }
38
+ input.toggle:checked ~ div {
39
+ height: auto;
40
+ color: white;
41
+ background: #c6a24b;
42
+ font-family: monospace;
43
+ white-space: pre;
44
+ }
29
45
  </style>
30
46
 
31
- ++close++
47
+ +++close+++
32
48
 
33
49
 
34
50
  ==================================================================
35
51
  CONTENT section
36
52
  ==================================================================
37
53
 
38
- ++start++
54
+ +++start+++
39
55
 
40
56
  # <a id="top">aws-must demo 7 template</a>
41
57
 
@@ -84,8 +100,7 @@ each template, it
84
100
  * documents the attribute context e.g. `.` or `./resources/Instance`,
85
101
  and attributes referenced within the template
86
102
 
87
- * lists template actions, i.e. output from template, or template
88
- inclusion
103
+ * checkbox to show template implementation
89
104
 
90
105
  ### Table of contents
91
106
  <ul>
@@ -129,7 +144,7 @@ to an</li><ul>
129
144
  response to describe stack calls </li> </ul>
130
145
 
131
146
 
132
- ## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'">[top]</a>
147
+ ## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'>[top]</a>
133
148
 
134
149
  Starting point of template rendering.
135
150
 
@@ -140,28 +155,12 @@ Starting point of template rendering.
140
155
  * `resources`: array of resource sub-documents for CloudFormation Resources -section
141
156
  * `outputs`: array of output sub-documents for CloudFormation Outputs -section
142
157
 
143
-
144
- **Actions**:
145
-
146
- * **Description**: `description`
147
- * **for** `parameter` **in** `parameters` **include** <a href="#parameter.mustache">parameter.mustache</a>
148
- * **include** <a href="#mappings.mustache">mappings.mustache</a>
149
- * **include** <a href="#resources.mustache">resources.mustache</a>
150
- * **for** `resource` **in** `resource` **include** <a href="#resource.mustache">resource.mustache</a>
151
- * **for** `output` **in** `outputs` **include** <a href="#output.mustache">output.mustache</a>
152
-
153
-
154
- > parameter
155
- > mappings
156
- > resources
157
- > resource
158
- > output
159
-
160
-
161
- ++close++
158
+ +++close+++
162
159
 
163
160
  }}
164
161
 
162
+ {{! +++fold-on+++ }}
163
+
165
164
  {
166
165
  "AWSTemplateFormatVersion" : "2010-09-09",
167
166
 
@@ -189,3 +188,30 @@ Starting point of template rendering.
189
188
  }
190
189
 
191
190
  }
191
+
192
+ {{! +++fold-off+++ }}
193
+
194
+
195
+ {{!
196
+
197
+ ==================================================================
198
+ INCLUDED templates
199
+ ==================================================================
200
+
201
+ +++start+++
202
+
203
+
204
+ > parameter
205
+ > mappings
206
+ > resources
207
+ > resource
208
+ > resourceInstance
209
+ > resourceSecurityGroup
210
+ > tag
211
+ > output
212
+
213
+
214
+ +++close+++
215
+
216
+ }}
217
+
data/demo/7/tag.mustache CHANGED
@@ -1,9 +1,9 @@
1
1
  {{!
2
2
 
3
3
 
4
- ++start++
4
+ +++start+++
5
5
 
6
- ## <a id="tag.mustache"></a>tag.mustache <a class='navigator' href='#top'">[top]</a>
6
+ ## <a id="tag.mustache"></a>tag.mustache <a class='navigator' href='#top'>[top]</a>
7
7
 
8
8
  One key-value pair in EC2 instance Tags -array
9
9
 
@@ -12,19 +12,15 @@ One key-value pair in EC2 instance Tags -array
12
12
  * `Key`: of the tag entry
13
13
  * `Value`: of the tag entry
14
14
 
15
- **Actions**:
16
15
 
17
- * **Key**: `Name`
18
- * **Value**: `Value`
19
-
20
-
21
-
22
- ++close++
16
+ +++close+++
23
17
 
24
18
 
25
19
 
26
20
  }}
27
21
 
28
- { "Key" : "{{Key}}", "Value" : "{{Value}}"{{_comma}} }
29
22
 
23
+ {{! +++fold-on+++ }}
24
+ { "Key" : "{{Key}}", "Value" : "{{Value}}"{{_comma}} }
25
+ {{! +++fold-off+++ }}
30
26