UNPKG

1.11 kBTypeScriptView Raw
1import { CfnResource } from './cfn-resource';
2import { Stack } from './stack';
3declare type Element = CfnResource | Stack;
4/**
5 * Adds a dependency between two resources or stacks, across stack and nested
6 * stack boundaries.
7 *
8 * The algorithm consists of:
9 * - Try to find the deepest common stack between the two elements
10 * - If there isn't a common stack, it means the elements belong to two
11 * disjoined stack-trees and therefore we apply the dependency at the
12 * assembly/app level between the two topl-level stacks.
13 * - If we did find a common stack, we apply the dependency as a CloudFormation
14 * "DependsOn" between the resources that "represent" our source and target
15 * either directly or through the AWS::CloudFormation::Stack resources that
16 * "lead" to them.
17 *
18 * @param source The source resource/stack (the depedent)
19 * @param target The target resource/stack (the dependency)
20 * @param reason Optional resource to associate with the dependency for
21 * diagnostics
22 */
23export declare function addDependency<T extends Element>(source: T, target: T, reason?: string): void;
24export {};