cfndsl 0.7.0 → 0.8.1

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzBmYTE1Y2U0ZDJkZmY4OTg4MDI1NmIyMjQ0NTZiOGYxMzFmMjZhMg==
4
+ YWZmZjY5YzJjYTMwYzgyMGI4ODViNGViNTNiNjUxMWYwMzZmZTI3Nw==
5
5
  data.tar.gz: !binary |-
6
- MDgxYTVlNGExMDY5NGEwNzU1MDYzODVkYWMyMjdjYmUyYWIwYzNhMQ==
6
+ YjM0NDk0NzYxY2IzODc4NDdhMDJjYWJkMzUyZWU1OWJiOTJkMTc4Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTE0ZTcwNDNmMjRiZWFhOTQ0NTZhY2VhNjU5ZmJhMTBlZDY1NDg2ZjhlOTI3
10
- M2U3ODU2Njk2YzY1NWVjYWQwOWFhNDk5YzE0N2EzMjY2ZDQxOWRkM2Q1Mzdk
11
- OTY0ZTY5YTBjMmY3NTc0Yzk0MDMwNmU2ODllNTJkMzMzZWMyMzA=
9
+ MzM4Y2YwNzczMWYxNTA5NWRmYzI4ODFkMTNjOWNmMjkzNWY4M2MzZjllMmU4
10
+ ZjYwZTMwODE4YmFkODZlYjJmOWU5OWY0Njc5OThmZjkyZmIyNjQ2OTY2ZjY3
11
+ YjA2MDM5M2MyYjI5ZWI5NzM0Mzc4ODE1OWIwMGM4OGVlMjNiMzc=
12
12
  data.tar.gz: !binary |-
13
- YjhlM2NiYThlMGZkMmI5YzY0ZDg2ZTIzNjFmNWMxMjA3NzFmY2ZhMjdjZDVl
14
- ZWJlMDVhNzkwZjA4MjdmNWM1NzhmOTQxZDU3NTM1ZTdiNzBhMWE4NTQwZTAx
15
- MGUyY2NmZDA5MWZhMTMxMmM5MDA2OGZmNzlmMjQxMGJkMjk1ZmM=
13
+ YjgwNzk4MmU5MTAyOWIxNTc4OGE1YzU1MzVmMGEwYzNjZGVlMWRiNTI5MDdm
14
+ MjhjOTJmMjc3YzhjNGExMWMyN2IyZDA5MWNiMWRhZTIyMzljZDg0NTk0NzAw
15
+ MWM2MDZlN2E2ZmEwMDAzODNkMTdkY2MzM2IzY2FlMTkzZTc1NjU=
@@ -482,6 +482,15 @@ Resources:
482
482
  ElasticsearchClusterConfig: ElasticsearchClusterConfig
483
483
  SnapshotOptions: SnapshotOptions
484
484
  Tags: [ EC2Tag ]
485
+ "AWS::Events::Rule" :
486
+ Properties:
487
+ Description: String
488
+ EventPattern: JSON
489
+ Name: String
490
+ RoleArn: String
491
+ SchduleExpression: String
492
+ State: String
493
+ Targets: [ EventsRuleTarget ]
485
494
  "AWS::IAM::AccessKey" :
486
495
  Properties:
487
496
  Serial: Integer
@@ -751,6 +760,7 @@ Resources:
751
760
  "AWS::Route53::HealthCheck" :
752
761
  Properties:
753
762
  HealthCheckConfig: Route53HealthCheckConfig
763
+ HealthCheckTags: [ Route53HealthCheckTags ]
754
764
  "AWS::Route53::RecordSet" :
755
765
  Properties:
756
766
  HostedZoneId: String
@@ -1085,6 +1095,9 @@ Types:
1085
1095
  ResourcePath: String
1086
1096
  SearchString: String
1087
1097
  Type: String
1098
+ Route53HealthCheckTags:
1099
+ Key: String
1100
+ Value: String
1088
1101
  VpcSettings:
1089
1102
  SubnetIds: [ String ]
1090
1103
  VpcId: String
@@ -1212,3 +1225,8 @@ Types:
1212
1225
  VpcConfig:
1213
1226
  SecurityGroupIds: [ String ]
1214
1227
  SubnetIds: [ String ]
1228
+ EventsRuleTarget:
1229
+ Arn: String
1230
+ Id: String
1231
+ Input: String
1232
+ InputPath: String
@@ -6,12 +6,10 @@ module CfnDsl
6
6
  # Usage:
7
7
  # Condition :ConditionName, FnEqual(Ref(:ParameterName), 'helloworld')
8
8
  class ConditionDefinition < JSONable
9
+ include JSONSerialisableObject
10
+
9
11
  def initialize(value)
10
12
  @value = value
11
13
  end
