diff --git a/README.md b/README.md index a4176d3..30bf002 100644 --- a/README.md +++ b/README.md @@ -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. ``` diff --git a/deployer/__init__.py b/deployer/__init__.py index 64fc522..f6946e9 100755 --- a/deployer/__init__.py +++ b/deployer/__init__.py @@ -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