cfndsl 0.3.1 → 0.3.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 +8 -8
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/lib/cfndsl/CloudFormationTemplate.rb +2 -2
- data/lib/cfndsl/Types.rb +1 -1
- data/lib/cfndsl/aws_types.yaml +15 -0
- data/lib/cfndsl/version.rb +1 -1
- data/sample/s3.rb +46 -0
- data/spec/cfndsl_spec.rb +26 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmEzYWFkNWUxNGEwYzE5MDFkYTczOWUzNTk4NDIyZmE0ODM3NTI0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTZlMzMxMmQ0NGQ2NjM4NjdjNDRmMmM1NzA3NDZiNTYzOTM0MzZjOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGIzZWZiZjFiMDdlMTAwNzdjYzk5NGQ0N2VjZTQ2NDQxNTQ0OGM4NTMyMGIy
|
10
|
+
MDA0ZDA4MTI5MTRjZGE2OGNhMmFlZjAxNmY5ZWY4OGZkZTI4MzRkNWIzMWJh
|
11
|
+
NjgzZGYyODczNzdiMWEzY2RhMWFhMTVkMThmZWJmZjhlMDQwNGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjRiNDFjZDFhNDA0ZmU0NDAwYjY1ZTAxNjQxNzhlMDAzYjc5MzA0ZDg3NWJh
|
14
|
+
YzUyNmQ3MmZjYWIzZmQ5M2EzOWNiNjA3MTU3NTM2NDNiYTQwYzZlYTU0MDQy
|
15
|
+
NWYxNzcxNWM2M2YwZDMyNDY0NDZhNjZhMjA2MThhZjA4MDlkYTc=
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -90,7 +90,7 @@ module CfnDsl
|
|
90
90
|
values.push create_klass.new
|
91
91
|
end
|
92
92
|
@Properties ||= {}
|
93
|
-
@Properties[pname]
|
93
|
+
@Properties[pname] = CfnDsl::PropertyDefinition.new( *values )
|
94
94
|
@Properties[pname].value.instance_eval &block if block
|
95
95
|
@Properties[pname].value
|
96
96
|
end
|
@@ -192,7 +192,7 @@ module CfnDsl
|
|
192
192
|
values.push create_klass.new
|
193
193
|
end
|
194
194
|
@Properties ||= {}
|
195
|
-
@Properties[pname]
|
195
|
+
@Properties[pname] = CfnDsl::PropertyDefinition.new( *values )
|
196
196
|
@Properties[pname].value.instance_eval &block if block
|
197
197
|
@Properties[pname].value
|
198
198
|
end
|
data/lib/cfndsl/Types.rb
CHANGED
data/lib/cfndsl/aws_types.yaml
CHANGED
@@ -660,6 +660,7 @@ Resources:
|
|
660
660
|
BucketName: String
|
661
661
|
AccessControl: String
|
662
662
|
LifecycleConfiguration: JSON
|
663
|
+
NotificationConfiguration: S3NotificationConfiguration
|
663
664
|
VersioningConfiguration: JSON
|
664
665
|
WebsiteConfiguration: JSON
|
665
666
|
Tags: [ EC2Tag ]
|
@@ -1006,3 +1007,17 @@ Types:
|
|
1006
1007
|
Key: String
|
1007
1008
|
Type: String
|
1008
1009
|
Value: String
|
1010
|
+
S3NotificationConfiguration:
|
1011
|
+
LambdaConfigurations: [ S3NotificationLambdaConfiguration ]
|
1012
|
+
QueueConfigurations: [ S3NotificationQueueConfiguration ]
|
1013
|
+
TopicConfigurations: [ S3NotificationTopicConfiguration ]
|
1014
|
+
S3NotificationLambdaConfiguration:
|
1015
|
+
Event: String
|
1016
|
+
Function: String
|
1017
|
+
S3NotificationQueueConfiguration:
|
1018
|
+
Event: String
|
1019
|
+
Queue: String
|
1020
|
+
S3NotificationTopicConfiguration:
|
1021
|
+
Event: String
|
1022
|
+
Topic: String
|
1023
|
+
|
data/lib/cfndsl/version.rb
CHANGED
data/sample/s3.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
CloudFormation {
|
2
|
+
S3_Bucket('Bucket') {
|
3
|
+
BucketName 'MyBucket'
|
4
|
+
VersioningConfiguration(Status: 'Enabled')
|
5
|
+
NotificationConfiguration(
|
6
|
+
LambdaConfigurations: [
|
7
|
+
{
|
8
|
+
Function: 'MyLambdaFunction',
|
9
|
+
Event: 'S3:ObjectCreated:*'
|
10
|
+
},
|
11
|
+
{
|
12
|
+
Function: 'MyLambdaFunction',
|
13
|
+
Event: 's3:ObjectRemoved:*'
|
14
|
+
}
|
15
|
+
],
|
16
|
+
QueueConfigurations: [
|
17
|
+
{
|
18
|
+
Queue: 'SQSQueue',
|
19
|
+
Event: 'S3:ObjectCreated:*'
|
20
|
+
}
|
21
|
+
],
|
22
|
+
TopicConfigurations: [
|
23
|
+
{
|
24
|
+
Topic: 'SNSTopic',
|
25
|
+
Event: 'S3:ObjectCreated:*'
|
26
|
+
}
|
27
|
+
]
|
28
|
+
)
|
29
|
+
WebsiteConfiguration(
|
30
|
+
ErrorDocument: 'error.htm',
|
31
|
+
IndexDocument: 'index.htm',
|
32
|
+
RoutingRules: [
|
33
|
+
{
|
34
|
+
RoutingRuleCondition: {
|
35
|
+
HttpErrorCodeReturnedEquals: "404",
|
36
|
+
KeyPrefixEquals: "out1/"
|
37
|
+
},
|
38
|
+
RedirectRule: {
|
39
|
+
HostName: "ec2-11-22-333-44.compute-1.amazonaws.com",
|
40
|
+
ReplaceKeyPrefixWith: "report-404/"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
]
|
44
|
+
)
|
45
|
+
}
|
46
|
+
}
|
data/spec/cfndsl_spec.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
+
describe CfnDsl::HeatTemplate do
|
4
|
+
it 'honors last-set value for non-array properties' do
|
5
|
+
spec = self
|
6
|
+
subject.declare do
|
7
|
+
Server('myserver') do
|
8
|
+
flavor 'foo'
|
9
|
+
flavor 'bar'
|
10
|
+
f = @Properties['flavor'].value
|
11
|
+
spec.expect(f).to spec.eq('bar')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
describe CfnDsl::CloudFormationTemplate do
|
4
18
|
|
5
19
|
it 'populates an empty template' do
|
@@ -82,6 +96,18 @@ describe CfnDsl::CloudFormationTemplate do
|
|
82
96
|
end
|
83
97
|
end
|
84
98
|
|
99
|
+
it 'honors last-set value for non-array properties' do
|
100
|
+
spec = self
|
101
|
+
subject.declare do
|
102
|
+
EC2_Instance('myserver') do
|
103
|
+
InstanceType 'foo'
|
104
|
+
InstanceType 'bar'
|
105
|
+
f = @Properties['InstanceType'].value
|
106
|
+
spec.expect(f).to spec.eq('bar')
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
85
111
|
context 'built-in functions' do
|
86
112
|
it 'FnGetAtt' do
|
87
113
|
func = subject.FnGetAtt('A', 'B')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfndsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- sample/circular.rb
|
71
71
|
- sample/codedeploy.rb
|
72
72
|
- sample/ecs.rb
|
73
|
+
- sample/s3.rb
|
73
74
|
- sample/t1.rb
|
74
75
|
- sample/t1.yaml
|
75
76
|
- sample/vpc-example.rb
|