cfhighlander 0.10.2 → 0.10.3.alpha.1573687402

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5143dd699f0fb0fd62f443c4b41db67524195ecc1de878256f085853504eadbf
4
- data.tar.gz: 491fdeb598b8f4b465c510fc95b6f379dd522c66a812cce6c96aa383c5dc3b6b
3
+ metadata.gz: ddd4325d7d26aaf2f8f2d3e3e90284a012e491b153e8fb07cc64c5f553a37e61
4
+ data.tar.gz: c48037466e7dd5153639a42a003c55da69d4db400655df018fa01f62fd3c8d34
5
5
  SHA512:
6
- metadata.gz: 9571ae503658277d36c452171f7eac4203200db27f5963c96cd3b1ad5fc25419e02e62b46a138ecbd2fa39c89830caf326252c4c46c5de1dd7cc732bb85b7f0c
7
- data.tar.gz: f11b58ec128d798663cc70f4779bc36f29229a27e5dd81213c27a7219844dcea0e9cebbe8a7622cef34cde8d4e1124f17fc78f1be2a798ec21291ea2e5485c1d
6
+ metadata.gz: 6ae5cdc62fd7e4ef32bd0bc14436096698dc4487ef2a94e5e368fc2c793f13208740fa754c3add9be64a1daa1c601d0d6498305b2eda6239379bec9ace2f3d90
7
+ data.tar.gz: d9650faf9df8ade710a97b9c2c68af0ee671cd62ed5fbbd8939171d5e19239f63a0e006f52ac18f4505f4c187ac695115736fa9bbfe1c96db51f4847ec26c562
data/README.md CHANGED
@@ -613,6 +613,26 @@ end
613
613
 
614
614
  ```
615
615
 
616
+ #### Overriding Parameter Properties
617
+
618
+ Components have pre defined parameters with properties such as Type, AllowedValues, NoEcho etc.
619
+ These properties can be overridden on the parent component.
620
+
621
+ ```ruby
622
+ CfhighlanderTemplate do
623
+
624
+ Paramater do
625
+ ComponentParam 'EnvironmentType', 'development', allowedValues: ['development','alpha','production']
626
+ end
627
+
628
+ Component 'ecs' do
629
+ parameter name: 'EnvironmentType', allowedValues: ['development','alpha','production']
630
+ parameter name: 'Ami', value: '/ssm/path/Ami', type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
631
+ end
632
+
633
+ end
634
+ ```
635
+
616
636
 
617
637
  #### MappingParam
618
638
 
@@ -132,14 +132,37 @@ module Cfhighlander
132
132
  @component_loaded.load @component_config_override
133
133
  end
134
134
 
135
- def parameter(name:, value:)
135
+ def parameter(name:, value: '', defaultValue: nil, type: nil, noEcho: nil, allowedValues: nil, allowedPattern: nil,
136
+ maxLength: nil, maxValue: nil, minLength: nil, minValue: nil)
136
137
  existing_params = @component_loaded.highlander_dsl.parameters.param_list
137
- param_exists = existing_params.find { |p| p.name == name}
138
- if (not param_exists)
138
+ parameter = existing_params.find { |p| p.name == name}
139
+
140
+ if !parameter
141
+ param_ovr = {}
142
+ param_ovr[:type] = type.nil? ? 'String' : type
143
+ param_ovr[:noEcho] = noEcho unless noEcho.nil?
144
+ param_ovr[:allowedValues] = allowedValues unless allowedValues.nil?
145
+ param_ovr[:allowedPattern] = allowedPattern unless allowedPattern.nil?
146
+ param_ovr[:maxLength] = maxLength unless maxLength.nil?
147
+ param_ovr[:maxValue] = maxValue unless maxValue.nil?
148
+ param_ovr[:minLength] = minLength unless minLength.nil?
149
+ param_ovr[:minValue] = minValue unless minValue.nil?
150
+
139
151
  @component_loaded.highlander_dsl.Parameters do
140
- ComponentParam name, '', type: 'String'
152
+ ComponentParam name, value, param_ovr
141
153
  end
154
+ else
155
+ parameter.default_value = defaultValue unless defaultValue.nil?
156
+ parameter.type unless type.nil?
157
+ parameter.no_echo = noEcho unless noEcho.nil?
158
+ parameter.allowed_values = allowedValues unless allowedValues.nil?
159
+ parameter.allowed_pattern = allowedPattern unless allowedPattern.nil?
160
+ parameter.max_length = maxLength unless maxLength.nil?
161
+ parameter.max_value = maxValue unless maxValue.nil?
162
+ parameter.min_length = minLength unless minLength.nil?
163
+ parameter.min_value = minValue unless minValue.nil?
142
164
  end
165
+
143
166
  @param_values[name] = value
144
167
  end
145
168
 
@@ -1,3 +1,3 @@
1
1
  module Cfhighlander
2
- VERSION="0.10.2".freeze
2
+ VERSION="0.10.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfhighlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3.alpha.1573687402
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Tosic
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-11-06 00:00:00.000000000 Z
13
+ date: 2019-11-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -271,9 +271,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
271
  version: '0'
272
272
  required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  requirements:
274
- - - ">="
274
+ - - ">"
275
275
  - !ruby/object:Gem::Version
276
- version: '0'
276
+ version: 1.3.1
277
277
  requirements: []
278
278
  rubyforge_project:
279
279
  rubygems_version: 2.7.7