cfhighlander 0.10.1.alpha.1571347461 → 0.10.1.alpha.1571413903

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: 5afd75e86b22b38f3d4595bd062ec4f9cf770f27ae4a871cdc8188f345543196
4
- data.tar.gz: 3d18264800b3532026e92db532d8650f1e08add402a52525023ac6caf5911552
3
+ metadata.gz: 3e246b9fc914f854d4976016fea26ccc89dda5574a709bbd5ba5c18bded1717d
4
+ data.tar.gz: 9b5e58dd0280bd9b2c3362c6e6b9e15001b4862e1a03d2691f98c5fd1d0b2332
5
5
  SHA512:
6
- metadata.gz: 3013704d4f4b132b8424c3dc26e8e0311ba19ee3000d8f3494bfddcb99d5d48446ac7252510f666b74da1956ed6f22a454bb1399171b95158a9c76e9cd612c69
7
- data.tar.gz: 6782376d9eee135875ddc0e358cd6ca0dffc4b2cf8edf90f3001e2c5dad88de0360dae042ce45cbc56b0e2b5f925e523fe3a8aeb6cc7371137b33733dc2e7abf
6
+ metadata.gz: 5811cfab3fd0326f90a57fe8868fc6826a23f8968f9d8df33d0164b58a9d16bdaedd0a8d00c0b4597203a367b70cd747146e0a82db902cc3335fa7d8145f1a30
7
+ data.tar.gz: fb2a829a5299da15f0f09482c18a35f7632ae41b5b96d15a4c30b6ef2855cdb3af59da25a8e65bbbb53ca76eea0f39f190a2f946b235e900693089ac95278e62
data/README.md CHANGED
@@ -651,6 +651,19 @@ end
651
651
  Will include any cfndsl libraries present and exported in vpc template
652
652
  so extension methods can be consumed within cfndsl template.
653
653
 
654
+ ### Component dependson
655
+
656
+ If you require dependencies between nest stacks, this can be defined in the component by using the `dependson` attribute with the value of the depend component names. This will take an array of component names or a string with a single component name. This adds the cloudformation `DependsOn` property to the stack resource in the master template.
657
+
658
+ ```ruby
659
+ CfhighlanderTemplate do
660
+ Name 'test'
661
+ Component name: 'vpc', template: 'vpc'
662
+ Component name: 'bastion', template: 'bastion'
663
+ Component name: 'ecs', template: 'ecs', dependson: ['vpc','bastion']
664
+ end
665
+ ```
666
+
654
667
  ### LambdaFunctions
655
668
 
656
669
 
@@ -34,7 +34,8 @@ module Cfhighlander
34
34
  :name,
35
35
  :template,
36
36
  :template_version,
37
- :inlined
37
+ :inlined,
38
+ :dependson
38
39
 
39
40
  def initialize(parent,
40
41
  name,
@@ -45,6 +46,7 @@ module Cfhighlander
45
46
  export_config = {},
46
47
  conditional = false,
47
48
  enabled = true,
49
+ dependson = [],
48
50
  inline = false,
49
51
  distribution_format = 'yaml')
50
52
 
@@ -53,8 +55,9 @@ module Cfhighlander
53
55
  @export_config = export_config
54
56
  @component_sources = component_sources
55
57
  @conditional = conditional
58
+ @dependson = [*dependson]
56
59
  @inlined = inline
57
-
60
+
58
61
  template_name = template
59
62
  template_version = 'latest'
60
63
  if template.include?('@') and not (template.start_with? 'git')
@@ -118,6 +118,7 @@ module Cfhighlander
118
118
  export_config: {},
119
119
  conditional: false,
120
120
  enabled: true,
121
+ dependson: [],
121
122
  render: Cfhighlander::Model::Component::Substack,
122
123
  &block)
123
124
  puts "INFO: Requested subcomponent #{name} with template #{template}"
@@ -129,7 +130,7 @@ module Cfhighlander
129
130
  end
130
131
 
131
132
  name = template if name.nil?
132
-
133
+
133
134
  # load component
134
135
  component = Cfhighlander::Dsl::Subcomponent.new(self,
135
136
  name,
@@ -140,6 +141,7 @@ module Cfhighlander
140
141
  export_config,
141
142
  conditional,
142
143
  enabled,
144
+ dependson,
143
145
  render == Cfhighlander::Model::Component::Inline
144
146
  )
145
147
  # component.instance_eval(&block) unless block.nil?
@@ -11,6 +11,9 @@ CloudFormation do
11
11
  <% for @subcomponent in dsl.subcomponents %>
12
12
  CloudFormation_Stack('<%= @subcomponent.cfn_name %>') do
13
13
  TemplateURL '<%= @subcomponent.distribution_url %>'
14
+ <%- if !@subcomponent.dependson.empty? %>
15
+ DependsOn <%= @subcomponent.dependson %>
16
+ <%- end %>
14
17
  Parameters ({
15
18
  <% for @param in @subcomponent.parameters %><%="\t"%>'<%=@param.name %>' => <%= @param.cfndsl_value %>,
16
19
  <% 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.1.alpha.1571347461
4
+ version: 0.10.1.alpha.1571413903
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-10-17 00:00:00.000000000 Z
13
+ date: 2019-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline