aws-must-templates 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +390 -0
  3. data/lib/aws-must-templates.rb +2 -0
  4. data/lib/tasks/cross-ref.rb +78 -0
  5. data/lib/tasks/suite.rake +292 -0
  6. data/lib/test-suites/test_suites.rb +115 -0
  7. data/mustache/commonCfnSignal.mustache +34 -0
  8. data/mustache/commonCreationPolicy.mustache +33 -0
  9. data/mustache/commonDependsOn.mustache +25 -0
  10. data/mustache/commonInstanceType.mustache +27 -0
  11. data/mustache/commonKeyValue.mustache +28 -0
  12. data/mustache/commonStackRef.mustache +23 -0
  13. data/mustache/commonValue.mustache +34 -0
  14. data/mustache/initializeCFinit.mustache +27 -0
  15. data/mustache/initializeCFtools.mustache +27 -0
  16. data/mustache/initializeCfnInitHupFiles.mustache +85 -0
  17. data/mustache/initializeInstallAwsCli.mustache +32 -0
  18. data/mustache/initializeInstallChef.mustache +37 -0
  19. data/mustache/initializeProvisionChefZero.mustache +36 -0
  20. data/mustache/initializeStartCfnHup.mustache +25 -0
  21. data/mustache/mapping.mustache +27 -0
  22. data/mustache/mappingSubnetConfig.mustache +27 -0
  23. data/mustache/mappings.mustache +71 -0
  24. data/mustache/output.mustache +38 -0
  25. data/mustache/parameter.mustache +35 -0
  26. data/mustache/resource.mustache +51 -0
  27. data/mustache/resourceInstance.mustache +52 -0
  28. data/mustache/resourceInstanceInitialize.mustache +120 -0
  29. data/mustache/resourceInstanceMetadata.mustache +65 -0
  30. data/mustache/resourceInstanceProfile.mustache +34 -0
  31. data/mustache/resourceInternetGateway.mustache +87 -0
  32. data/mustache/resourcePolicy.mustache +50 -0
  33. data/mustache/resourceProvisionChef.mustache +38 -0
  34. data/mustache/resourceRole.mustache +40 -0
  35. data/mustache/resourceS3Bucket.mustache +39 -0
  36. data/mustache/resourceSecurityGroup.mustache +46 -0
  37. data/mustache/resourceStack.mustache +45 -0
  38. data/mustache/resourceSubnet.mustache +41 -0
  39. data/mustache/resourceUser.mustache +58 -0
  40. data/mustache/resourceVPC.mustache +44 -0
  41. data/mustache/resourceWait.mustache +39 -0
  42. data/mustache/resources.mustache +65 -0
  43. data/mustache/root.mustache +244 -0
  44. data/mustache/tag.mustache +27 -0
  45. data/pics/test-suites.jpg +0 -0
  46. metadata +146 -0