12
-
13
- def to_json(*a)
14
- @value.to_json(*a)
15
- end
16
14
  end
17
15
  end
@@ -8,14 +8,12 @@ module CfnDsl
8
8
  # CreationPolicy('ResourceSignal', { 'Count' => 1, 'Timeout' => 'PT10M' })
9
9
  # }
10
10
  class CreationPolicyDefinition < JSONable
11
+ include JSONSerialisableObject
12
+
11
13
  attr_reader :value
12
14
 
13
15
  def initialize(value)
14
16
  @value = value
15
17
  end
16
-
17
- def to_json(*a)
18
- @value.to_json(*a)
19
- end
20
18
  end
21
19
  end
@@ -0,0 +1,12 @@
1
+ module CfnDsl
2
+ # JSONSerialisableObject
3
+ module JSONSerialisableObject
4
+ def as_json(_options = {})
5
+ @value
6
+ end
7
+
8
+ def to_json(*a)
9
+ as_json.to_json(*a)
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,6 @@
1
1
  require 'cfndsl/errors'
2
2
  require 'cfndsl/ref_check'
3
+ require 'cfndsl/json_serialisable_object'
3
4
 
4
5
  module CfnDsl
5
6
  # These functions are available anywhere inside
@@ -134,7 +135,7 @@ module CfnDsl
134
135
  # variables that begin with a single underscore are elided.
135
136
  # Instance variables that begin with two underscores have one of
136
137
  # them removed.
137
- def to_json(*a)
138
+ def as_json(_options = {})
138
139
  hash = {}
139
140
  instance_variables.each do |var|
140
141
  name = var[1..-1]
@@ -149,7 +150,11 @@ module CfnDsl
149
150
 
150
151
  hash[name] = instance_variable_get(var) if name
151
152
  end
152
- hash.to_json(*a)
153
+ hash
154
+ end
155
+
156
+ def to_json(*a)
157
+ as_json.to_json(*a)
153
158
  end
154
159
 
155
160
  def ref_children
@@ -186,10 +191,14 @@ module CfnDsl
186
191
  @_refs = refs
187
192
  end
188
193
 
189
- def to_json(*a)
194
+ def as_json(_options = {})
190
195
  hash = {}
191
196
  hash["Fn::#{@function}"] = @argument
192
- hash.to_json(*a)
197
+ hash
198
+ end
199
+
200
+ def to_json(*a)
201
+ as_json.to_json(*a)
193
202
  end
194
203
 
195
204
  def references
@@ -12,12 +12,10 @@ module CfnDsl
12
12
  # "ap-northeast-1" => { "32" => "ami-9c03a89d", "64" => "ami-a003a8a1" }
13
13
  # })
14
14
  class MappingDefinition < JSONable
15
+ include JSONSerialisableObject
16
+
15
17
  def initialize(value)
16
18
  @value = value
17
19
  end
18
-
19
- def to_json(*a)
20
- @value.to_json(*a)
21
- end
22
20
  end
23
21
  end
@@ -3,14 +3,12 @@ require 'cfndsl/jsonable'
3
3
  module CfnDsl
4
4
  # Handles Metadata objects
5
5
  class MetadataDefinition < JSONable
6
+ include JSONSerialisableObject
7
+
6
8
  attr_reader :value
7
9
 
8
10
  def initialize(value)
9
11
  @value = value
10
12
  end
11
-
12
- def to_json(*a)
13
- @value.to_json(*a)
14
- end
15
13
  end
16
14
  end
@@ -9,13 +9,12 @@ module CfnDsl
9
9
  # }
10
10
  #
11
11
  class PropertyDefinition < JSONable
12
+ include JSONSerialisableObject
13
+
12
14
  attr_reader :value
15
+
13
16
  def initialize(value)
14
17
  @value = value
15
18
  end
16
-
17
- def to_json(*a)
18
- @value.to_json(*a)
19
- end
20
19
  end
21
20
  end
@@ -13,13 +13,12 @@ module CfnDsl
13
13
  # }
14
14
  #
15
15
  class UpdatePolicyDefinition < JSONable
16
+ include JSONSerialisableObject
17
+
16
18
  attr_reader :value
19
+
17
20
  def initialize(value)
18
21
  @value = value
19
22
  end
20
-
21
- def to_json(*a)
22
- @value.to_json(*a)
23
- end
24
23
  end
25
24
  end
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end
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.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -52,6 +52,7 @@ files:
52
52
  - lib/cfndsl/errors.rb
53
53
  - lib/cfndsl/external_parameters.rb
54
54
  - lib/cfndsl/generate_types.rb
55
+ - lib/cfndsl/json_serialisable_object.rb
55
56
  - lib/cfndsl/jsonable.rb
56
57
  - lib/cfndsl/mappings.rb
57
58
  - lib/cfndsl/metadata.rb