1 | import { Construct } from 'constructs';
|
2 | import { Construct as CoreConstruct } from './construct-compat';
|
3 | /**
|
4 | * An element of a CloudFormation stack.
|
5 | */
|
6 | export declare abstract class CfnElement extends CoreConstruct {
|
7 | /**
|
8 | * Returns `true` if a construct is a stack element (i.e. part of the
|
9 | * synthesized cloudformation template).
|
10 | *
|
11 | * Uses duck-typing instead of `instanceof` to allow stack elements from different
|
12 | * versions of this library to be included in the same stack.
|
13 | *
|
14 | * @returns The construct as a stack element or undefined if it is not a stack element.
|
15 | */
|
16 | static isCfnElement(x: any): x is CfnElement;
|
17 | /**
|
18 | * The logical ID for this CloudFormation stack element. The logical ID of the element
|
19 | * is calculated from the path of the resource node in the construct tree.
|
20 | *
|
21 | * To override this value, use `overrideLogicalId(newLogicalId)`.
|
22 | *
|
23 | * @returns the logical ID as a stringified token. This value will only get
|
24 | * resolved during synthesis.
|
25 | */
|
26 | readonly logicalId: string;
|
27 | /**
|
28 | * The stack in which this element is defined. CfnElements must be defined within a stack scope (directly or indirectly).
|
29 | */
|
30 | readonly stack: Stack;
|
31 | /**
|
32 | * An explicit logical ID provided by `overrideLogicalId`.
|
33 | */
|
34 | private _logicalIdOverride?;
|
35 | /**
|
36 | * Creates an entity and binds it to a tree.
|
37 | * Note that the root of the tree must be a Stack object (not just any Root).
|
38 | *
|
39 | * @param scope The parent construct
|
40 | * @param props Construct properties
|
41 | */
|
42 | constructor(scope: Construct, id: string);
|
43 | /**
|
44 | * Overrides the auto-generated logical ID with a specific ID.
|
45 | * @param newLogicalId The new logical ID to use for this stack element.
|
46 | */
|
47 | overrideLogicalId(newLogicalId: string): void;
|
48 | /**
|
49 | * @returns the stack trace of the point where this Resource was created from, sourced
|
50 | * from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
|
51 | * node +internal+ entries filtered.
|
52 | */
|
53 | get creationStack(): string[];
|
54 | /**
|
55 | * Returns the CloudFormation 'snippet' for this entity. The snippet will only be merged
|
56 | * at the root level to ensure there are no identity conflicts.
|
57 | *
|
58 | * For example, a Resource class will return something like:
|
59 | * {
|
60 | * Resources: {
|
61 | * [this.logicalId]: {
|
62 | * Type: this.resourceType,
|
63 | * Properties: this.props,
|
64 | * Condition: this.condition
|
65 | * }
|
66 | * }
|
67 | * }
|
68 | *
|
69 | *
|
70 | */
|
71 | abstract _toCloudFormation(): object;
|
72 | /**
|
73 | * Called during synthesize to render the logical ID of this element. If
|
74 | * `overrideLogicalId` was it will be used, otherwise, we will allocate the
|
75 | * logical ID through the stack.
|
76 | */
|
77 | private synthesizeLogicalId;
|
78 | }
|
79 | /**
|
80 | * Base class for referenceable CloudFormation constructs which are not Resources
|
81 | *
|
82 | * These constructs are things like Conditions and Parameters, can be
|
83 | * referenced by taking the `.ref` attribute.
|
84 | *
|
85 | * Resource constructs do not inherit from CfnRefElement because they have their
|
86 | * own, more specific types returned from the .ref attribute. Also, some
|
87 | * resources aren't referenceable at all (such as BucketPolicies or GatewayAttachments).
|
88 | */
|
89 | export declare abstract class CfnRefElement extends CfnElement {
|
90 | /**
|
91 | * Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
|
92 | *
|
93 | * If, by any chance, the intrinsic reference of a resource is not a string, you could
|
94 | * coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
|
95 | */
|
96 | get ref(): string;
|
97 | }
|
98 | import { Stack } from './stack';
|