@@ -0,0 +1,65 @@
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
+
15
+ +++close+++
16
+
17
+
18
+ }}
19
+ {{! +++fold-on+++ }}
20
+
21
+ {{!
22
+
23
+ "S3AccessRole" : {
24
+ "Type" : "AWS::IAM::Role",
25
+ "Properties" : {
26
+ "AssumeRolePolicyDocument" : {
27
+ "Statement" : [ {
28
+ "Effect" : "Allow",
29
+ "Principal" : {
30
+ "Service" : [ "ec2.amazonaws.com" ]
31
+ },
32
+ "Action" : [ "sts:AssumeRole" ]
33
+ } ]
34
+ },
35
+ "Path" : "/"
36
+ }
37
+ },
38
+
39
+
40
+ "S3RolePolicies" : {
41
+ "Type" : "AWS::IAM::Policy",
42
+ "Properties" : {
43
+ "PolicyName" : "s3access",
44
+ "PolicyDocument" : {
45
+ "Statement" : [ {
46
+ "Effect" : "Allow",
47
+ "Action" : "s3:*",
48
+ "Resource" : "*"
49
+ }]
50
+ },
51
+ "Roles" : [ { "Ref" : "S3AccessRole" } ]
52
+ }
53
+ },
54
+
55
+ "S3InstanceProfile" : {
56
+ "Type" : "AWS::IAM::InstanceProfile",
57
+ "Properties" : {
58
+ "Path" : "/",
59
+ "Roles" : [ { "Ref" : "S3AccessRole" } ]
60
+ }
61
+ },
62
+
63
+ }}
64
+
65
+ {{! +++fold-off+++ }}
@@ -0,0 +1,244 @@
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
+ /* 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
+ }
45
+ </style>
46
+
47
+ +++close+++
48
+
49
+
50
+ ==================================================================
51
+ CONTENT section
52
+ ==================================================================
53
+
54
+ +++start+++
55
+
56
+ # <a id="top"/><a href="https://github.com/jarjuk/aws-must-templates">aws-must-templates</a>
57
+
58
+ Templates for `aws-must` tool.
59
+
60
+ ## Table of contents
61
+
62
+ <ul>
63
+
64
+ <li><a href="#root.mustache">root.mustache</a>: root template = starting point of template rendering</li>
65
+
66
+ <li><a href="#parameter.mustache">parameter.mustache</a>: create one parameter entry to CloudFormation JSON parameter section</li>
67
+
68
+ <li><a href="#mappings.mustache">mappings.mustache</a>: matches a key to a corresponding set of named values</li>
69
+
70
+ <li><a href="#mappingSubnetConfig.mustache">mappingSubnetConfig.mustache</a>: subnet config mapping to map VPC/Public/Private key to CIDR subnet block.</li>
71
+
72
+ <li><a href="#resource.mustache">resource.mustache</a>: dispatch resource based on resource type</li>
73
+
74
+ <ul>
75
+
76
+ <li><a href="#resourceSecurityGroup.mustache">resourceSecurityGroup.mustache</a>: create an security group for accessing EC2 instances</li>
77
+
78
+ <li><a href="#resourceS3Bucket.mustache">resourceS3Bucket.mustache</a>: create an S3 Bucket</li>
79
+
80
+ <li><a href="#resourceRole.mustache">resourceRole.mustache</a>: AWS Identity and Access Management (IAM) role.</li>
81
+
82
+ <li><a href="#resourcePolicy.mustache">resourcePolicy.mustache</a>: lists permissions to be assigned to a user, group, role, or resource</li>
83
+
84
+ <li><a href="#resourceWait.mustache">resourceWait.mustache</a>: Creates a WaitHandle, and a WaitCondition on a resource `DependsOn`</li>
85
+
86
+ <li><a href="#resourceVPC.mustache">resourceVPC.mustache</a>: Creates a Virtual Private Cloud (VPC) with a CIDR block</li>
87
+
88
+ <li><a href="#resourceSubnet.mustache">resourceSubnet.mustache</a>: Creates a subnet in an existing VPC</li>
89
+
90
+ <li><a href="#resourceInternetGateway.mustache">resourceInternetGateway.mustache</a>: a new Internet gateway in your AWS account</li>
91
+
92
+ <li><a href="#resourceUser.mustache">resourceUser.mustache</a>: Creates User and AccessKey resources. User resource is associated with a fixed policy</li>
93
+
94
+ <li><a href="#resourceStack.mustache">resourceStack.mustache</a>: Nests a stack as a resource in a top-level template.</li>
95
+
96
+ <li><a href="#resourceInstanceProfile.mustache">resourceInstanceProfile.mustache</a>: a container for an IAM role and enables you to pass role information to an Amazon EC2 instance when the instance starts</li>
97
+
98
+ <li><a href="#resourceInstance.mustache">resourceInstance.mustache</a>: create an EC2 instance</li>
99
+
100
+ <ul>
101
+
102
+ <li><a href="#tag.mustache">tag.mustache</a>: add key-value tag property to an</li>
103
+
104
+ <li><a href="#resourceInstanceInitialize.mustache">resourceInstanceInitialize.mustache</a>: user-data script</li>
105
+
106
+ <li><a href="#initializeInstallChef.mustache">initializeInstallChef.mustache</a>: UserData -script to install Chef</li>
107
+
108
+ <li><a href="#initializeInstallAwsCli.mustache">initializeInstallAwsCli.mustache</a>: UserData -script to install AwsCli</li>
109
+
110
+ <li><a href="#initializeProvisionChef.mustache">initializeProvisionChef.mustache</a>: UserData -script to provision Chef</li>
111
+
112
+ <li><a href="#initializeCFtools.mustache">initializeCFtools.mustache</a>: Ubuntu CloudFormation Tools installation snippet</li>
113
+
114
+ </ul> <!-- resoureceInstance sub-templates -->
115
+
116
+ </ul> <!-- resource.mustache -->
117
+
118
+ <li><a href="#output.mustache">output.mustache</a>: values in response to describe stack calls </li>
119
+
120
+ <li>Common templates</li>
121
+
122
+ <ul>
123
+
124
+ <li><a href="#commonInstanceType.mustache">commonInstanceType.mustache</a>: Output value for `InstanceType` -attribute</li>
125
+
126
+ <li><a href="#commonValue.mustache">commonValue.mustache</a>: Common template to output value (Value/Ref/Attr/StackRef)</li>
127
+
128
+ <li><a href="#commonKeyValue.mustache">commonKeyValue.mustache</a>: Common template output key value pairs</li>
129
+
130
+ <li> <a href="#commonDependsOn.mustache">commonDependsOn.mustache</a>: </li>
131
+
132
+ <li> <a href="#commonCreationPolicy.mustache">commonCreationPolicy.mustache</a>: </li>
133
+
134
+ <li> <a href="#commonCfnSignal.mustache">commonCfnSignal.mustache</a>: </li>
135
+
136
+ <li> <a href="#commonStackRef.mustache">commonStackRef.mustache</a>: </li>
137
+
138
+ </ul>
139
+
140
+ </ul>
141
+
142
+ ## <a id="root.mustache"></a>root.mustache <a class='navigator' href='#top'>[top]</a>
143
+
144
+ Starting point of template rendering.
145
+
146
+ **Attributes**: context= `.`
147
+
148
+ * `description`: description for the CF template
149
+ * `parameters`: array of parameter sub-documents for CloudFormation Parameters -section
150
+ * `resources`: array of resource sub-documents for CloudFormation Resources -section
151
+ * `outputs`: array of output sub-documents for CloudFormation Outputs -section
152
+
153
+ +++close+++
154
+
155
+ }}
156
+
157
+ {{! +++fold-on+++ }}
158
+
159
+ {
160
+ "AWSTemplateFormatVersion" : "2010-09-09",
161
+
162
+ "Description" : "{{description}}",
163
+
164
+ "Parameters" : {
165
+ {{# parameters }}{{> parameter }}{{/ parameters }}
166
+ },
167
+
168
+ "Mappings" : {
169
+ {{> mappings }}
170
+ {{# mappings.length }},{{/ mappings.length }}
171
+ {{# mappings }}{{> mapping }}{{/ mappings }}
172
+ },
173
+
174
+ "Resources" : {
175
+
176
+ {{> resources }}
177
+ {{# resources }}{{> resource }}{{/ resources }}
178
+
179
+ },
180
+
181
+ "Outputs" : {
182
+
183
+ {{# outputs }}{{> output }}{{/ outputs }}
184
+
185
+ }
186
+
187
+ }
188
+
189
+ {{! +++fold-off+++ }}
190
+
191
+
192
+
193
+ {{!
194
+
195
+ ==================================================================
196
+ INCLUDED templates
197
+ ==================================================================
198
+
199
+ +++start+++
200
+
201
+ > parameter
202
+ > mappings
203
+ > mapping
204
+ > mappingSubnetConfig
205
+
206
+ > resources
207
+ > resource
208
+ > resourceInstance
209
+
210
+ > tag
211
+ > resourceInstanceMetadata
212
+ > resourceInstanceInitialize
213
+ > initializeInstallChef
214
+ > initializeInstallAwsCli
215
+ > initializeProvisionChefZero
216
+ > initializeCFtools
217
+
218
+ > resourceSecurityGroup
219
+ > resourceS3Bucket
220
+ > resourceRole
221
+ > resourceInstanceProfile
222
+ > resourcePolicy
223
+ > resourceStack
224
+ > resourceWait
225
+ > resourceVPC
226
+ > resourceSubnet
227
+ > resourceInternetGateway
228
+ > resourceUser
229
+
230
+ > output
231
+
232
+ > commonDependsOn
233
+ > commonInstanceType
234
+ > commonCreationPolicy
235
+ > commonCfnSignal
236
+ > commonValue
237
+ > commonKeyValue
238
+ > commonStackRef
239
+
240
+ +++close+++
241
+
242
+ }}
243
+
244
+
@@ -0,0 +1,27 @@
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
+ +++close+++
16
+
17
+
18
+
19
+ }}
20
+
21
+ {{! +++fold-on+++ }}
22
+
23
+ { "Key" : "{{Key}}", "Value" : "{{Value}}"{{_comma}} }
24
+
25
+ {{! +++fold-off+++ }}
26
+
27
+
Binary file
metadata ADDED
@@ -0,0 +1,146 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-must-templates
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - jarjuk
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-must
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.13
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.13
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 10.4.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 10.4.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.3.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.3.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: serverspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2.21.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 2.21.1
69
+ description: |2
70
+ Set of extensible templates for [aws-must](https://github.com/jarjuk/aws-must) tool to generate
71
+ CloudFormation JSON from a YAML configuration, and a
72
+ Test Runner for validating correctness of CloudFormation stacks provisioned.
73
+ email:
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - README.md
79
+ - lib/aws-must-templates.rb
80
+ - lib/tasks/cross-ref.rb
81
+ - lib/tasks/suite.rake
82
+ - lib/test-suites/test_suites.rb
83
+ - mustache/commonCfnSignal.mustache
84
+ - mustache/commonCreationPolicy.mustache
85
+ - mustache/commonDependsOn.mustache
86
+ - mustache/commonInstanceType.mustache
87
+ - mustache/commonKeyValue.mustache
88
+ - mustache/commonStackRef.mustache
89
+ - mustache/commonValue.mustache
90
+ - mustache/initializeCFinit.mustache
91
+ - mustache/initializeCFtools.mustache
92
+ - mustache/initializeCfnInitHupFiles.mustache
93
+ - mustache/initializeInstallAwsCli.mustache
94
+ - mustache/initializeInstallChef.mustache
95
+ - mustache/initializeProvisionChefZero.mustache
96
+ - mustache/initializeStartCfnHup.mustache
97
+ - mustache/mapping.mustache
98
+ - mustache/mappingSubnetConfig.mustache
99
+ - mustache/mappings.mustache
100
+ - mustache/output.mustache
101
+ - mustache/parameter.mustache
102
+ - mustache/resource.mustache
103
+ - mustache/resourceInstance.mustache
104
+ - mustache/resourceInstanceInitialize.mustache
105
+ - mustache/resourceInstanceMetadata.mustache
106
+ - mustache/resourceInstanceProfile.mustache
107
+ - mustache/resourceInternetGateway.mustache
108
+ - mustache/resourcePolicy.mustache
109
+ - mustache/resourceProvisionChef.mustache
110
+ - mustache/resourceRole.mustache
111
+ - mustache/resourceS3Bucket.mustache
112
+ - mustache/resourceSecurityGroup.mustache
113
+ - mustache/resourceStack.mustache
114
+ - mustache/resourceSubnet.mustache
115
+ - mustache/resourceUser.mustache
116
+ - mustache/resourceVPC.mustache
117
+ - mustache/resourceWait.mustache
118
+ - mustache/resources.mustache
119
+ - mustache/root.mustache
120
+ - mustache/tag.mustache
121
+ - pics/test-suites.jpg
122
+ homepage:
123
+ licenses:
124
+ - MIT
125
+ metadata: {}
126
+ post_install_message:
127
+ rdoc_options: []
128
+ require_paths:
129
+ - lib
130
+ required_ruby_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ requirements: []
141
+ rubyforge_project:
142
+ rubygems_version: 2.2.2
143
+ signing_key:
144
+ specification_version: 4
145
+ summary: Amazon Cloudformation templates for aws-must'
146
+ test_files: []