Skip to content

Commit

Permalink
Merge pull request #39 from RightBrain-Networks/DPY-51
Browse files Browse the repository at this point in the history
Add `depends_on` parameter
  • Loading branch information
Pharrox authored Jan 2, 2020
2 parents 839261d + 699177b commit 07ba7c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,23 @@ These are mainly used for pulling data from the Network Stacks like SNS topics o
```
In this case, VPC is a parameter to this stack, the code will pull output data from the Network Stack and look for the OutputKey of VPC. The Value of the OutputKey VPC in the Network Stack will be used for the parameter VPC of this stack.

## Dependencies

Deployer uses a depdency graph to find the depedencies of the `lookup_parameters`. This makes it easy to run stacks with the `--all` flag.

You can also use the `depends_on` value to manually override the dependency graph.

Example:

```yaml
test:
stack_name: test
depends_on: [ other_stack ]

other_stack:
stack_name: test-two
```
## Tags
Tags are key value pairs of tags to be applied to the Top level stack. This will tag every resouce within the stack with these tags as well as all resouces in child stacks. Use this for things like Environment, Release, Project, etc tags.
```
Expand Down
4 changes: 4 additions & 0 deletions deployer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def find_deploy_path(stackConfig, checkStack, resolved = []):
edge = stack[1]['lookup_parameters'][param]
if edge['Stack'] not in edges:
edges.append(edge['Stack'])
if 'depends_on' in stack[1]:
for edge in stack[1]['depends_on']:
if edge not in edges:
edges.append(edge)
graph[stack[0]] = edges

#Find dependency order
Expand Down

0 comments on commit 07ba7c1

Please sign in to comment.