cfhighlander 0.12.0 → 0.12.1.alpha.1589238004
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 +4 -4
- data/README.md +12 -3
- data/lib/cfhighlander.dsl.subcomponent.rb +9 -6
- data/lib/cfhighlander.version.rb +1 -1
- data/templates/cfndsl.component.template.erb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0a790344ca30bc58633601d8d0b9b8eede6b69663fa149405f7162ceb1e1b5b
|
4
|
+
data.tar.gz: 0aa482c8e3f726b92ef291216b68bf56acad55ffa764dc0e41575ef220e6b334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '030590a7fb1d3bfa411349b7fc2fb37c9806825ce6e6ac557b3052194691a5d496ac594de74ffa4eecc6f56537d7593a84ffcd8a65e974f990feb65cf642756a'
|
7
|
+
data.tar.gz: 91d9168c855c70fa0c34caf4bb7c6f6deae7b8e85615647f36f8e20fb5b10bc82e05b37835379d0f1fdbbedb0ea97ded3987e9cf7f4eb7d5d9c8a39bc46f58c5
|
data/README.md
CHANGED
@@ -448,7 +448,9 @@ end
|
|
448
448
|
|
449
449
|
**Conditional components** - If you want to add top level paramater as feature toggle for one of the inner
|
450
450
|
components, just mark it as conditional, using `conditional:` named parameter. In addition to this, default
|
451
|
-
value for feature toggle can be supplied using `enabled:` named parameter
|
451
|
+
value for feature toggle can be supplied using `enabled:` named parameter. Autogenerated parameter will be named
|
452
|
+
`Enable$COMPONENTNAME`, defaulting to `[true,false]` as set of allowed values. Autogenerated condition will
|
453
|
+
be named same as parameter, and checking if the parameter value equlas `true`
|
452
454
|
|
453
455
|
|
454
456
|
```ruby
|
@@ -469,16 +471,23 @@ end
|
|
469
471
|
|
470
472
|
```
|
471
473
|
|
472
|
-
**
|
474
|
+
**Override default behaviour** - If you have more than 1 stack you want to control with a single parameter, or you want to change
|
475
|
+
parameter name, you can supply the `condition:` option with a string value on each component you want to control with the condition.
|
476
|
+
Autogenerated condition can be overriden as well, by defining your own condition with the same name on the highlander
|
477
|
+
template, as in example below.
|
478
|
+
|
473
479
|
|
474
480
|
```ruby
|
475
481
|
CfhighlanderTemplate do
|
476
482
|
|
483
|
+
# [Optional - Define your own condition, instead of default true/false one]
|
484
|
+
Condition 'EnableDevelopmentResources', FnEquals(Ref(:EnvironmentName),'dev')
|
485
|
+
|
477
486
|
# Components always required
|
478
487
|
Component 'vpc'
|
479
488
|
Component name: 'ecs', template: 'ecs'
|
480
489
|
|
481
|
-
# Components only required in development environments
|
490
|
+
# Components only required in development environments with common condition name
|
482
491
|
Component name: 'linux-bastion', template: 'bastion', conditional: true, condition: 'EnableDevelopmentResources', enabled: false
|
483
492
|
Component name: 'windows-bastion', template: 'bastion', conditional: true, condition: 'EnableDevelopmentResources', enabled: false
|
484
493
|
|
@@ -95,12 +95,15 @@ module Cfhighlander
|
|
95
95
|
if @conditional
|
96
96
|
condition = "Enable#{@cfn_name}" if @condition.nil?
|
97
97
|
@condition = condition
|
98
|
-
@parent.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
98
|
+
parent_condition_defined = @parent.conditions.find {|c| c.name == @condition}
|
99
|
+
unless parent_condition_defined
|
100
|
+
@parent.Condition(condition, CfnDsl::Fn.new('Equals', [
|
101
|
+
CfnDsl::RefDefinition.new(condition),
|
102
|
+
'true'
|
103
|
+
]).to_json)
|
104
|
+
@parent.Parameters do
|
105
|
+
ComponentParam condition, enabled.to_s, allowedValues: %w(true false)
|
106
|
+
end
|
104
107
|
end
|
105
108
|
end
|
106
109
|
end
|
data/lib/cfhighlander.version.rb
CHANGED
@@ -17,7 +17,7 @@ CloudFormation do
|
|
17
17
|
CloudFormation_Stack('<%= @subcomponent.cfn_name %>') do
|
18
18
|
TemplateURL '<%= @subcomponent.distribution_url %>'
|
19
19
|
<%- if !@subcomponent.dependson.empty? %>
|
20
|
-
DependsOn <%=
|
20
|
+
DependsOn <%= @subcomponent.dependson %>
|
21
21
|
<%- end %>
|
22
22
|
Parameters ({
|
23
23
|
<% for @param in @subcomponent.parameters %><%="\t"%>'<%=@param.name %>' => <%= @param.cfndsl_value %>,
|
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.12.
|
4
|
+
version: 0.12.1.alpha.1589238004
|
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: 2020-
|
13
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|
@@ -277,9 +277,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- - "
|
280
|
+
- - ">"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
282
|
+
version: 1.3.1
|
283
283
|
requirements: []
|
284
284
|
rubyforge_project:
|
285
285
|
rubygems_version: 2.7.7
|