From 1f28a31802c7c9b020dd65d62f37c1e8497c6c9e Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 11 Aug 2020 12:53:24 +0300 Subject: [PATCH] chore: use "construct" instead of "node" across the library (#9584) As a follow-up for #9557, replace all usage of the deprecated `node` API with `construct`. Related: https://github.com/aws/aws-cdk-rfcs/issues/192 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/decdk/lib/declarative-stack.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/decdk/lib/declarative-stack.ts b/packages/decdk/lib/declarative-stack.ts index 8b937ecd..47b92986 100644 --- a/packages/decdk/lib/declarative-stack.ts +++ b/packages/decdk/lib/declarative-stack.ts @@ -383,9 +383,9 @@ function invokeMethod(stack: cdk.Stack, method: reflect.Callable, parameters: an */ function deconstructGetAtt(stack: cdk.Stack, id: string, attribute: string) { return cdk.Lazy.stringValue({ produce: () => { - const res = stack.node.tryFindChild(id); + const res = stack.construct.tryFindChild(id); if (!res) { - const include = stack.node.tryFindChild('Include') as cdk.CfnInclude; + const include = stack.construct.tryFindChild('Include') as cdk.CfnInclude; if (!include) { throw new Error(`Unexpected - "Include" should be in the stack at this point`); } @@ -403,7 +403,7 @@ function deconstructGetAtt(stack: cdk.Stack, id: string, attribute: string) { } function findConstruct(stack: cdk.Stack, id: string) { - const child = stack.node.tryFindChild(id); + const child = stack.construct.tryFindChild(id); if (!child) { throw new Error(`Construct with ID ${id} not found (it must be defined before it is referenced)`); } @@ -411,7 +411,7 @@ function findConstruct(stack: cdk.Stack, id: string) { } function processReferences(stack: cdk.Stack) { - const include = stack.node.findChild('Include') as cdk.CfnInclude; + const include = stack.construct.findChild('Include') as cdk.CfnInclude; if (!include) { throw new Error('Unexpected'); }