cfndsl 0.11.1 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2M3MmIxMWQyMTcxZjhhODJhYmYzZWM1OTdjZGM0ZmM3MGRlNzMyMQ==
4
+ NDEyMTg0ZmVkZjIxYjk2MjAxOGM0MDZiM2E2MDhlMTViYWYyOTMxZg==
5
5
  data.tar.gz: !binary |-
6
- MDU1ODE0NTk4OWM2NjIzZWZjMGQ4NDczN2NkOWZhMDUzMjkxNWZkYQ==
6
+ ZTY2MjdlMjY4N2VjMjMyNmYwNTk3NDM2ZjljY2MwN2MzMTliZjQ3MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzEwMGE0Y2RmZmMyNzhkNjM2MjVkMGQ3MjkxNDcyMDQyZmNlMThhZjIyYjkz
10
- MzBlZWVjYzllMTRjNDNkYmIzOWU5OTViNjI2ZjI5NWI4M2FhYTg0ZGM1MWEz
11
- MTAyY2ViYjI4MDMyZDYzMzdkZWZkZDRkZTgxYmJlMjBhN2RkNmY=
9
+ OWZiZDEzZGUyNWQ3MzdmZGIyZWUwODc5MmM1OTdhNjJiNjI4YWE4YTgwNTE0
10
+ OTIyY2EwYjllNjgyMDJmMWY1ZWY2NmI5NmNlMThlNGZhMjlhYzQxYzUxM2I4
11
+ YmUwZjczZjBkYzNhZTYyYWU1ZmVjMzY2MDVhOTJiN2ZkNzE0ODU=
12
12
  data.tar.gz: !binary |-
13
- MDc3MTRiOWZkNzk0MDFiYzQ5YmU0YjBjNmVjYzYwZGRjNTIxZDUxOWY0ZTUx
14
- NzA1NjNlN2ZmMjgzY2JjYjY0NGEwN2VmMGExZmUwYjNhNmE1OWVmNzJiZjU1
15
- MWFjOGU4N2E2NTg5Y2FmOWM3YWJiNjk1YTZmZmEzOGExZDBmMDI=
13
+ MTI5Mjk2OTJmMDRiZGVjY2E3YmFiNmEzNDFkZDUxNzhiNjBiZTFlNTllZDhl
14
+ NmZiN2Q1MjI1NTVhNWMxNDkwMzNlNDBjZTgxNWUzNDYxYjJiOTRkNDgwZjIy
15
+ ZDNkOTZkYTFmOTE2N2MxNzJkZjFlOGMwMjIxNTkyMTJiNzA2YjI=
data/.gitignore CHANGED
@@ -3,3 +3,5 @@
3
3
  Gemfile.lock
4
4
  tmp/
5
5
  coverage/
6
+ *.swp
7
+ *.swo
data/bin/cfndsl CHANGED
@@ -7,6 +7,7 @@ require 'json'
7
7
  options = {}
8
8
 
9
9
  optparse = OptionParser.new do |opts|
10
+ Version = CfnDsl::VERSION
10
11
  opts.banner = 'Usage: cfndsl [options] FILE'
11
12
 
12
13
  # Define the options, and what they do
@@ -16,6 +16,7 @@ require 'cfndsl/outputs'
16
16
  require 'cfndsl/aws/cloud_formation_template'
17
17
  require 'cfndsl/os/heat_template'
18
18
  require 'cfndsl/external_parameters'
19
+ require 'cfndsl/version'
19
20
 
20
21
  # CfnDsl
21
22
  module CfnDsl
@@ -544,6 +544,7 @@ Resources:
544
544
  VersionLabel: String
545
545
  "AWS::ElasticLoadBalancing::LoadBalancer" :
546
546
  Properties:
547
+ AccessLoggingPolicy: AccessLoggingPolicy
547
548
  AvailabilityZones: [String]
548
549
  CrossZone: Boolean
549
550
  HealthCheck: HealthCheck
@@ -610,6 +611,7 @@ Resources:
610
611
  AdvancedOptions: JSON
611
612
  DomainName: String
612
613
  EBSOptions: EBSOptions
614
+ ElasticsearchVersion: String
613
615
  ElasticsearchClusterConfig: ElasticsearchClusterConfig
614
616
  SnapshotOptions: SnapshotOptions
615
617
  Tags: [ ResourceTag ]
@@ -1149,6 +1151,11 @@ Types:
1149
1151
  AppCookieStickinessPolicy:
1150
1152
  CookieName: String
1151
1153
  PolicyName: String
1154
+ AccessLoggingPolicy:
1155
+ EmitInterval: Integer
1156
+ Enabled: Boolean
1157
+ S3BucketName: String
1158
+ S3BucketPrefix: String
1152
1159
  HealthCheck:
1153
1160
  HealthyThreshold: String
1154
1161
  Interval: String
@@ -4,7 +4,7 @@ module CfnDsl
4
4
  # Handles condition objects
5
5
  #
6
6
  # Usage:
7
- # Condition :ConditionName, FnEqual(Ref(:ParameterName), 'helloworld')
7
+ # Condition :ConditionName, FnEquals(Ref(:ParameterName), 'helloworld')
8
8
  class ConditionDefinition < JSONable
9
9
  include JSONSerialisableObject
10
10
 
@@ -53,7 +53,7 @@ module CfnDsl
53
53
  when /ya?ml/
54
54
  params = YAML.load_file fname
55
55
  when /json/
56
- params = JSON.load File.read(fname)
56
+ params = JSON.parse File.read(fname)
57
57
  else
58
58
  raise "Unrecognized extension #{format}"
59
59
  end
@@ -56,7 +56,11 @@ module CfnDsl
56
56
 
57
57
  # Equivalent to the Cloudformation template built in function Fn::Not
58
58
  def FnNot(value)
59
- Fn.new('Not', value)
59
+ if value.is_a?(Array)
60
+ Fn.new('Not', value)
61
+ else
62
+ Fn.new('Not', [value])
63
+ end
60
64
  end
61
65
 
62
66
  # Equivalent to the CloudFormation template built in function Fn::Or
@@ -76,17 +76,16 @@ module CfnDsl
76
76
 
77
77
  sname = CfnDsl::Plurals.singularize pname
78
78
 
79
- unless sname == pname
80
- resource.class_eval do
81
- CfnDsl.method_names(sname) do |method|
82
- define_method(method) do |value = nil, &block|
83
- @Properties ||= {}
84
- @Properties[pname] ||= PropertyDefinition.new([])
85
- value = pclass.new unless value
86
- @Properties[pname].value.push value
87
- value.instance_eval(&block) if block
88
- value
89
- end
79
+ return if sname == pname
80
+ resource.class_eval do
81
+ CfnDsl.method_names(sname) do |method|
82
+ define_method(method) do |value = nil, &block|
83
+ @Properties ||= {}
84
+ @Properties[pname] ||= PropertyDefinition.new([])
85
+ value = pclass.new unless value
86
+ @Properties[pname].value.push value
87
+ value.instance_eval(&block) if block
88
+ value
90
89
  end
91
90
  end
92
91
  end
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = '0.11.1'.freeze
2
+ VERSION = '0.11.3'.freeze
3
3
  end
@@ -154,6 +154,20 @@ describe CfnDsl::CloudFormationTemplate do
154
154
  expect(func.to_json).to eq('{"Fn::GetAZs":"reg"}')
155
155
  end
156
156
 
157
+ context 'FnNot', 'Array' do
158
+ it 'FnNot' do
159
+ func = subject.FnNot(['foo'])
160
+ expect(func.to_json).to eq('{"Fn::Not":["foo"]}')
161
+ end
162
+ end
163
+
164
+ context 'FnNot', 'String' do
165
+ it 'FnNot' do
166
+ func = subject.FnNot('foo')
167
+ expect(func.to_json).to eq('{"Fn::Not":["foo"]}')
168
+ end
169
+ end
170
+
157
171
  context 'FnFormat', 'String' do
158
172
  it 'formats correctly' do
159
173
  func = subject.FnFormat('abc%0def%1ghi%%x', '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.11.1
4
+ version: 0.11.3
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: 2016-09-05 00:00:00.000000000 Z
12
+ date: 2016-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler