From cc1ab88bdb0bbf460c2ff5c26a907971521e8c8b Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 13:06:21 -0800 Subject: [PATCH 01/74] initial work on handler framework Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 34 ++++++++++++++ .../lib/handler-framework/cdk-handler.ts | 46 +++++++++++++++++++ .../cdk-singleton-function.ts | 0 3 files changed, 80 insertions(+) create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts new file mode 100644 index 0000000000000..6007b24be4dd0 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -0,0 +1,34 @@ +import { Construct } from 'constructs'; +import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; +import { CdkHandler } from './cdk-handler'; + +/** + * + */ +export interface CdkFunctionProps extends FunctionOptions { + /** + * + */ + readonly cdkHandler: CdkHandler, +} + +export class CdkFunction extends Function { + private static readonly PREVIOUS_RUNTIME = Runtime.NODEJS_16_X; + private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_18_X; + + public constructor(scope: Construct, id: string, props: CdkFunctionProps) { + super(scope, id, { + runtime: CdkFunction.DEFAULT_RUNTIME, + code: props.cdkHandler.code, + handler: props.cdkHandler.handler, + ...props, + }); + this.validateCompatibleRuntimes(props.cdkHandler.compatibleRuntimes); + } + + private validateCompatibleRuntimes (compatibleRuntime: Runtime[]) { + if (!compatibleRuntime.includes(CdkFunction.DEFAULT_RUNTIME) || !compatibleRuntime.includes(CdkFunction.PREVIOUS_RUNTIME)) { + throw new Error(); + } + } +} diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts new file mode 100644 index 0000000000000..dc8007ce10c1e --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts @@ -0,0 +1,46 @@ +import { Code, Runtime } from '../../../aws-lambda'; + +/** + * + */ +export interface CdkHandlerProps { + /** + * + */ + readonly compatibleRuntimes: Runtime[]; + + /** + * + */ + readonly handler: string; +} + +export class CdkHandler { + /** + * + */ + public static fromAsset(path: string, props: CdkHandlerProps) { + return new CdkHandler(path, props); + } + + /** + * + */ + public readonly code: Code; + + /** + * + */ + public readonly handler: string; + + /** + * + */ + public readonly compatibleRuntimes: Runtime[]; + + private constructor(path: string, props: CdkHandlerProps) { + this.code = Code.fromAsset(path); + this.handler = props.handler; + this.compatibleRuntimes = props.compatibleRuntimes; + } +} diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts new file mode 100644 index 0000000000000..e69de29bb2d1d From c8510d275a8e67c53d88f376a1a834ee6b3f8485 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 16:03:44 -0800 Subject: [PATCH 02/74] latest runtime Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 22 ++++++---- .../lib/handler-framework/latest-runtime.ts | 42 +++++++++++++++++++ 2 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 6007b24be4dd0..01f121db20cf5 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,6 +1,8 @@ import { Construct } from 'constructs'; import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { CdkHandler } from './cdk-handler'; +import { Lazy } from '../../../core'; +import { LatestRuntime } from './latest-runtime'; /** * @@ -13,22 +15,28 @@ export interface CdkFunctionProps extends FunctionOptions { } export class CdkFunction extends Function { - private static readonly PREVIOUS_RUNTIME = Runtime.NODEJS_16_X; - private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_18_X; + private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { - runtime: CdkFunction.DEFAULT_RUNTIME, + runtime: Lazy.any( + { produce: () => this.determineRuntime(props.cdkHandler.compatibleRuntimes) }, + ) as unknown as Runtime, code: props.cdkHandler.code, handler: props.cdkHandler.handler, ...props, }); - this.validateCompatibleRuntimes(props.cdkHandler.compatibleRuntimes); } - private validateCompatibleRuntimes (compatibleRuntime: Runtime[]) { - if (!compatibleRuntime.includes(CdkFunction.DEFAULT_RUNTIME) || !compatibleRuntime.includes(CdkFunction.PREVIOUS_RUNTIME)) { - throw new Error(); + private determineRuntime(compatibleRuntimes: Runtime[]) { + if (compatibleRuntimes.length < 1) { + throw new Error('`cdkHandler` must specify at least 1 compatible runtime'); } + + if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunction.DEFAULT_RUNTIME))) { + return CdkFunction.DEFAULT_RUNTIME; + } + + LatestRuntime.fromNodejsRuntimes(compatibleRuntimes); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts new file mode 100644 index 0000000000000..1cd5fd798469b --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts @@ -0,0 +1,42 @@ +import * as semver from 'semver'; +import { Runtime, RuntimeFamily } from '../../../aws-lambda'; + +export abstract class LatestRuntime { + public static fromNodejsRuntimes(runtimes: Runtime[]) { + return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.NODEJS); + } + + public static fromPythonRuntimes(runtimes: Runtime[]) { + return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.PYTHON); + } + + public static fromRuntimes(runtimes: Runtime[], family?: RuntimeFamily) { + let sliceStart: number; + switch (family) { + case RuntimeFamily.NODEJS: { + sliceStart = 'nodejs'.length; + break; + } + case RuntimeFamily.PYTHON: { + sliceStart = 'python'.length; + break; + } + default: { + sliceStart = 0; + break; + } + } + + let latestRuntime = runtimes[0]; + for (let idx = 1; idx < runtimes.length; idx++) { + const runtime = runtimes[idx]; + if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { + latestRuntime = runtime; + } + } + + // throw error if lastestRuntime is deprecated + + return latestRuntime; + } +} \ No newline at end of file From 34b00c0273c9c2a32e54cb9a18e3c1cf845a4d83 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 16:25:02 -0800 Subject: [PATCH 03/74] added code to determine latest runtime and added a way to check for deprecated runtime Signed-off-by: Francis --- .../aws-cdk-lib/aws-lambda/lib/runtime.ts | 12 ++++++ .../lib/handler-framework/cdk-function.ts | 20 +++++++-- .../lib/handler-framework/latest-runtime.ts | 42 ------------------- 3 files changed, 29 insertions(+), 45 deletions(-) delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts diff --git a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts index 734f895031d77..132eb3134ad15 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts @@ -30,6 +30,12 @@ export interface LambdaRuntimeProps { * @default false */ readonly supportsSnapStart?: boolean; + + /** + * Whether this runtime is deprecated. + * @default false + */ + readonly isDeprecated?: boolean; } export enum RuntimeFamily { @@ -324,11 +330,17 @@ export class Runtime { */ public readonly isVariable: boolean; + /** + * + */ + public readonly isDeprecated: boolean; + constructor(name: string, family?: RuntimeFamily, props: LambdaRuntimeProps = {}) { this.name = name; this.supportsInlineCode = !!props.supportsInlineCode; this.family = family; this.isVariable = !!props.isVariable; + this.isDeprecated = props.isDeprecated ?? false; const imageName = props.bundlingDockerImage ?? `public.ecr.aws/sam/build-${name}`; this.bundlingDockerImage = DockerImage.fromRegistry(imageName); diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 01f121db20cf5..f91b7311c1782 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,8 +1,8 @@ +import * as semver from 'semver'; import { Construct } from 'constructs'; import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { CdkHandler } from './cdk-handler'; import { Lazy } from '../../../core'; -import { LatestRuntime } from './latest-runtime'; /** * @@ -29,7 +29,8 @@ export class CdkFunction extends Function { } private determineRuntime(compatibleRuntimes: Runtime[]) { - if (compatibleRuntimes.length < 1) { + const compatibleRuntimesLength = compatibleRuntimes.length; + if (compatibleRuntimesLength < 1) { throw new Error('`cdkHandler` must specify at least 1 compatible runtime'); } @@ -37,6 +38,19 @@ export class CdkFunction extends Function { return CdkFunction.DEFAULT_RUNTIME; } - LatestRuntime.fromNodejsRuntimes(compatibleRuntimes); + const sliceStart = 'nodejs'.length; + let latestRuntime = compatibleRuntimes[0]; + for (let idx = 1; idx < compatibleRuntimesLength; idx++) { + const runtime = compatibleRuntimes[idx]; + if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { + latestRuntime = runtime; + } + } + + if (latestRuntime.isDeprecated) { + throw new Error('Latest compatible runtime is deprecated'); + } + + return latestRuntime; } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts deleted file mode 100644 index 1cd5fd798469b..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/latest-runtime.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as semver from 'semver'; -import { Runtime, RuntimeFamily } from '../../../aws-lambda'; - -export abstract class LatestRuntime { - public static fromNodejsRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.NODEJS); - } - - public static fromPythonRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.PYTHON); - } - - public static fromRuntimes(runtimes: Runtime[], family?: RuntimeFamily) { - let sliceStart: number; - switch (family) { - case RuntimeFamily.NODEJS: { - sliceStart = 'nodejs'.length; - break; - } - case RuntimeFamily.PYTHON: { - sliceStart = 'python'.length; - break; - } - default: { - sliceStart = 0; - break; - } - } - - let latestRuntime = runtimes[0]; - for (let idx = 1; idx < runtimes.length; idx++) { - const runtime = runtimes[idx]; - if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { - latestRuntime = runtime; - } - } - - // throw error if lastestRuntime is deprecated - - return latestRuntime; - } -} \ No newline at end of file From e1f3df8f09490063963fe33267f18f84c0cffd23 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 17:48:50 -0800 Subject: [PATCH 04/74] refactor Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 17 ++++++++----- .../lib/handler-framework/cdk-handler.ts | 25 ++++++------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index f91b7311c1782..0954a0ec6590b 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,7 +1,7 @@ import * as semver from 'semver'; import { Construct } from 'constructs'; import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; -import { CdkHandler } from './cdk-handler'; +import { CdkCode } from './cdk-handler'; import { Lazy } from '../../../core'; /** @@ -11,7 +11,12 @@ export interface CdkFunctionProps extends FunctionOptions { /** * */ - readonly cdkHandler: CdkHandler, + readonly code: CdkCode; + + /** + * + */ + readonly handler: string; } export class CdkFunction extends Function { @@ -19,12 +24,12 @@ export class CdkFunction extends Function { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { + ...props, runtime: Lazy.any( - { produce: () => this.determineRuntime(props.cdkHandler.compatibleRuntimes) }, + { produce: () => this.determineRuntime(props.code.compatibleRuntimes) }, ) as unknown as Runtime, - code: props.cdkHandler.code, - handler: props.cdkHandler.handler, - ...props, + code: props.code.codeFromAsset, + handler: props.handler, }); } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts index dc8007ce10c1e..3c0913144335b 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts @@ -3,44 +3,33 @@ import { Code, Runtime } from '../../../aws-lambda'; /** * */ -export interface CdkHandlerProps { +export interface CdkCodeProps { /** * */ readonly compatibleRuntimes: Runtime[]; - - /** - * - */ - readonly handler: string; } -export class CdkHandler { +export class CdkCode { /** * */ - public static fromAsset(path: string, props: CdkHandlerProps) { - return new CdkHandler(path, props); + public static fromAsset(path: string, props: CdkCodeProps) { + return new CdkCode(path, props); } /** * */ - public readonly code: Code; - - /** - * - */ - public readonly handler: string; + public readonly codeFromAsset: Code; /** * */ public readonly compatibleRuntimes: Runtime[]; - private constructor(path: string, props: CdkHandlerProps) { - this.code = Code.fromAsset(path); - this.handler = props.handler; + private constructor(path: string, props: CdkCodeProps) { + this.codeFromAsset = Code.fromAsset(path); this.compatibleRuntimes = props.compatibleRuntimes; } } From 34755a3bbb629337a5a8fa2a5e81f0db4e1ee7b8 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 17:50:28 -0800 Subject: [PATCH 05/74] file name Signed-off-by: Francis --- .../lib/handler-framework/{cdk-handler.ts => cdk-code.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/aws-cdk-lib/custom-resources/lib/handler-framework/{cdk-handler.ts => cdk-code.ts} (100%) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts similarity index 100% rename from packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts rename to packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts From 64480b874b969a7636725e3a2c390bee003cc9a6 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 14 Nov 2023 17:54:21 -0800 Subject: [PATCH 06/74] file path Signed-off-by: Francis --- .../custom-resources/lib/handler-framework/cdk-function.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 0954a0ec6590b..4d72f6e7d3189 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,7 +1,7 @@ import * as semver from 'semver'; import { Construct } from 'constructs'; import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; -import { CdkCode } from './cdk-handler'; +import { CdkCode } from './cdk-code'; import { Lazy } from '../../../core'; /** From d11caf3fbd055ba4bc64b6ba8b3afbe296347d4f Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 13:15:36 -0800 Subject: [PATCH 07/74] refactor Signed-off-by: Francis --- .../aws-cdk-lib/aws-lambda/lib/runtime.ts | 2 +- .../lib/handler-framework/cdk-code.ts | 13 +++-- .../lib/handler-framework/cdk-function.ts | 54 +++++++++---------- .../lib/handler-framework/index.ts | 2 + .../lib/helpers-internal/latest-runtime.ts | 46 ++++++++++++++++ .../aws-cdk-lib/custom-resources/lib/index.ts | 3 +- .../handler-framework/cdk-function.test.ts | 22 ++++++++ 7 files changed, 107 insertions(+), 35 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts diff --git a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts index 132eb3134ad15..f007637cdca78 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts @@ -331,7 +331,7 @@ export class Runtime { public readonly isVariable: boolean; /** - * + * Whether the runtime is deprecated. */ public readonly isDeprecated: boolean; diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts index 3c0913144335b..b5c55867e756b 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts @@ -1,30 +1,33 @@ import { Code, Runtime } from '../../../aws-lambda'; /** - * + * Placeholder */ export interface CdkCodeProps { /** - * + * Placeholder */ readonly compatibleRuntimes: Runtime[]; } +/** + * Placeholder + */ export class CdkCode { /** - * + * Placeholder */ public static fromAsset(path: string, props: CdkCodeProps) { return new CdkCode(path, props); } /** - * + * Placeholder */ public readonly codeFromAsset: Code; /** - * + * Placeholder */ public readonly compatibleRuntimes: Runtime[]; diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 4d72f6e7d3189..f1e07b133bd8b 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,39 +1,30 @@ -import * as semver from 'semver'; import { Construct } from 'constructs'; -import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { CdkCode } from './cdk-code'; -import { Lazy } from '../../../core'; +import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../../aws-lambda'; +import { LatestRuntime } from '../helpers-internal/latest-runtime'; /** - * + * Placeholder */ export interface CdkFunctionProps extends FunctionOptions { /** - * + * Placeholder */ readonly code: CdkCode; /** - * + * Placeholder */ readonly handler: string; } +/** + * Placeholder + */ export class CdkFunction extends Function { private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; - public constructor(scope: Construct, id: string, props: CdkFunctionProps) { - super(scope, id, { - ...props, - runtime: Lazy.any( - { produce: () => this.determineRuntime(props.code.compatibleRuntimes) }, - ) as unknown as Runtime, - code: props.code.codeFromAsset, - handler: props.handler, - }); - } - - private determineRuntime(compatibleRuntimes: Runtime[]) { + private static determineRuntime(compatibleRuntimes: Runtime[]) { const compatibleRuntimesLength = compatibleRuntimes.length; if (compatibleRuntimesLength < 1) { throw new Error('`cdkHandler` must specify at least 1 compatible runtime'); @@ -43,19 +34,26 @@ export class CdkFunction extends Function { return CdkFunction.DEFAULT_RUNTIME; } - const sliceStart = 'nodejs'.length; - let latestRuntime = compatibleRuntimes[0]; - for (let idx = 1; idx < compatibleRuntimesLength; idx++) { - const runtime = compatibleRuntimes[idx]; - if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { - latestRuntime = runtime; - } + const runtimes = new Map(); + for (let runtime of runtimes) { + } - if (latestRuntime.isDeprecated) { - throw new Error('Latest compatible runtime is deprecated'); + if (runtimes.has(RuntimeFamily.NODEJS)) { + const latestNodejsRuntime = LatestRuntime.fromNodejsRuntimes(runtimes.get(RuntimeFamily.NODEJS)!); } - return latestRuntime; + if (runtimes.has(RuntimeFamily.PYTHON)) { + const latestPythonRuntime = LatestRuntime.fromPythonRuntimes(runtimes.get(RuntimeFamily.PYTHON)!); + } + } + + public constructor(scope: Construct, id: string, props: CdkFunctionProps) { + super(scope, id, { + ...props, + runtime: CdkFunction.determineRuntime(props.code.compatibleRuntimes), + code: props.code.codeFromAsset, + handler: props.handler, + }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts new file mode 100644 index 0000000000000..be2829f7b3194 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts @@ -0,0 +1,2 @@ +export * from './cdk-code'; +export * from './cdk-function'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts new file mode 100644 index 0000000000000..58b49db596525 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts @@ -0,0 +1,46 @@ +import * as semver from 'semver'; +import { Runtime, RuntimeFamily } from '../../../aws-lambda'; + +export abstract class LatestRuntime { + public static fromNodejsRuntimes(runtimes: Runtime[]) { + return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.NODEJS); + } + + public static fromPythonRuntimes(runtimes: Runtime[]) { + return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.PYTHON); + } + + public static fromRuntimes(runtimes: Runtime[], family?: RuntimeFamily) { + let sliceStart: number; + switch (family) { + case RuntimeFamily.NODEJS: { + sliceStart = 'nodejs'.length; + break; + } + case RuntimeFamily.PYTHON: { + sliceStart = 'python'.length; + break; + } + default: { + sliceStart = 0; + break; + } + } + + for (let runtime of runtimes) { + if (family && runtime.family !== family) { + throw new Error(); + } + } + + let latestRuntime = runtimes[0]; + for (let idx = 1; idx < runtimes.length; idx++) { + const runtime = runtimes[idx]; + if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { + latestRuntime = runtime; + } + } + + return latestRuntime; + } +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/index.ts b/packages/aws-cdk-lib/custom-resources/lib/index.ts index b3e6ae4cfb7d5..2678a4a5f0c7d 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/index.ts @@ -1,2 +1,3 @@ export * from './aws-custom-resource'; -export * from './provider-framework'; \ No newline at end of file +export * from './provider-framework'; +export * from './handler-framework'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts new file mode 100644 index 0000000000000..af1a7cebee328 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -0,0 +1,22 @@ +import { Template } from '../../../assertions'; +import { Runtime } from '../../../aws-lambda'; +import { Stack } from '../../../core'; +import { CdkCode, CdkFunction } from '../../lib/handler-framework'; + +describe('', () => { + test('finds latest runtime', () => { + const stack = new Stack(undefined, 'Stack'); + + const code = CdkCode.fromAsset('', { + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X], + }); + + new CdkFunction(stack, 'CdkFunction', { + code, + handler: 'index.handler', + }); + + /* eslint-disable no-console */ + console.log(JSON.stringify(Template.fromStack(stack), null, 4)); + }); +}); \ No newline at end of file From f40f2325807f5f15792fb8f565f40a771405e408 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 13:17:57 -0800 Subject: [PATCH 08/74] refactor Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index f1e07b133bd8b..36885b77e1ec4 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -35,17 +35,28 @@ export class CdkFunction extends Function { } const runtimes = new Map(); + // categorize runtimes by family for (let runtime of runtimes) { } if (runtimes.has(RuntimeFamily.NODEJS)) { const latestNodejsRuntime = LatestRuntime.fromNodejsRuntimes(runtimes.get(RuntimeFamily.NODEJS)!); + if (latestNodejsRuntime.isDeprecated) { + throw new Error(); + } + return latestNodejsRuntime; } if (runtimes.has(RuntimeFamily.PYTHON)) { const latestPythonRuntime = LatestRuntime.fromPythonRuntimes(runtimes.get(RuntimeFamily.PYTHON)!); + if (latestPythonRuntime.isDeprecated) { + throw new Error(); + } + return latestPythonRuntime; } + + throw new Error(); } public constructor(scope: Construct, id: string, props: CdkFunctionProps) { From 5c4c47c3fc50c878467500425ba95fa854cea910 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 13:59:51 -0800 Subject: [PATCH 09/74] refactor Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 36 ++++++++++++------- .../lib/helpers-internal/latest-runtime.ts | 7 +++- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 36885b77e1ec4..8aa0ef5e2f51d 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -27,33 +27,45 @@ export class CdkFunction extends Function { private static determineRuntime(compatibleRuntimes: Runtime[]) { const compatibleRuntimesLength = compatibleRuntimes.length; if (compatibleRuntimesLength < 1) { - throw new Error('`cdkHandler` must specify at least 1 compatible runtime'); + throw new Error('`code` must specify at least 1 compatible runtime'); } if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunction.DEFAULT_RUNTIME))) { return CdkFunction.DEFAULT_RUNTIME; } - const runtimes = new Map(); + const runtimesByFamily = new Map(); // categorize runtimes by family - for (let runtime of runtimes) { - + for (let runtime of compatibleRuntimes) { + if (runtime.family !== undefined) { + if (runtimesByFamily.has(runtime.family)) { + const runtimesForFamily = runtimesByFamily.get(runtime.family); + if (runtimesForFamily !== undefined) { + runtimesForFamily.push(runtime); + runtimesByFamily.set(runtime.family, runtimesForFamily); + } + } else { + runtimesByFamily.set(runtime.family, [runtime]); + } + } } - if (runtimes.has(RuntimeFamily.NODEJS)) { - const latestNodejsRuntime = LatestRuntime.fromNodejsRuntimes(runtimes.get(RuntimeFamily.NODEJS)!); - if (latestNodejsRuntime.isDeprecated) { + const nodejsRuntimes = runtimesByFamily.get(RuntimeFamily.NODEJS); + if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { + const latestRuntime = LatestRuntime.fromNodejsRuntimes(nodejsRuntimes); + if (latestRuntime.isDeprecated) { throw new Error(); } - return latestNodejsRuntime; + return latestRuntime; } - if (runtimes.has(RuntimeFamily.PYTHON)) { - const latestPythonRuntime = LatestRuntime.fromPythonRuntimes(runtimes.get(RuntimeFamily.PYTHON)!); - if (latestPythonRuntime.isDeprecated) { + const pythonRuntimes = runtimesByFamily.get(RuntimeFamily.PYTHON); + if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { + const latestRuntime = LatestRuntime.fromPythonRuntimes(pythonRuntimes); + if (latestRuntime.isDeprecated) { throw new Error(); } - return latestPythonRuntime; + return latestRuntime; } throw new Error(); diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts index 58b49db596525..dd509fcb5dd97 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts @@ -11,6 +11,11 @@ export abstract class LatestRuntime { } public static fromRuntimes(runtimes: Runtime[], family?: RuntimeFamily) { + const runtimesLength = runtimes.length; + if (runtimesLength === 0) { + throw new Error('You must specify at least one runtime'); + } + let sliceStart: number; switch (family) { case RuntimeFamily.NODEJS: { @@ -34,7 +39,7 @@ export abstract class LatestRuntime { } let latestRuntime = runtimes[0]; - for (let idx = 1; idx < runtimes.length; idx++) { + for (let idx = 1; idx < runtimesLength; idx++) { const runtime = runtimes[idx]; if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { latestRuntime = runtime; From 1fbe2c9350857a30ebe31c5e9ea5f70a805c551b Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 14:02:40 -0800 Subject: [PATCH 10/74] naming Signed-off-by: Francis --- .../custom-resources/lib/helpers-internal/latest-runtime.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts index dd509fcb5dd97..1d3f81d866080 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts @@ -3,14 +3,14 @@ import { Runtime, RuntimeFamily } from '../../../aws-lambda'; export abstract class LatestRuntime { public static fromNodejsRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.NODEJS); + return LatestRuntime.fromRuntimeFamily(runtimes, RuntimeFamily.NODEJS); } public static fromPythonRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimes(runtimes, RuntimeFamily.PYTHON); + return LatestRuntime.fromRuntimeFamily(runtimes, RuntimeFamily.PYTHON); } - public static fromRuntimes(runtimes: Runtime[], family?: RuntimeFamily) { + public static fromRuntimeFamily(runtimes: Runtime[], family?: RuntimeFamily) { const runtimesLength = runtimes.length; if (runtimesLength === 0) { throw new Error('You must specify at least one runtime'); From 01147e8b88315218f5e56d7051a0fabf86b84a36 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 16:15:42 -0800 Subject: [PATCH 11/74] refactored and stopped using semver for version compare Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 47 ++++++++--------- .../lib/helpers-internal/latest-runtime.ts | 51 ------------------- .../lib/helpers-internal/version-compare.ts | 47 +++++++++++++++++ 3 files changed, 67 insertions(+), 78 deletions(-) delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 8aa0ef5e2f51d..dce02a4ef9d43 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkCode } from './cdk-code'; import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../../aws-lambda'; -import { LatestRuntime } from '../helpers-internal/latest-runtime'; +import { latestNodejsRuntime, latestPythonRuntime } from '../helpers-internal/version-compare'; /** * Placeholder @@ -25,50 +25,43 @@ export class CdkFunction extends Function { private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; private static determineRuntime(compatibleRuntimes: Runtime[]) { - const compatibleRuntimesLength = compatibleRuntimes.length; - if (compatibleRuntimesLength < 1) { - throw new Error('`code` must specify at least 1 compatible runtime'); + if (compatibleRuntimes.length === 0) { + throw new Error('`code` must specify at least one compatible runtime'); } + // check for default runtime if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunction.DEFAULT_RUNTIME))) { return CdkFunction.DEFAULT_RUNTIME; } - const runtimesByFamily = new Map(); - // categorize runtimes by family - for (let runtime of compatibleRuntimes) { - if (runtime.family !== undefined) { - if (runtimesByFamily.has(runtime.family)) { - const runtimesForFamily = runtimesByFamily.get(runtime.family); - if (runtimesForFamily !== undefined) { - runtimesForFamily.push(runtime); - runtimesByFamily.set(runtime.family, runtimesForFamily); - } - } else { - runtimesByFamily.set(runtime.family, [runtime]); - } - } - } - - const nodejsRuntimes = runtimesByFamily.get(RuntimeFamily.NODEJS); + // first try for latest nodejs runtime + const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { - const latestRuntime = LatestRuntime.fromNodejsRuntimes(nodejsRuntimes); + let latestRuntime = nodejsRuntimes[0]; + for (let idx = 1; idx < nodejsRuntimes.length; idx++) { + latestRuntime = latestNodejsRuntime(latestRuntime, nodejsRuntimes[idx]); + } if (latestRuntime.isDeprecated) { - throw new Error(); + throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); } return latestRuntime; } - const pythonRuntimes = runtimesByFamily.get(RuntimeFamily.PYTHON); + // next try for latest python runtime + const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { - const latestRuntime = LatestRuntime.fromPythonRuntimes(pythonRuntimes); + let latestRuntime = pythonRuntimes[0]; + for (let idx = 1; idx < pythonRuntimes.length; idx++) { + latestRuntime = latestPythonRuntime(latestRuntime, pythonRuntimes[idx]); + } if (latestRuntime.isDeprecated) { - throw new Error(); + throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); } return latestRuntime; } - throw new Error(); + // throw if nodejs or python runtimes aren't specified + throw new Error('Compatible runtimes can only be python or nodejs'); } public constructor(scope: Construct, id: string, props: CdkFunctionProps) { diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts deleted file mode 100644 index 1d3f81d866080..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/latest-runtime.ts +++ /dev/null @@ -1,51 +0,0 @@ -import * as semver from 'semver'; -import { Runtime, RuntimeFamily } from '../../../aws-lambda'; - -export abstract class LatestRuntime { - public static fromNodejsRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimeFamily(runtimes, RuntimeFamily.NODEJS); - } - - public static fromPythonRuntimes(runtimes: Runtime[]) { - return LatestRuntime.fromRuntimeFamily(runtimes, RuntimeFamily.PYTHON); - } - - public static fromRuntimeFamily(runtimes: Runtime[], family?: RuntimeFamily) { - const runtimesLength = runtimes.length; - if (runtimesLength === 0) { - throw new Error('You must specify at least one runtime'); - } - - let sliceStart: number; - switch (family) { - case RuntimeFamily.NODEJS: { - sliceStart = 'nodejs'.length; - break; - } - case RuntimeFamily.PYTHON: { - sliceStart = 'python'.length; - break; - } - default: { - sliceStart = 0; - break; - } - } - - for (let runtime of runtimes) { - if (family && runtime.family !== family) { - throw new Error(); - } - } - - let latestRuntime = runtimes[0]; - for (let idx = 1; idx < runtimesLength; idx++) { - const runtime = runtimes[idx]; - if (semver.gte(runtime.name.slice(sliceStart), latestRuntime.name.slice(sliceStart))) { - latestRuntime = runtime; - } - } - - return latestRuntime; - } -} \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts new file mode 100644 index 0000000000000..2563071d45aef --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts @@ -0,0 +1,47 @@ +import { Runtime, RuntimeFamily } from '../../../aws-lambda'; + +export function latestNodejsRuntime(runtime1: Runtime, runtime2: Runtime) { + return latestRuntime(runtime1, runtime2, RuntimeFamily.NODEJS); +} + +export function latestPythonRuntime(runtime1: Runtime, runtime2: Runtime) { + return latestRuntime(runtime1, runtime2, RuntimeFamily.PYTHON); +} + +function latestRuntime(runtime1: Runtime, runtime2: Runtime, family: RuntimeFamily) { + if (runtime1.family !== family) {} + + if (runtime2.family !== family) {} + + let sliceStart: number; + switch (family) { + case RuntimeFamily.NODEJS: { + sliceStart = 'nodejs'.length; + break; + } + case RuntimeFamily.PYTHON: { + sliceStart = 'python'.length; + break; + } + default: { + sliceStart = 0; + break; + } + } + + const version1 = runtime1.name.slice(sliceStart).split('.'); + const version2 = runtime2.name.slice(sliceStart).split('.'); + + const versionLength = Math.min(version1.length, version2.length); + for (let idx = 0; idx < versionLength; idx++) { + if (parseInt(version1[idx]) > parseInt(version2[idx])) { + return runtime1; + } + + if (parseInt(version1[idx]) < parseInt(version2[idx])) { + return runtime2; + } + } + + return runtime1; +} From 7d738ee1d76651318044c0101726a3cb62c13b23 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 16:18:05 -0800 Subject: [PATCH 12/74] export version compare Signed-off-by: Francis --- .../aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts index 56a4389d17878..161f5fd90f7af 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts @@ -1 +1,2 @@ -export * from './sdk-info'; \ No newline at end of file +export * from './sdk-info'; +export * from './version-compare'; \ No newline at end of file From 765e854cbf036dcc54313cc2f8fce325007f0b40 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 18:59:20 -0800 Subject: [PATCH 13/74] base class Signed-off-by: Francis --- .../handler-framework/cdk-function-base.ts | 46 ++++++++++++++++ .../lib/handler-framework/cdk-function.ts | 55 +++---------------- .../cdk-singleton-function.ts | 23 ++++++++ 3 files changed, 76 insertions(+), 48 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts new file mode 100644 index 0000000000000..ea357931d8575 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts @@ -0,0 +1,46 @@ +import { Runtime, RuntimeFamily } from '../../../aws-lambda'; +import { latestNodejsRuntime, latestPythonRuntime } from '../helpers-internal'; + +export abstract class CdkFunctionBase { + private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; + + public determineRuntime(compatibleRuntimes: Runtime[]) { + if (compatibleRuntimes.length === 0) { + throw new Error('`code` must specify at least one compatible runtime'); + } + + // check for default runtime + if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunctionBase.DEFAULT_RUNTIME))) { + return CdkFunctionBase.DEFAULT_RUNTIME; + } + + // first try for latest nodejs runtime + const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { + let latestRuntime = nodejsRuntimes[0]; + for (let idx = 1; idx < nodejsRuntimes.length; idx++) { + latestRuntime = latestNodejsRuntime(latestRuntime, nodejsRuntimes[idx]); + } + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); + } + return latestRuntime; + } + + // next try for latest python runtime + const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { + let latestRuntime = pythonRuntimes[0]; + for (let idx = 1; idx < pythonRuntimes.length; idx++) { + latestRuntime = latestPythonRuntime(latestRuntime, pythonRuntimes[idx]); + } + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); + } + return latestRuntime; + } + + // throw if nodejs or python runtimes aren't specified + throw new Error('Compatible runtimes can only be Python or Nodejs'); + } +} diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index dce02a4ef9d43..42b93e5dfd2b6 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkCode } from './cdk-code'; -import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../../aws-lambda'; -import { latestNodejsRuntime, latestPythonRuntime } from '../helpers-internal/version-compare'; +import { CdkFunctionBase } from './cdk-function-base'; +import { Function, FunctionOptions } from '../../../aws-lambda'; /** * Placeholder @@ -21,55 +21,14 @@ export interface CdkFunctionProps extends FunctionOptions { /** * Placeholder */ -export class CdkFunction extends Function { - private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; - - private static determineRuntime(compatibleRuntimes: Runtime[]) { - if (compatibleRuntimes.length === 0) { - throw new Error('`code` must specify at least one compatible runtime'); - } - - // check for default runtime - if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunction.DEFAULT_RUNTIME))) { - return CdkFunction.DEFAULT_RUNTIME; - } - - // first try for latest nodejs runtime - const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { - let latestRuntime = nodejsRuntimes[0]; - for (let idx = 1; idx < nodejsRuntimes.length; idx++) { - latestRuntime = latestNodejsRuntime(latestRuntime, nodejsRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; - } - - // next try for latest python runtime - const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { - let latestRuntime = pythonRuntimes[0]; - for (let idx = 1; idx < pythonRuntimes.length; idx++) { - latestRuntime = latestPythonRuntime(latestRuntime, pythonRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; - } - - // throw if nodejs or python runtimes aren't specified - throw new Error('Compatible runtimes can only be python or nodejs'); - } - +export class CdkFunction extends CdkFunctionBase { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { - super(scope, id, { + super(); + + new Function(scope, id, { ...props, - runtime: CdkFunction.determineRuntime(props.code.compatibleRuntimes), code: props.code.codeFromAsset, - handler: props.handler, + runtime: this.determineRuntime(props.code.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index e69de29bb2d1d..7587858e45832 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -0,0 +1,23 @@ +import { Construct } from 'constructs'; +import { FunctionOptions, SingletonFunction } from '../../../aws-lambda'; +import { CdkCode } from './cdk-code'; +import { CdkFunctionBase } from './cdk-function-base'; + +export interface CdkSingletonFunctionProps extends FunctionOptions { + readonly uuid: string; + readonly code: CdkCode; + readonly handler: string; + readonly lambdaPurpose?: string; +} + +export class CdkSingletonFunction extends CdkFunctionBase { + public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { + super(); + + new SingletonFunction(scope, id, { + ...props, + code: props.code.codeFromAsset, + runtime: this.determineRuntime(props.code.compatibleRuntimes), + }); + } +} From a1929f55e06a8a5d0e17d124a4388ff7659f0de7 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 21:12:38 -0800 Subject: [PATCH 14/74] runtime determiner utility class Signed-off-by: Francis --- .../handler-framework/cdk-function-base.ts | 46 --------- .../lib/handler-framework/cdk-function.ts | 10 +- .../cdk-singleton-function.ts | 33 +++++-- .../lib/handler-framework/index.ts | 3 +- .../helpers-internal/runtime-determiner.ts | 95 +++++++++++++++++++ .../lib/helpers-internal/version-compare.ts | 47 --------- .../handler-framework/cdk-function.test.ts | 2 +- 7 files changed, 128 insertions(+), 108 deletions(-) delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts deleted file mode 100644 index ea357931d8575..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function-base.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Runtime, RuntimeFamily } from '../../../aws-lambda'; -import { latestNodejsRuntime, latestPythonRuntime } from '../helpers-internal'; - -export abstract class CdkFunctionBase { - private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; - - public determineRuntime(compatibleRuntimes: Runtime[]) { - if (compatibleRuntimes.length === 0) { - throw new Error('`code` must specify at least one compatible runtime'); - } - - // check for default runtime - if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(CdkFunctionBase.DEFAULT_RUNTIME))) { - return CdkFunctionBase.DEFAULT_RUNTIME; - } - - // first try for latest nodejs runtime - const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { - let latestRuntime = nodejsRuntimes[0]; - for (let idx = 1; idx < nodejsRuntimes.length; idx++) { - latestRuntime = latestNodejsRuntime(latestRuntime, nodejsRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; - } - - // next try for latest python runtime - const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { - let latestRuntime = pythonRuntimes[0]; - for (let idx = 1; idx < pythonRuntimes.length; idx++) { - latestRuntime = latestPythonRuntime(latestRuntime, pythonRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; - } - - // throw if nodejs or python runtimes aren't specified - throw new Error('Compatible runtimes can only be Python or Nodejs'); - } -} diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 42b93e5dfd2b6..9614ffb3ac3c1 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkCode } from './cdk-code'; -import { CdkFunctionBase } from './cdk-function-base'; import { Function, FunctionOptions } from '../../../aws-lambda'; +import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** * Placeholder @@ -21,14 +21,12 @@ export interface CdkFunctionProps extends FunctionOptions { /** * Placeholder */ -export class CdkFunction extends CdkFunctionBase { +export class CdkFunction extends Function { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { - super(); - - new Function(scope, id, { + super(scope, id, { ...props, code: props.code.codeFromAsset, - runtime: this.determineRuntime(props.code.compatibleRuntimes), + runtime: RuntimeDeterminer.determineRuntime(props.code.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index 7587858e45832..60e81177c9454 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -1,23 +1,42 @@ import { Construct } from 'constructs'; -import { FunctionOptions, SingletonFunction } from '../../../aws-lambda'; import { CdkCode } from './cdk-code'; -import { CdkFunctionBase } from './cdk-function-base'; +import { FunctionOptions, SingletonFunction } from '../../../aws-lambda'; +import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; +/** + * Placeholder + */ export interface CdkSingletonFunctionProps extends FunctionOptions { + /** + * Placeholder + */ readonly uuid: string; + + /** + * Placeholder + */ readonly code: CdkCode; + + /** + * Placeholder + */ readonly handler: string; + + /** + * Placeholder + */ readonly lambdaPurpose?: string; } -export class CdkSingletonFunction extends CdkFunctionBase { +/** + * Placeholder + */ +export class CdkSingletonFunction extends SingletonFunction { public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { - super(); - - new SingletonFunction(scope, id, { + super(scope, id, { ...props, code: props.code.codeFromAsset, - runtime: this.determineRuntime(props.code.compatibleRuntimes), + runtime: RuntimeDeterminer.determineRuntime(props.code.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts index be2829f7b3194..a6361698f6d98 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts @@ -1,2 +1,3 @@ export * from './cdk-code'; -export * from './cdk-function'; \ No newline at end of file +export * from './cdk-function'; +export * from './cdk-function-base'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts new file mode 100644 index 0000000000000..3bc88dbaaf24d --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -0,0 +1,95 @@ +import { Runtime, RuntimeFamily } from '../../../aws-lambda'; + +export class RuntimeDeterminer { + public static determineRuntime(compatibleRuntimes: Runtime[]) { + if (compatibleRuntimes.length === 0) { + throw new Error('`code` must specify at least one compatible runtime'); + } + + //check for default runtime + if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME))) { + return RuntimeDeterminer.DEFAULT_RUNTIME; + } + + // first try for latest nodejs runtime + const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { + let latestRuntime = nodejsRuntimes[0]; + for (let idx = 1; idx < nodejsRuntimes.length; idx++) { + latestRuntime = RuntimeDeterminer.compareNodeJsRuntimes(latestRuntime, nodejsRuntimes[idx]); + } + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); + } + return latestRuntime; + } + + // next try for latest python runtime + const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { + let latestRuntime = pythonRuntimes[0]; + for (let idx = 1; idx < pythonRuntimes.length; idx++) { + latestRuntime = RuntimeDeterminer.comparePythonRuntimes(latestRuntime, pythonRuntimes[idx]); + } + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); + } + return latestRuntime; + } + + // throw if nodejs or python runtimes aren't specified + throw new Error('Compatible runtimes can only be Python or Nodejs'); + } + + private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; + + private static compareNodeJsRuntimes(runtime1: Runtime, runtime2: Runtime) { + if (runtime1.family !== RuntimeFamily.NODEJS) {} + + if (runtime2.family !== RuntimeFamily.NODEJS) {} + + return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.NODEJS); + } + + private static comparePythonRuntimes(runtime1: Runtime, runtime2: Runtime) { + if (runtime1.family !== RuntimeFamily.PYTHON) {} + + if (runtime2.family !== RuntimeFamily.PYTHON) {} + + return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.PYTHON); + } + + private static compareRuntimes(runtime1: Runtime, runtime2: Runtime, family: RuntimeFamily) { + let sliceStart: number; + switch (family) { + case RuntimeFamily.NODEJS: { + sliceStart = 'nodejs'.length; + break; + } + case RuntimeFamily.PYTHON: { + sliceStart = 'python'.length; + break; + } + default: { + sliceStart = 0; + break; + } + } + + const version1 = runtime1.name.slice(sliceStart).split('.'); + const version2 = runtime2.name.slice(sliceStart).split('.'); + + const versionLength = Math.min(version1.length, version2.length); + for (let idx = 0; idx < versionLength; idx++) { + if (parseInt(version1[idx]) > parseInt(version2[idx])) { + return runtime1; + } + + if (parseInt(version1[idx]) < parseInt(version2[idx])) { + return runtime2; + } + } + + return runtime1; + } +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts deleted file mode 100644 index 2563071d45aef..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/version-compare.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Runtime, RuntimeFamily } from '../../../aws-lambda'; - -export function latestNodejsRuntime(runtime1: Runtime, runtime2: Runtime) { - return latestRuntime(runtime1, runtime2, RuntimeFamily.NODEJS); -} - -export function latestPythonRuntime(runtime1: Runtime, runtime2: Runtime) { - return latestRuntime(runtime1, runtime2, RuntimeFamily.PYTHON); -} - -function latestRuntime(runtime1: Runtime, runtime2: Runtime, family: RuntimeFamily) { - if (runtime1.family !== family) {} - - if (runtime2.family !== family) {} - - let sliceStart: number; - switch (family) { - case RuntimeFamily.NODEJS: { - sliceStart = 'nodejs'.length; - break; - } - case RuntimeFamily.PYTHON: { - sliceStart = 'python'.length; - break; - } - default: { - sliceStart = 0; - break; - } - } - - const version1 = runtime1.name.slice(sliceStart).split('.'); - const version2 = runtime2.name.slice(sliceStart).split('.'); - - const versionLength = Math.min(version1.length, version2.length); - for (let idx = 0; idx < versionLength; idx++) { - if (parseInt(version1[idx]) > parseInt(version2[idx])) { - return runtime1; - } - - if (parseInt(version1[idx]) < parseInt(version2[idx])) { - return runtime2; - } - } - - return runtime1; -} diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts index af1a7cebee328..583ff45c86f4b 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -11,7 +11,7 @@ describe('', () => { compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X], }); - new CdkFunction(stack, 'CdkFunction', { + const fn = new CdkFunction(stack, 'CdkFunction', { code, handler: 'index.handler', }); From f7f8ff7434aafbe25dffe6343cf251f0c6bdf525 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 15 Nov 2023 21:15:40 -0800 Subject: [PATCH 15/74] private constructor Signed-off-by: Francis --- .../custom-resources/lib/helpers-internal/runtime-determiner.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index 3bc88dbaaf24d..a92808ce5c9af 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -92,4 +92,6 @@ export class RuntimeDeterminer { return runtime1; } + + private constructor() {} } \ No newline at end of file From 98a88c50c8c24b4317a8da06342e1744e526d847 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 03:21:31 -0800 Subject: [PATCH 16/74] refactor of runtime determiner Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 24 ++++++- .../cdk-singleton-function.ts | 24 ++++++- .../helpers-internal/runtime-determiner.ts | 64 ++++++++++--------- 3 files changed, 79 insertions(+), 33 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 9614ffb3ac3c1..5d4dab03b81ed 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkCode } from './cdk-code'; -import { Function, FunctionOptions } from '../../../aws-lambda'; +import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** @@ -22,11 +22,31 @@ export interface CdkFunctionProps extends FunctionOptions { * Placeholder */ export class CdkFunction extends Function { + private static determineRuntime(compatibleRuntimes: Runtime[]) { + const latestNodeJsRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(compatibleRuntimes); + if (latestNodeJsRuntime !== undefined) { + if (latestNodeJsRuntime.isDeprecated) { + throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); + } + return latestNodeJsRuntime; + } + + const latestPythonRuntime = RuntimeDeterminer.determineLatestPythonRuntime(compatibleRuntimes); + if (latestPythonRuntime !== undefined) { + if (latestPythonRuntime.isDeprecated) { + throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); + } + return latestPythonRuntime; + } + + throw new Error('Compatible runtimes must contain either nodejs or python runtimes'); + } + public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { ...props, code: props.code.codeFromAsset, - runtime: RuntimeDeterminer.determineRuntime(props.code.compatibleRuntimes), + runtime: CdkFunction.determineRuntime(props.code.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index 60e81177c9454..3cee4d229adf5 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkCode } from './cdk-code'; -import { FunctionOptions, SingletonFunction } from '../../../aws-lambda'; +import { FunctionOptions, Runtime, SingletonFunction } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** @@ -32,11 +32,31 @@ export interface CdkSingletonFunctionProps extends FunctionOptions { * Placeholder */ export class CdkSingletonFunction extends SingletonFunction { + private static determineRuntime(compatibleRuntimes: Runtime[]) { + const latestNodeJsRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(compatibleRuntimes); + if (latestNodeJsRuntime !== undefined) { + if (latestNodeJsRuntime.isDeprecated) { + throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); + } + return latestNodeJsRuntime; + } + + const latestPythonRuntime = RuntimeDeterminer.determineLatestPythonRuntime(compatibleRuntimes); + if (latestPythonRuntime !== undefined) { + if (latestPythonRuntime.isDeprecated) { + throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); + } + return latestPythonRuntime; + } + + throw new Error('Compatible runtimes must contain either nodejs or python runtimes'); + } + public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { super(scope, id, { ...props, code: props.code.codeFromAsset, - runtime: RuntimeDeterminer.determineRuntime(props.code.compatibleRuntimes), + runtime: CdkSingletonFunction.determineRuntime(props.code.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index a92808ce5c9af..8706ee94092ea 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -1,44 +1,50 @@ import { Runtime, RuntimeFamily } from '../../../aws-lambda'; +/** + * A utility class used to determine the latest runtime for a specific runtime family + */ export class RuntimeDeterminer { - public static determineRuntime(compatibleRuntimes: Runtime[]) { - if (compatibleRuntimes.length === 0) { - throw new Error('`code` must specify at least one compatible runtime'); + public static determineLatestNodeJsRuntime(runtimes: Runtime[]) { + const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + + if (nodeJsRuntimes.length === 0) { + return undefined; } - //check for default runtime - if (compatibleRuntimes.some(runtime => runtime.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME))) { + if (nodeJsRuntimes.some(runtime => runtime.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME))) { return RuntimeDeterminer.DEFAULT_RUNTIME; } - // first try for latest nodejs runtime - const nodejsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - if (nodejsRuntimes !== undefined && nodejsRuntimes.length > 0) { - let latestRuntime = nodejsRuntimes[0]; - for (let idx = 1; idx < nodejsRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.compareNodeJsRuntimes(latestRuntime, nodejsRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Nodejs runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; + let latestRuntime = nodeJsRuntimes[0]; + for (let idx = 1; idx < nodeJsRuntimes.length; idx++) { + latestRuntime = RuntimeDeterminer.compareNodeJsRuntimes(latestRuntime, nodeJsRuntimes[idx]); } - // next try for latest python runtime - const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - if (pythonRuntimes !== undefined && pythonRuntimes.length > 0) { - let latestRuntime = pythonRuntimes[0]; - for (let idx = 1; idx < pythonRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.comparePythonRuntimes(latestRuntime, pythonRuntimes[idx]); - } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); + } + + return latestRuntime; + } + + public static determineLatestPythonRuntime(runtimes: Runtime[]) { + const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + + if (pythonRuntimes.length === 0) { + return undefined; + } + + let latestRuntime = pythonRuntimes[0]; + + for (let idx = 1; idx < pythonRuntimes.length; idx++) { + latestRuntime = RuntimeDeterminer.comparePythonRuntimes(latestRuntime, pythonRuntimes[idx]); + } + + if (latestRuntime.isDeprecated) { + throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); } - // throw if nodejs or python runtimes aren't specified - throw new Error('Compatible runtimes can only be Python or Nodejs'); + return latestRuntime; } private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; From 8650123d62acafd516f6f0775199d22363eb647d Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 03:27:08 -0800 Subject: [PATCH 17/74] error messages Signed-off-by: Francis --- .../lib/helpers-internal/runtime-determiner.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index 8706ee94092ea..e116f3678fb9f 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -20,10 +20,6 @@ export class RuntimeDeterminer { latestRuntime = RuntimeDeterminer.compareNodeJsRuntimes(latestRuntime, nodeJsRuntimes[idx]); } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; } @@ -35,33 +31,20 @@ export class RuntimeDeterminer { } let latestRuntime = pythonRuntimes[0]; - for (let idx = 1; idx < pythonRuntimes.length; idx++) { latestRuntime = RuntimeDeterminer.comparePythonRuntimes(latestRuntime, pythonRuntimes[idx]); } - if (latestRuntime.isDeprecated) { - throw new Error(`Latest compatible Python runtime found ${latestRuntime} is deprecated`); - } - return latestRuntime; } private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; private static compareNodeJsRuntimes(runtime1: Runtime, runtime2: Runtime) { - if (runtime1.family !== RuntimeFamily.NODEJS) {} - - if (runtime2.family !== RuntimeFamily.NODEJS) {} - return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.NODEJS); } private static comparePythonRuntimes(runtime1: Runtime, runtime2: Runtime) { - if (runtime1.family !== RuntimeFamily.PYTHON) {} - - if (runtime2.family !== RuntimeFamily.PYTHON) {} - return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.PYTHON); } From 3b8f2059aed5acc1a097c27a4cdee72fb64e6158 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 08:11:55 -0800 Subject: [PATCH 18/74] testing and docstrings Signed-off-by: Francis --- .../lib/handler-framework/cdk-code.ts | 14 ++-- .../lib/handler-framework/cdk-function.ts | 8 +- .../cdk-singleton-function.ts | 22 +++-- .../lib/handler-framework/index.ts | 2 +- .../lib/helpers-internal/index.ts | 2 +- .../helpers-internal/runtime-determiner.ts | 4 +- .../test/handler-framework/cdk-code.test.ts | 15 ++++ .../handler-framework/cdk-function.test.ts | 22 ----- .../handler-framework/test-handler/index.ts | 3 + .../runtime-determiner.test.ts | 83 +++++++++++++++++++ 10 files changed, 133 insertions(+), 42 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts delete mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts create mode 100644 packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts index b5c55867e756b..61a82214f79df 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts @@ -1,33 +1,35 @@ import { Code, Runtime } from '../../../aws-lambda'; /** - * Placeholder + * Properties used to define source code executed within a Lambda function acting as a + * custom resource provider. */ export interface CdkCodeProps { /** - * Placeholder + * Runtimes that are compatible with the source code. */ readonly compatibleRuntimes: Runtime[]; } /** - * Placeholder + * Represents source code that will be executed within a Lambda function acting as a + * custom resource provider. */ export class CdkCode { /** - * Placeholder + * Loads the source code from a local disk path. */ public static fromAsset(path: string, props: CdkCodeProps) { return new CdkCode(path, props); } /** - * Placeholder + * The source code loaded from a local disk path. */ public readonly codeFromAsset: Code; /** - * Placeholder + * Runtimes that are compatible with the source code. */ public readonly compatibleRuntimes: Runtime[]; diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 5d4dab03b81ed..69a8cf56269a8 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -4,22 +4,22 @@ import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** - * Placeholder + * Properties used to define a Lambda function used as a custom resource provider. */ export interface CdkFunctionProps extends FunctionOptions { /** - * Placeholder + * The source code of your Lambda function. */ readonly code: CdkCode; /** - * Placeholder + * The name of the method within your code that Lambda calls to execute your function. */ readonly handler: string; } /** - * Placeholder + * Represents a Lambda function used as a custom resource provider. */ export class CdkFunction extends Function { private static determineRuntime(compatibleRuntimes: Runtime[]) { diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index 3cee4d229adf5..f0d965aa7696d 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -4,32 +4,42 @@ import { FunctionOptions, Runtime, SingletonFunction } from '../../../aws-lambda import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** - * Placeholder + * Properties used to define a singleton Lambda function to be used as a custom resource + * provider. */ export interface CdkSingletonFunctionProps extends FunctionOptions { /** - * Placeholder + * A unique identifier to identify this lambda + * + * The identifier should be unique across all custom resource providers. + * We recommend generating a UUID per provider. */ readonly uuid: string; /** - * Placeholder + * The source code of your Lambda function. */ readonly code: CdkCode; /** - * Placeholder + * The name of the method within your code that Lambda calls to execute your function. */ readonly handler: string; /** - * Placeholder + * A descriptive name for the purpose of this Lambda. + * + * If the Lambda does not have a physical name, this string will be + * reflected its generated name. The combination of lambdaPurpose + * and uuid must be unique. + * + * @default SingletonLambda */ readonly lambdaPurpose?: string; } /** - * Placeholder + * Represents a singleton Lambda function to be used as a custom resource provider. */ export class CdkSingletonFunction extends SingletonFunction { private static determineRuntime(compatibleRuntimes: Runtime[]) { diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts index a6361698f6d98..190fdee3a0887 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts @@ -1,3 +1,3 @@ export * from './cdk-code'; export * from './cdk-function'; -export * from './cdk-function-base'; \ No newline at end of file +export * from './cdk-singleton-function'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts index 161f5fd90f7af..454d9dd8d5320 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts @@ -1,2 +1,2 @@ export * from './sdk-info'; -export * from './version-compare'; \ No newline at end of file +export * from './runtime-determiner'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index e116f3678fb9f..af4ebd609f01b 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -4,6 +4,8 @@ import { Runtime, RuntimeFamily } from '../../../aws-lambda'; * A utility class used to determine the latest runtime for a specific runtime family */ export class RuntimeDeterminer { + public static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; + public static determineLatestNodeJsRuntime(runtimes: Runtime[]) { const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); @@ -38,8 +40,6 @@ export class RuntimeDeterminer { return latestRuntime; } - private static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; - private static compareNodeJsRuntimes(runtime1: Runtime, runtime2: Runtime) { return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.NODEJS); } diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts new file mode 100644 index 0000000000000..9b781b23d4c5b --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts @@ -0,0 +1,15 @@ +import { Runtime } from '../../../aws-lambda'; +import { CdkCode } from '../../lib/handler-framework/cdk-code'; + +describe('code from asset', () => { + test('correctly sets compatibleRuntimes property', () => { + // GIVEN + const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; + + // WHEN + const code = CdkCode.fromAsset('./test-handler', { compatibleRuntimes }); + + // THEN + expect(code.compatibleRuntimes).toEqual(compatibleRuntimes); + }); +}); \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts deleted file mode 100644 index 583ff45c86f4b..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Template } from '../../../assertions'; -import { Runtime } from '../../../aws-lambda'; -import { Stack } from '../../../core'; -import { CdkCode, CdkFunction } from '../../lib/handler-framework'; - -describe('', () => { - test('finds latest runtime', () => { - const stack = new Stack(undefined, 'Stack'); - - const code = CdkCode.fromAsset('', { - compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X], - }); - - const fn = new CdkFunction(stack, 'CdkFunction', { - code, - handler: 'index.handler', - }); - - /* eslint-disable no-console */ - console.log(JSON.stringify(Template.fromStack(stack), null, 4)); - }); -}); \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts new file mode 100644 index 0000000000000..cc7924608ec5d --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts @@ -0,0 +1,3 @@ +export function handler() { + return { message: 'hello world!' }; +} diff --git a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts new file mode 100644 index 0000000000000..6fbf2e2e6575f --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts @@ -0,0 +1,83 @@ +import { Runtime } from '../../../aws-lambda'; +import { RuntimeDeterminer } from '../../lib/helpers-internal/runtime-determiner'; + +describe('nodejs runtimes', () => { + test('selects default runtime', () => { + // GIVEN + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.PYTHON_3_11]; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + + // THEN + expect(latestRuntime?.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME)).toEqual(true); + }); + + test('selects latest nodejs runtime', () => { + // GIVEN + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X, Runtime.NODEJS_20_X, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12]; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + + // THEN + expect(latestRuntime?.runtimeEquals(Runtime.NODEJS_20_X)).toEqual(true); + }); + + test('returns undefined if no nodejs runtimes specified', () => { + // GIVEN + const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12]; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + + // THEN + expect(latestRuntime).toBeUndefined; + }); + + test('returns undefined if no runtimes are specified', () => { + // GIVEN + const runtimes = []; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + + // THEN + expect(latestRuntime).toBeUndefined; + }); +}); + +describe('python runtimes', () => { + test('selects latest python runtime', () => { + // GIVEN + const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_7]; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); + + // THEN + expect(latestRuntime?.runtimeEquals(Runtime.PYTHON_3_11)).toEqual(true); + }); + + test('returns undefined if no python runtimes specified', () => { + // GIVEN + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.PYTHON_3_11]; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); + + // THEN + expect(latestRuntime).toBeUndefined; + }); + + test('returns undefined if no runtimes are specified', () => { + // GIVEN + const runtimes = []; + + // WHEN + const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); + + // THEN + expect(latestRuntime).toBeUndefined; + }); +}); From ec18a1cf3a035eaa0af1f0c328c693a296dac46a Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 09:42:41 -0800 Subject: [PATCH 19/74] added isDeprecated flag to deprecated runtimes and added more tests Signed-off-by: Francis --- .../aws-cdk-lib/aws-lambda/lib/runtime.ts | 41 +++++++++-- .../handler-framework/cdk-function.test.ts | 73 +++++++++++++++++++ 2 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts diff --git a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts index f007637cdca78..6d9d10aa46284 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts @@ -62,43 +62,64 @@ export class Runtime { * The NodeJS runtime (nodejs) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS = new Runtime('nodejs', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS = new Runtime('nodejs', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 4.3 runtime (nodejs4.3) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_4_3 = new Runtime('nodejs4.3', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_4_3 = new Runtime('nodejs4.3', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 6.10 runtime (nodejs6.10) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_6_10 = new Runtime('nodejs6.10', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_6_10 = new Runtime('nodejs6.10', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 8.10 runtime (nodejs8.10) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_8_10 = new Runtime('nodejs8.10', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_8_10 = new Runtime('nodejs8.10', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 10.x runtime (nodejs10.x) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_10_X = new Runtime('nodejs10.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_10_X = new Runtime('nodejs10.x', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 12.x runtime (nodejs12.x) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_12_X = new Runtime('nodejs12.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_12_X = new Runtime('nodejs12.x', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 14.x runtime (nodejs14.x) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime. */ - public static readonly NODEJS_14_X = new Runtime('nodejs14.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_14_X = new Runtime('nodejs14.x', RuntimeFamily.NODEJS, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The NodeJS 16.x runtime (nodejs16.x) @@ -124,7 +145,10 @@ export class Runtime { * The Python 2.7 runtime (python2.7) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime. */ - public static readonly PYTHON_2_7 = new Runtime('python2.7', RuntimeFamily.PYTHON, { supportsInlineCode: true }); + public static readonly PYTHON_2_7 = new Runtime('python2.7', RuntimeFamily.PYTHON, { + supportsInlineCode: true, + isDeprecated: true, + }); /** * The Python 3.6 runtime (python3.6) (not recommended) @@ -136,6 +160,7 @@ export class Runtime { public static readonly PYTHON_3_6 = new Runtime('python3.6', RuntimeFamily.PYTHON, { supportsInlineCode: true, supportsCodeGuruProfiling: true, + isDeprecated: true, }); /** diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts new file mode 100644 index 0000000000000..8dca551be7546 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -0,0 +1,73 @@ +import { Template } from '../../../assertions'; +import { Runtime } from '../../../aws-lambda'; +import { Stack } from '../../../core'; +import { CdkCode } from '../../lib/handler-framework/cdk-code'; +import { CdkFunction } from '../../lib/handler-framework/cdk-function'; + +describe('cdk function', () => { + test('stack contains expected lambda function', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset('./test-handler', { + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], + }); + + // WHEN + new CdkFunction(stack, 'Function', { + code, + handler: 'index.handler', + }); + + // THEN + /* eslint-disable no-console */ + console.log(JSON.stringify(Template.fromStack(stack), null, 4)); + }); + + test('throws if no nodejs or python runtimes are specified in cdk code', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset('./test-handler', { + compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], + }); + + // WHEN / THEN + expect(() => { + new CdkFunction(stack, 'Function', { + handler: 'index.handler', + code, + }); + }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); + }); + + test('throws if latest nodejs runtime is deprecated', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset('./test-handler', { + compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], + }); + + // WHEN / THEN + expect(() => { + new CdkFunction(stack, 'Function', { + handler: 'index.handler', + code, + }); + }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); + }); + + test('throws if latest python runtime is deprecated', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset('./test-handler', { + compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], + }); + + // WHEN / THEN + expect(() => { + new CdkFunction(stack, 'Function', { + handler: 'index.handler', + code, + }); + }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); + }); +}); \ No newline at end of file From 193c8b92f487a13f1345b22527d321940f0374c2 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 10:17:39 -0800 Subject: [PATCH 20/74] unit tests Signed-off-by: Francis --- .../test/handler-framework/cdk-code.test.ts | 5 +-- .../handler-framework/cdk-function.test.ts | 34 ++++++++++++++----- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts index 9b781b23d4c5b..b8f496462ea0b 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts @@ -1,3 +1,4 @@ +import * as path from 'path'; import { Runtime } from '../../../aws-lambda'; import { CdkCode } from '../../lib/handler-framework/cdk-code'; @@ -7,9 +8,9 @@ describe('code from asset', () => { const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; // WHEN - const code = CdkCode.fromAsset('./test-handler', { compatibleRuntimes }); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes }); // THEN expect(code.compatibleRuntimes).toEqual(compatibleRuntimes); }); -}); \ No newline at end of file +}); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts index 8dca551be7546..e3510e564de28 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -1,14 +1,16 @@ +import * as path from 'path'; import { Template } from '../../../assertions'; import { Runtime } from '../../../aws-lambda'; -import { Stack } from '../../../core'; +import { App, Stack } from '../../../core'; import { CdkCode } from '../../lib/handler-framework/cdk-code'; import { CdkFunction } from '../../lib/handler-framework/cdk-function'; describe('cdk function', () => { test('stack contains expected lambda function', () => { // GIVEN - const stack = new Stack(); - const code = CdkCode.fromAsset('./test-handler', { + const app = new App(); + const stack = new Stack(app, 'Stack'); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); @@ -19,14 +21,28 @@ describe('cdk function', () => { }); // THEN - /* eslint-disable no-console */ - console.log(JSON.stringify(Template.fromStack(stack), null, 4)); + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { + Code: { + S3Bucket: { + 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', + }, + S3Key: '02227527d0e41dc9ca1090db083832a1fd9a8ec58cc140edb308086dc100a25b.zip', + }, + Handler: 'index.handler', + Role: { + 'Fn::GetAtt': [ + 'FunctionServiceRole675BB04A', + 'Arn', + ], + }, + Runtime: 'nodejs18.x', + }); }); test('throws if no nodejs or python runtimes are specified in cdk code', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset('./test-handler', { + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); @@ -42,7 +58,7 @@ describe('cdk function', () => { test('throws if latest nodejs runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset('./test-handler', { + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], }); @@ -58,7 +74,7 @@ describe('cdk function', () => { test('throws if latest python runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset('./test-handler', { + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], }); @@ -70,4 +86,4 @@ describe('cdk function', () => { }); }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); }); -}); \ No newline at end of file +}); From 4c551498816094fbbda556523a087ebae369a19d Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 10:33:21 -0800 Subject: [PATCH 21/74] update unit test Signed-off-by: Francis --- .../test/helpers-internal/runtime-determiner.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts index 6fbf2e2e6575f..0ca5cfe4bc5c3 100644 --- a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts @@ -61,7 +61,7 @@ describe('python runtimes', () => { test('returns undefined if no python runtimes specified', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.PYTHON_3_11]; + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.NODEJS_20_X]; // WHEN const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); From cc097598ebbce61ce18bda6146eb7772fe7bf0ca Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 12:08:43 -0800 Subject: [PATCH 22/74] singleton unit tests and docstrings Signed-off-by: Francis --- .../helpers-internal/runtime-determiner.ts | 12 ++++ .../cdk-singleton-function.test.ts | 58 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index af4ebd609f01b..08a6127d42367 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -6,6 +6,12 @@ import { Runtime, RuntimeFamily } from '../../../aws-lambda'; export class RuntimeDeterminer { public static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; + /** + * Determines the latest nodejs runtime from a list of runtimes + * + * @param runtimes the list of runtimes to search in + * @returns the latest nodejs runtime or undefined if no nodejs runtimes are provided + */ public static determineLatestNodeJsRuntime(runtimes: Runtime[]) { const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); @@ -25,6 +31,12 @@ export class RuntimeDeterminer { return latestRuntime; } + /** + * Determines the latest python runtime from a list of runtimes + * + * @param runtimes the list of runtimes to search in + * @returns the latest python runtime or undefined if no python runtimes are provided + */ public static determineLatestPythonRuntime(runtimes: Runtime[]) { const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts new file mode 100644 index 0000000000000..8303b552fbeeb --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts @@ -0,0 +1,58 @@ +import * as path from 'path'; +import { Runtime } from '../../../aws-lambda'; +import { Stack } from '../../../core'; +import { CdkCode } from '../../lib/handler-framework/cdk-code'; +import { CdkSingletonFunction } from '../../lib/handler-framework/cdk-singleton-function'; + +describe('cdk singleton function', () => { + test('throws if no nodejs or python runtimes are specified in cdk code', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], + }); + + // WHEN / THEN + expect(() => { + new CdkSingletonFunction(stack, 'Function', { + handler: 'index.handler', + code, + uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', + }); + }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); + }); + + test('throws if latest nodejs runtime is deprecated', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], + }); + + // WHEN / THEN + expect(() => { + new CdkSingletonFunction(stack, 'Function', { + handler: 'index.handler', + code, + uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', + }); + }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); + }); + + test('throws if latest python runtime is deprecated', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], + }); + + // WHEN / THEN + expect(() => { + new CdkSingletonFunction(stack, 'Function', { + handler: 'index.handler', + code, + uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', + }); + }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); + }); +}); \ No newline at end of file From 7bdb2f982aef7002c0445120aeb938aa5cd94858 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 12:48:21 -0800 Subject: [PATCH 23/74] singleton unit tests Signed-off-by: Francis --- .../handler-framework/cdk-function.test.ts | 5 ++- .../cdk-singleton-function.test.ts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts index e3510e564de28..ea23abd884853 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -1,15 +1,14 @@ import * as path from 'path'; import { Template } from '../../../assertions'; import { Runtime } from '../../../aws-lambda'; -import { App, Stack } from '../../../core'; +import { Stack } from '../../../core'; import { CdkCode } from '../../lib/handler-framework/cdk-code'; import { CdkFunction } from '../../lib/handler-framework/cdk-function'; describe('cdk function', () => { test('stack contains expected lambda function', () => { // GIVEN - const app = new App(); - const stack = new Stack(app, 'Stack'); + const stack = new Stack(); const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts index 8303b552fbeeb..dc44fe225f953 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts @@ -1,10 +1,44 @@ import * as path from 'path'; +import { Template } from '../../../assertions'; import { Runtime } from '../../../aws-lambda'; import { Stack } from '../../../core'; import { CdkCode } from '../../lib/handler-framework/cdk-code'; import { CdkSingletonFunction } from '../../lib/handler-framework/cdk-singleton-function'; describe('cdk singleton function', () => { + test('stack contains expected lambda function', () => { + // GIVEN + const stack = new Stack(); + const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], + }); + + // WHEN + new CdkSingletonFunction(stack, 'Function', { + handler: 'index.handler', + code, + uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { + Code: { + S3Bucket: { + 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', + }, + S3Key: '02227527d0e41dc9ca1090db083832a1fd9a8ec58cc140edb308086dc100a25b.zip', + }, + Handler: 'index.handler', + Role: { + 'Fn::GetAtt': [ + 'SingletonLambda84c0de93353f42179b0b45b6c993251aServiceRole26D59235', + 'Arn', + ], + }, + Runtime: 'nodejs18.x', + }); + }); + test('throws if no nodejs or python runtimes are specified in cdk code', () => { // GIVEN const stack = new Stack(); From e86afa537aa9928b49f77759c8a5c486303ba083 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 16 Nov 2023 13:29:33 -0800 Subject: [PATCH 24/74] added some deprecated runtime unit tests Signed-off-by: Francis --- .../aws-lambda/test/runtime.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts index f3976e70c4327..e2911c0b49529 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts @@ -55,3 +55,25 @@ describe('runtime', () => { expect(runtime.bundlingDockerImage.image).toEqual('my-docker-image'); }); }); + +describe('deprecated runtimes', () => { + test('python 2.7 is deprecated', () => { + expect(lambda.Runtime.PYTHON_2_7.isDeprecated).toEqual(true); + }); + + test('python 3.6 is deprecated', () => { + expect(lambda.Runtime.PYTHON_3_6.isDeprecated).toEqual(true); + }); + + test('nodejs 10.x is deprecated', () => { + expect(lambda.Runtime.NODEJS_10_X.isDeprecated).toEqual(true); + }); + + test('nodejs 12.x is deprecated', () => { + expect(lambda.Runtime.NODEJS_12_X.isDeprecated).toEqual(true); + }); + + test('nodejs 14.x is deprecated', () => { + expect(lambda.Runtime.NODEJS_14_X.isDeprecated).toEqual(true); + }); +}); From e23503f61c7eded727a3574f44b7ac754c458a2d Mon Sep 17 00:00:00 2001 From: Francis Date: Fri, 17 Nov 2023 12:24:34 -0800 Subject: [PATCH 25/74] remove exports from index Signed-off-by: Francis --- .../custom-resources/lib/handler-framework/index.ts | 3 --- .../aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts deleted file mode 100644 index 190fdee3a0887..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './cdk-code'; -export * from './cdk-function'; -export * from './cdk-singleton-function'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts index 454d9dd8d5320..56a4389d17878 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/index.ts @@ -1,2 +1 @@ -export * from './sdk-info'; -export * from './runtime-determiner'; \ No newline at end of file +export * from './sdk-info'; \ No newline at end of file From 0446133b02a168ae87520a30e11f33081597a98c Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 08:32:18 -0800 Subject: [PATCH 26/74] update cdk code to cdk handler and add handler as a property Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 14 ++++------- .../{cdk-code.ts => cdk-handler.ts} | 25 +++++++++++++------ .../cdk-singleton-function.ts | 14 ++++------- .../test/handler-framework/cdk-code.test.ts | 7 ++++-- .../handler-framework/cdk-function.test.ts | 13 +++++----- 5 files changed, 39 insertions(+), 34 deletions(-) rename packages/aws-cdk-lib/custom-resources/lib/handler-framework/{cdk-code.ts => cdk-handler.ts} (54%) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 69a8cf56269a8..d4f732210fc72 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,5 +1,5 @@ import { Construct } from 'constructs'; -import { CdkCode } from './cdk-code'; +import { CdkHandler } from './cdk-handler'; import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; @@ -10,12 +10,7 @@ export interface CdkFunctionProps extends FunctionOptions { /** * The source code of your Lambda function. */ - readonly code: CdkCode; - - /** - * The name of the method within your code that Lambda calls to execute your function. - */ - readonly handler: string; + readonly handler: CdkHandler; } /** @@ -45,8 +40,9 @@ export class CdkFunction extends Function { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { ...props, - code: props.code.codeFromAsset, - runtime: CdkFunction.determineRuntime(props.code.compatibleRuntimes), + code: props.handler.code, + handler: props.handler.handler, + runtime: CdkFunction.determineRuntime(props.handler.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts similarity index 54% rename from packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts rename to packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts index 61a82214f79df..de5917fd4eb08 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-code.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts @@ -4,7 +4,12 @@ import { Code, Runtime } from '../../../aws-lambda'; * Properties used to define source code executed within a Lambda function acting as a * custom resource provider. */ -export interface CdkCodeProps { +export interface CdkHandlerProps { + /** + * The name of the method within your code that Lambda calls to execute your function. + */ + readonly handler: string; + /** * Runtimes that are compatible with the source code. */ @@ -15,26 +20,32 @@ export interface CdkCodeProps { * Represents source code that will be executed within a Lambda function acting as a * custom resource provider. */ -export class CdkCode { +export class CdkHandler { /** * Loads the source code from a local disk path. */ - public static fromAsset(path: string, props: CdkCodeProps) { - return new CdkCode(path, props); + public static fromAsset(path: string, props: CdkHandlerProps) { + return new CdkHandler(path, props); } /** * The source code loaded from a local disk path. */ - public readonly codeFromAsset: Code; + public readonly code: Code; + + /** + * The name of the method within your code that Lambda calls to execute your function. + */ + public readonly handler: string; /** * Runtimes that are compatible with the source code. */ public readonly compatibleRuntimes: Runtime[]; - private constructor(path: string, props: CdkCodeProps) { - this.codeFromAsset = Code.fromAsset(path); + private constructor(path: string, props: CdkHandlerProps) { + this.code = Code.fromAsset(path); + this.handler = props.handler; this.compatibleRuntimes = props.compatibleRuntimes; } } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index f0d965aa7696d..96e3fd0aece6e 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -1,5 +1,5 @@ import { Construct } from 'constructs'; -import { CdkCode } from './cdk-code'; +import { CdkHandler } from './cdk-handler'; import { FunctionOptions, Runtime, SingletonFunction } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; @@ -19,12 +19,7 @@ export interface CdkSingletonFunctionProps extends FunctionOptions { /** * The source code of your Lambda function. */ - readonly code: CdkCode; - - /** - * The name of the method within your code that Lambda calls to execute your function. - */ - readonly handler: string; + readonly handler: CdkHandler; /** * A descriptive name for the purpose of this Lambda. @@ -65,8 +60,9 @@ export class CdkSingletonFunction extends SingletonFunction { public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { super(scope, id, { ...props, - code: props.code.codeFromAsset, - runtime: CdkSingletonFunction.determineRuntime(props.code.compatibleRuntimes), + code: props.handler.code, + handler: props.handler.handler, + runtime: CdkSingletonFunction.determineRuntime(props.handler.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts index b8f496462ea0b..8288e70661ac2 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { Runtime } from '../../../aws-lambda'; -import { CdkCode } from '../../lib/handler-framework/cdk-code'; +import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; describe('code from asset', () => { test('correctly sets compatibleRuntimes property', () => { @@ -8,7 +8,10 @@ describe('code from asset', () => { const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; // WHEN - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { compatibleRuntimes }); + const code = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', + compatibleRuntimes, + }); // THEN expect(code.compatibleRuntimes).toEqual(compatibleRuntimes); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts index ea23abd884853..ad6c16a4841c9 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -2,22 +2,20 @@ import * as path from 'path'; import { Template } from '../../../assertions'; import { Runtime } from '../../../aws-lambda'; import { Stack } from '../../../core'; -import { CdkCode } from '../../lib/handler-framework/cdk-code'; import { CdkFunction } from '../../lib/handler-framework/cdk-function'; +import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; describe('cdk function', () => { test('stack contains expected lambda function', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); // WHEN - new CdkFunction(stack, 'Function', { - code, - handler: 'index.handler', - }); + new CdkFunction(stack, 'Function', { handler }); // THEN Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { @@ -41,7 +39,8 @@ describe('cdk function', () => { test('throws if no nodejs or python runtimes are specified in cdk code', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); From 7bc57389bf43f1da909e0e9fb2000155d351f3fa Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 08:43:23 -0800 Subject: [PATCH 27/74] unit tests Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 2 +- .../cdk-singleton-function.ts | 2 +- .../handler-framework/cdk-function.test.ts | 23 ++++++---------- .../cdk-singleton-function.test.ts | 26 +++++++++---------- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index d4f732210fc72..35cd62d718d17 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -8,7 +8,7 @@ import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; */ export interface CdkFunctionProps extends FunctionOptions { /** - * The source code of your Lambda function. + * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. */ readonly handler: CdkHandler; } diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index 96e3fd0aece6e..417be5bdcd8b0 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -17,7 +17,7 @@ export interface CdkSingletonFunctionProps extends FunctionOptions { readonly uuid: string; /** - * The source code of your Lambda function. + * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. */ readonly handler: CdkHandler; diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts index ad6c16a4841c9..4352a114f89f0 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts @@ -40,48 +40,41 @@ describe('cdk function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - + handler: 'index.handler', compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); // WHEN / THEN expect(() => { - new CdkFunction(stack, 'Function', { - handler: 'index.handler', - code, - }); + new CdkFunction(stack, 'Function', { handler }); }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); }); test('throws if latest nodejs runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], }); // WHEN / THEN expect(() => { - new CdkFunction(stack, 'Function', { - handler: 'index.handler', - code, - }); + new CdkFunction(stack, 'Function', { handler }); }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); }); test('throws if latest python runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], }); // WHEN / THEN expect(() => { - new CdkFunction(stack, 'Function', { - handler: 'index.handler', - code, - }); + new CdkFunction(stack, 'Function', { handler }); }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); }); }); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts index dc44fe225f953..181ea4e5f3a85 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts @@ -2,21 +2,21 @@ import * as path from 'path'; import { Template } from '../../../assertions'; import { Runtime } from '../../../aws-lambda'; import { Stack } from '../../../core'; -import { CdkCode } from '../../lib/handler-framework/cdk-code'; +import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; import { CdkSingletonFunction } from '../../lib/handler-framework/cdk-singleton-function'; describe('cdk singleton function', () => { test('stack contains expected lambda function', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); // WHEN new CdkSingletonFunction(stack, 'Function', { - handler: 'index.handler', - code, + handler, uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', }); @@ -42,15 +42,15 @@ describe('cdk singleton function', () => { test('throws if no nodejs or python runtimes are specified in cdk code', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); // WHEN / THEN expect(() => { new CdkSingletonFunction(stack, 'Function', { - handler: 'index.handler', - code, + handler, uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', }); }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); @@ -59,15 +59,15 @@ describe('cdk singleton function', () => { test('throws if latest nodejs runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], }); // WHEN / THEN expect(() => { new CdkSingletonFunction(stack, 'Function', { - handler: 'index.handler', - code, + handler, uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', }); }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); @@ -76,15 +76,15 @@ describe('cdk singleton function', () => { test('throws if latest python runtime is deprecated', () => { // GIVEN const stack = new Stack(); - const code = CdkCode.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], }); // WHEN / THEN expect(() => { new CdkSingletonFunction(stack, 'Function', { - handler: 'index.handler', - code, + handler, uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', }); }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); From 04d5de84cc443648521ad42457c45b0f9db5984c Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 08:52:34 -0800 Subject: [PATCH 28/74] renamed cdk-code.test to cdk-handler.test Signed-off-by: Francis --- .../test/handler-framework/cdk-code.test.ts | 19 ----------- .../handler-framework/cdk-handler.test.ts | 33 +++++++++++++++++++ 2 files changed, 33 insertions(+), 19 deletions(-) delete mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts create mode 100644 packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts deleted file mode 100644 index 8288e70661ac2..0000000000000 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-code.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as path from 'path'; -import { Runtime } from '../../../aws-lambda'; -import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; - -describe('code from asset', () => { - test('correctly sets compatibleRuntimes property', () => { - // GIVEN - const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; - - // WHEN - const code = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', - compatibleRuntimes, - }); - - // THEN - expect(code.compatibleRuntimes).toEqual(compatibleRuntimes); - }); -}); diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts new file mode 100644 index 0000000000000..ab74c50e54484 --- /dev/null +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts @@ -0,0 +1,33 @@ +import * as path from 'path'; +import { Runtime } from '../../../aws-lambda'; +import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; + +describe('code from asset', () => { + test('correctly sets compatibleRuntimes property', () => { + // GIVEN + const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; + + // WHEN + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', + compatibleRuntimes, + }); + + // THEN + expect(handler.compatibleRuntimes).toEqual(compatibleRuntimes); + }); + + test('correctly sets handler property', () => { + // GIVEN + const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; + + // WHEN + const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.handler', + compatibleRuntimes, + }); + + // THEN + expect(handler.handler).toEqual('index.handler'); + }); +}); From fea5616a72c934cde62786a4a188db6fbb965477 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 08:56:49 -0800 Subject: [PATCH 29/74] update index Signed-off-by: Francis --- packages/aws-cdk-lib/custom-resources/lib/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/index.ts b/packages/aws-cdk-lib/custom-resources/lib/index.ts index 2678a4a5f0c7d..b3e6ae4cfb7d5 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/index.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/index.ts @@ -1,3 +1,2 @@ export * from './aws-custom-resource'; -export * from './provider-framework'; -export * from './handler-framework'; \ No newline at end of file +export * from './provider-framework'; \ No newline at end of file From 39c4f3e42a0e064276c80e326d84bdedd42794b0 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 10:23:20 -0800 Subject: [PATCH 30/74] runtime unit tests Signed-off-by: Francis --- .../aws-cdk-lib/aws-lambda/lib/runtime.ts | 28 +++++++++--- .../aws-lambda/test/runtime.test.ts | 44 +++++++++++++++++++ .../handler-framework/integ.cdk-function.ts | 0 .../integ.cdk-singleton-function.ts | 0 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts create mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts diff --git a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts index c9d1965574608..1184cf702154e 100644 --- a/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts @@ -258,37 +258,49 @@ export class Runtime { * The .NET Core 1.0 runtime (dotnetcore1.0) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime. */ - public static readonly DOTNET_CORE_1 = new Runtime('dotnetcore1.0', RuntimeFamily.DOTNET_CORE); + public static readonly DOTNET_CORE_1 = new Runtime('dotnetcore1.0', RuntimeFamily.DOTNET_CORE, { + isDeprecated: true, + }); /** * The .NET Core 2.0 runtime (dotnetcore2.0) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime. */ - public static readonly DOTNET_CORE_2 = new Runtime('dotnetcore2.0', RuntimeFamily.DOTNET_CORE); + public static readonly DOTNET_CORE_2 = new Runtime('dotnetcore2.0', RuntimeFamily.DOTNET_CORE, { + isDeprecated: true, + }); /** * The .NET Core 2.1 runtime (dotnetcore2.1) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime. */ - public static readonly DOTNET_CORE_2_1 = new Runtime('dotnetcore2.1', RuntimeFamily.DOTNET_CORE); + public static readonly DOTNET_CORE_2_1 = new Runtime('dotnetcore2.1', RuntimeFamily.DOTNET_CORE, { + isDeprecated: true, + }); /** * The .NET Core 3.1 runtime (dotnetcore3.1) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime. */ - public static readonly DOTNET_CORE_3_1 = new Runtime('dotnetcore3.1', RuntimeFamily.DOTNET_CORE); + public static readonly DOTNET_CORE_3_1 = new Runtime('dotnetcore3.1', RuntimeFamily.DOTNET_CORE, { + isDeprecated: true, + }); /** * The Go 1.x runtime (go1.x) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the PROVIDED_AL2023 runtime. */ - public static readonly GO_1_X = new Runtime('go1.x', RuntimeFamily.GO); + public static readonly GO_1_X = new Runtime('go1.x', RuntimeFamily.GO, { + isDeprecated: true, + }); /** * The Ruby 2.5 runtime (ruby2.5) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime. */ - public static readonly RUBY_2_5 = new Runtime('ruby2.5', RuntimeFamily.RUBY); + public static readonly RUBY_2_5 = new Runtime('ruby2.5', RuntimeFamily.RUBY, { + isDeprecated: true, + }); /** * The Ruby 2.7 runtime (ruby2.7) @@ -304,7 +316,9 @@ export class Runtime { * The custom provided runtime (provided) * @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest provided.al2023 runtime. */ - public static readonly PROVIDED = new Runtime('provided', RuntimeFamily.OTHER); + public static readonly PROVIDED = new Runtime('provided', RuntimeFamily.OTHER, { + isDeprecated: true, + }); /** * The custom provided runtime with Amazon Linux 2 (provided.al2) diff --git a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts index e2911c0b49529..2f4fedefeed45 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts @@ -65,6 +65,22 @@ describe('deprecated runtimes', () => { expect(lambda.Runtime.PYTHON_3_6.isDeprecated).toEqual(true); }); + test('nodejs is deprecated', () => { + expect(lambda.Runtime.NODEJS.isDeprecated).toEqual(true); + }); + + test('nodejs 4.3 is deprecated', () => { + expect(lambda.Runtime.NODEJS_4_3.isDeprecated).toEqual(true); + }); + + test('nodejs 6.10 is deprecated', () => { + expect(lambda.Runtime.NODEJS_6_10.isDeprecated).toEqual(true); + }); + + test('nodejs 8.10 is deprecated', () => { + expect(lambda.Runtime.NODEJS_8_10.isDeprecated).toEqual(true); + }); + test('nodejs 10.x is deprecated', () => { expect(lambda.Runtime.NODEJS_10_X.isDeprecated).toEqual(true); }); @@ -76,4 +92,32 @@ describe('deprecated runtimes', () => { test('nodejs 14.x is deprecated', () => { expect(lambda.Runtime.NODEJS_14_X.isDeprecated).toEqual(true); }); + + test('.net core 1.0 is deprecated', () => { + expect(lambda.Runtime.DOTNET_CORE_1.isDeprecated).toEqual(true); + }); + + test('.net core 2.0 is deprecated', () => { + expect(lambda.Runtime.DOTNET_CORE_2.isDeprecated).toEqual(true); + }); + + test('.net core 2.1 is deprecated', () => { + expect(lambda.Runtime.DOTNET_CORE_2_1.isDeprecated).toEqual(true); + }); + + test('.net core 3.1 is deprecated', () => { + expect(lambda.Runtime.DOTNET_CORE_3_1.isDeprecated).toEqual(true); + }); + + test('go 1.x is deprecated', () => { + expect(lambda.Runtime.GO_1_X.isDeprecated).toEqual(true); + }); + + test('ruby 2.5 is deprecated', () => { + expect(lambda.Runtime.RUBY_2_5.isDeprecated).toEqual(true); + }); + + test('custom provided runtime is deprecated', () => { + expect(lambda.Runtime.PROVIDED.isDeprecated).toEqual(true); + }); }); diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts new file mode 100644 index 0000000000000..e69de29bb2d1d From 72daf6a825117fe739ef063c5b7b8a61d9e6d93c Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 13:06:52 -0800 Subject: [PATCH 31/74] cdk function integ test Signed-off-by: Francis --- .../handler-framework/integ.cdk-function.ts | 56 ++++++++++++++ .../integ.cdk-singleton-function.ts | 1 + .../handler-framework/test-handler/index.ts | 74 +++++++++++++++++++ .../aws-dynamodb/lib/replica-provider.ts | 20 ++++- .../handler-framework/integ.cdk-function.ts | 0 .../integ.cdk-singleton-function.ts | 0 .../helpers-internal/runtime-determiner.ts | 2 - .../handler-framework/test-handler/index.ts | 4 +- 8 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts create mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts delete mode 100644 packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts new file mode 100644 index 0000000000000..767b79a185e14 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts @@ -0,0 +1,56 @@ +import * as path from 'path'; +import { Construct } from 'constructs'; +import { CdkFunction } from 'aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function'; +import { CdkHandler } from 'aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import { App, CustomResource, Duration, Stack, StackProps } from 'aws-cdk-lib'; +import { Provider } from 'aws-cdk-lib/custom-resources'; +import { Runtime } from 'aws-cdk-lib/aws-lambda'; + +class ProviderStack extends Stack { + public readonly provider: Provider; + public readonly onEventHandler: CdkFunction; + + public constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + handler: 'index.onEventHandler', + compatibleRuntimes: [Runtime.NODEJS_18_X], + }); + + this.onEventHandler = new CdkFunction(this, 'OnEventHandler', { + handler: onEventHandler, + timeout: Duration.minutes(3), + }); + + this.provider = new Provider(this, 'Provider', { + onEventHandler: this.onEventHandler, + }); + } +} + +class TestStack extends Stack { + public constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const providerStack = new ProviderStack(this, 'ProviderStack'); + + new CustomResource(this, 'CdkFunctionInteg', { + serviceToken: providerStack.provider.serviceToken, + resourceType: 'Custom::CdkFunction', + properties: { + TableName: 'CdkFunctionTable', + Region: this.region, + RequestTime: '', + }, + }); + } +} + +const app = new App(); +const testStack = new TestStack(app, 'TestStack'); + +new IntegTest(app, 'cdk-function-integ', { + testCases: [testStack], +}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts new file mode 100644 index 0000000000000..8b137891791fe --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts @@ -0,0 +1 @@ + diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts new file mode 100644 index 0000000000000..9ef67cc323e74 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts @@ -0,0 +1,74 @@ +/* eslint-disable no-console */ +/* eslint-disable import/no-extraneous-dependencies */ +import { DynamoDB } from '@aws-sdk/client-dynamodb'; +import { OnEventRequest, OnEventResponse } from '../../../../custom-resources/lib/provider-framework/types'; + +const dynamodb = new DynamoDB({}); + +export async function onEventHandler(event: OnEventRequest): Promise { + console.log('Event: %j', { ...event, ResponseURL: '...' }); + + const tableName = event.ResourceProperties.TableName; + const region = event.ResourceProperties.Region; + const requestTime = event.ResourceProperties.RequestTime; + + switch (event.RequestType) { + case 'Create': { + await onCreate(tableName, requestTime); + break; + } + case 'Update': { + await onUpdate(tableName, requestTime); + break; + } + case 'Delete': { + await onDelete(tableName); + break; + } + } + + return event.RequestType === 'Create' || event.RequestType === 'Update' + ? { PhysicalResourceId: `${tableName}-${region}` } + : {}; +} + +async function onCreate(tableName: string, requestTime: string) { + await dynamodb.createTable({ + AttributeDefinitions: [ + { AttributeName: 'Request Time', AttributeType: 'S' }, + ], + KeySchema: [ + { AttributeName: 'Request Time', KeyType: 'HASH' }, + ], + ProvisionedThroughput: { + ReadCapacityUnits: 5, + WriteCapacityUnits: 5, + }, + TableName: tableName, + }); + await dynamodb.putItem({ + Item: { + RequestTime: { + S: requestTime, + }, + }, + ReturnConsumedCapacity: 'TOTAL', + TableName: tableName, + }); +} + +async function onUpdate(tableName: string, requestTime: string) { + await dynamodb.putItem({ + Item: { + RequestTime: { + S: requestTime, + }, + }, + ReturnConsumedCapacity: 'TOTAL', + TableName: tableName, + }); +} + +async function onDelete(tableName: string) { + await dynamodb.deleteTable({ TableName: tableName }); +} diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 2bdf842e9ed54..6b59ad2e7ca81 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -4,6 +4,8 @@ import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, Duration, NestedStack, Stack } from '../../core'; import * as cr from '../../custom-resources'; +import { CdkFunction } from '../../custom-resources/lib/handler-framework/cdk-function'; +import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; /** * Properties for a ReplicaProvider @@ -57,14 +59,24 @@ export class ReplicaProvider extends NestedStack { const code = lambda.Code.fromAsset(path.join(__dirname, 'replica-handler')); - // Issues UpdateTable API calls - this.onEventHandler = new lambda.Function(this, 'OnEventHandler', { - code, - runtime: lambda.Runtime.NODEJS_18_X, + const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { handler: 'index.onEventHandler', + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); + + this.onEventHandler = new CdkFunction(this, 'OnEventHandler', { + handler: onEventHandler, timeout: Duration.minutes(5), }); + // Issues UpdateTable API calls + // this.onEventHandler = new lambda.Function(this, 'OnEventHandler', { + // code, + // runtime: lambda.Runtime.NODEJS_18_X, + // handler: 'index.onEventHandler', + // timeout: Duration.minutes(5), + // }); + // Checks if table is back to `ACTIVE` state this.isCompleteHandler = new lambda.Function(this, 'IsCompleteHandler', { code, diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-function.ts deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/integ.cdk-singleton-function.ts deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index 08a6127d42367..0de201315cbe4 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -14,7 +14,6 @@ export class RuntimeDeterminer { */ public static determineLatestNodeJsRuntime(runtimes: Runtime[]) { const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - if (nodeJsRuntimes.length === 0) { return undefined; } @@ -39,7 +38,6 @@ export class RuntimeDeterminer { */ public static determineLatestPythonRuntime(runtimes: Runtime[]) { const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - if (pythonRuntimes.length === 0) { return undefined; } diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts b/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts index cc7924608ec5d..4c6a8a3937bf8 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts +++ b/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts @@ -1,3 +1,3 @@ -export function handler() { - return { message: 'hello world!' }; +export async function handler() { + return { message: 'Hello, world!' }; } From 9ef7f311a7e3fea1497c7678bf4e32f27768fcd4 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 13:29:14 -0800 Subject: [PATCH 32/74] reference path for types Signed-off-by: Francis --- .../handler-framework/integ.cdk-function.ts | 9 +++++---- .../handler-framework/test-handler/index.ts | 4 ++-- .../aws-dynamodb/lib/replica-provider.ts | 20 ++++--------------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts index 767b79a185e14..db7e2ff6220ab 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts @@ -9,7 +9,7 @@ import { Runtime } from 'aws-cdk-lib/aws-lambda'; class ProviderStack extends Stack { public readonly provider: Provider; - public readonly onEventHandler: CdkFunction; + public readonly onEventFunction: CdkFunction; public constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); @@ -19,13 +19,13 @@ class ProviderStack extends Stack { compatibleRuntimes: [Runtime.NODEJS_18_X], }); - this.onEventHandler = new CdkFunction(this, 'OnEventHandler', { + this.onEventFunction = new CdkFunction(this, 'OnEventHandler', { handler: onEventHandler, timeout: Duration.minutes(3), }); this.provider = new Provider(this, 'Provider', { - onEventHandler: this.onEventHandler, + onEventHandler: this.onEventFunction, }); } } @@ -36,13 +36,14 @@ class TestStack extends Stack { const providerStack = new ProviderStack(this, 'ProviderStack'); + const date = new Date(); new CustomResource(this, 'CdkFunctionInteg', { serviceToken: providerStack.provider.serviceToken, resourceType: 'Custom::CdkFunction', properties: { TableName: 'CdkFunctionTable', Region: this.region, - RequestTime: '', + RequestTime: date.toISOString(), }, }); } diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts index 9ef67cc323e74..648d853dc35b8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts @@ -1,11 +1,11 @@ /* eslint-disable no-console */ /* eslint-disable import/no-extraneous-dependencies */ +/// import { DynamoDB } from '@aws-sdk/client-dynamodb'; -import { OnEventRequest, OnEventResponse } from '../../../../custom-resources/lib/provider-framework/types'; const dynamodb = new DynamoDB({}); -export async function onEventHandler(event: OnEventRequest): Promise { +export async function onEventHandler(event: AWSCDKAsyncCustomResource.OnEventRequest): Promise { console.log('Event: %j', { ...event, ResponseURL: '...' }); const tableName = event.ResourceProperties.TableName; diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 6b59ad2e7ca81..2bdf842e9ed54 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -4,8 +4,6 @@ import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, Duration, NestedStack, Stack } from '../../core'; import * as cr from '../../custom-resources'; -import { CdkFunction } from '../../custom-resources/lib/handler-framework/cdk-function'; -import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; /** * Properties for a ReplicaProvider @@ -59,24 +57,14 @@ export class ReplicaProvider extends NestedStack { const code = lambda.Code.fromAsset(path.join(__dirname, 'replica-handler')); - const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { + // Issues UpdateTable API calls + this.onEventHandler = new lambda.Function(this, 'OnEventHandler', { + code, + runtime: lambda.Runtime.NODEJS_18_X, handler: 'index.onEventHandler', - compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], - }); - - this.onEventHandler = new CdkFunction(this, 'OnEventHandler', { - handler: onEventHandler, timeout: Duration.minutes(5), }); - // Issues UpdateTable API calls - // this.onEventHandler = new lambda.Function(this, 'OnEventHandler', { - // code, - // runtime: lambda.Runtime.NODEJS_18_X, - // handler: 'index.onEventHandler', - // timeout: Duration.minutes(5), - // }); - // Checks if table is back to `ACTIVE` state this.isCompleteHandler = new lambda.Function(this, 'IsCompleteHandler', { code, From 2eb901a95aa1992d2e971e26acee2c8023f3ab33 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 13:52:45 -0800 Subject: [PATCH 33/74] updated replica provider with new framework and changed integ test stack naming to force tests to run Signed-off-by: Francis --- .../test/integ.global-replicas-provisioned.ts | 2 +- .../test/aws-dynamodb/test/integ.global.ts | 2 +- .../handler-framework/integ.cdk-function.ts | 57 -------------- .../integ.cdk-singleton-function.ts | 1 - .../handler-framework/test-handler/index.ts | 74 ------------------- .../aws-dynamodb/lib/replica-provider.ts | 24 +++--- 6 files changed, 17 insertions(+), 143 deletions(-) delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts index 36b7a58922832..c156eadb7fad9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts @@ -17,7 +17,7 @@ table.autoScaleWriteCapacity({ maxCapacity: 10, }).scaleOnUtilization({ targetUtilizationPercent: 75 }); -new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-test', { +new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-integ', { testCases: [stack], diffAssets: true, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts index 20ec8ffc316dd..06eb5360ce0b0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts @@ -32,7 +32,7 @@ class TestStack extends Stack { const app = new App(); const stack = new TestStack(app, 'cdk-dynamodb-global-20191121', { env: { region: 'eu-west-1' } }); -new IntegTest(app, 'cdk-dynamodb-global-20191121-test', { +new IntegTest(app, 'cdk-dynamodb-global-integ', { testCases: [stack], diffAssets: true, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts deleted file mode 100644 index db7e2ff6220ab..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-function.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as path from 'path'; -import { Construct } from 'constructs'; -import { CdkFunction } from 'aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function'; -import { CdkHandler } from 'aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler'; -import { IntegTest } from '@aws-cdk/integ-tests-alpha'; -import { App, CustomResource, Duration, Stack, StackProps } from 'aws-cdk-lib'; -import { Provider } from 'aws-cdk-lib/custom-resources'; -import { Runtime } from 'aws-cdk-lib/aws-lambda'; - -class ProviderStack extends Stack { - public readonly provider: Provider; - public readonly onEventFunction: CdkFunction; - - public constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - - const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.onEventHandler', - compatibleRuntimes: [Runtime.NODEJS_18_X], - }); - - this.onEventFunction = new CdkFunction(this, 'OnEventHandler', { - handler: onEventHandler, - timeout: Duration.minutes(3), - }); - - this.provider = new Provider(this, 'Provider', { - onEventHandler: this.onEventFunction, - }); - } -} - -class TestStack extends Stack { - public constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - - const providerStack = new ProviderStack(this, 'ProviderStack'); - - const date = new Date(); - new CustomResource(this, 'CdkFunctionInteg', { - serviceToken: providerStack.provider.serviceToken, - resourceType: 'Custom::CdkFunction', - properties: { - TableName: 'CdkFunctionTable', - Region: this.region, - RequestTime: date.toISOString(), - }, - }); - } -} - -const app = new App(); -const testStack = new TestStack(app, 'TestStack'); - -new IntegTest(app, 'cdk-function-integ', { - testCases: [testStack], -}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/integ.cdk-singleton-function.ts +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts deleted file mode 100644 index 648d853dc35b8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/handler-framework/test-handler/index.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* eslint-disable no-console */ -/* eslint-disable import/no-extraneous-dependencies */ -/// -import { DynamoDB } from '@aws-sdk/client-dynamodb'; - -const dynamodb = new DynamoDB({}); - -export async function onEventHandler(event: AWSCDKAsyncCustomResource.OnEventRequest): Promise { - console.log('Event: %j', { ...event, ResponseURL: '...' }); - - const tableName = event.ResourceProperties.TableName; - const region = event.ResourceProperties.Region; - const requestTime = event.ResourceProperties.RequestTime; - - switch (event.RequestType) { - case 'Create': { - await onCreate(tableName, requestTime); - break; - } - case 'Update': { - await onUpdate(tableName, requestTime); - break; - } - case 'Delete': { - await onDelete(tableName); - break; - } - } - - return event.RequestType === 'Create' || event.RequestType === 'Update' - ? { PhysicalResourceId: `${tableName}-${region}` } - : {}; -} - -async function onCreate(tableName: string, requestTime: string) { - await dynamodb.createTable({ - AttributeDefinitions: [ - { AttributeName: 'Request Time', AttributeType: 'S' }, - ], - KeySchema: [ - { AttributeName: 'Request Time', KeyType: 'HASH' }, - ], - ProvisionedThroughput: { - ReadCapacityUnits: 5, - WriteCapacityUnits: 5, - }, - TableName: tableName, - }); - await dynamodb.putItem({ - Item: { - RequestTime: { - S: requestTime, - }, - }, - ReturnConsumedCapacity: 'TOTAL', - TableName: tableName, - }); -} - -async function onUpdate(tableName: string, requestTime: string) { - await dynamodb.putItem({ - Item: { - RequestTime: { - S: requestTime, - }, - }, - ReturnConsumedCapacity: 'TOTAL', - TableName: tableName, - }); -} - -async function onDelete(tableName: string) { - await dynamodb.deleteTable({ TableName: tableName }); -} diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 2bdf842e9ed54..045f9b9e894db 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -4,6 +4,8 @@ import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, Duration, NestedStack, Stack } from '../../core'; import * as cr from '../../custom-resources'; +import { CdkFunction } from '../../custom-resources/lib/handler-framework/cdk-function'; +import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; /** * Properties for a ReplicaProvider @@ -55,21 +57,25 @@ export class ReplicaProvider extends NestedStack { private constructor(scope: Construct, id: string, props: ReplicaProviderProps) { super(scope, id); - const code = lambda.Code.fromAsset(path.join(__dirname, 'replica-handler')); + const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { + handler: 'index.onEventHandler', + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); + + const onCompleteHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { + handler: 'index.isCompleteHandler', + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); // Issues UpdateTable API calls - this.onEventHandler = new lambda.Function(this, 'OnEventHandler', { - code, - runtime: lambda.Runtime.NODEJS_18_X, - handler: 'index.onEventHandler', + this.onEventHandler = new CdkFunction(this, 'OnEventHandler', { + handler: onEventHandler, timeout: Duration.minutes(5), }); // Checks if table is back to `ACTIVE` state - this.isCompleteHandler = new lambda.Function(this, 'IsCompleteHandler', { - code, - runtime: lambda.Runtime.NODEJS_18_X, - handler: 'index.isCompleteHandler', + this.isCompleteHandler = new CdkFunction(this, 'IsCompleteHandler', { + handler: onCompleteHandler, timeout: Duration.seconds(30), }); From b144ff5d9ecec636207387e3cfa6b8d072d2d68a Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 14:28:00 -0800 Subject: [PATCH 34/74] global snaps Signed-off-by: Francis --- .../test/integ.global-replicas-provisioned.ts | 2 +- ...s.json => cdk-dynamodb-global.assets.json} | 14 +- ...json => cdk-dynamodb-global.template.json} | 24 +- .../test/integ.global.js.snapshot/cdk.out | 2 +- ...licaProvider9479F505.nested.template.json} | 18 +- ...faultTestDeployAssert31B551A3.assets.json} | 4 +- ...ultTestDeployAssert31B551A3.template.json} | 0 .../test/integ.global.js.snapshot/integ.json | 10 +- .../integ.global.js.snapshot/manifest.json | 106 ++++---- .../test/integ.global.js.snapshot/tree.json | 256 ++++++++++-------- .../test/aws-dynamodb/test/integ.global.ts | 2 +- 11 files changed, 232 insertions(+), 206 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdk-dynamodb-global-20191121.assets.json => cdk-dynamodb-global.assets.json} (80%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdk-dynamodb-global-20191121.template.json => cdk-dynamodb-global.template.json} (79%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json => cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json} (95%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json => cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json} (83%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json => cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts index c156eadb7fad9..f839ce0d1e925 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts @@ -3,7 +3,7 @@ import * as cdk from 'aws-cdk-lib'; import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-cdk-dynamodb-global-replicas-provisioned'); +const stack = new cdk.Stack(app, 'dynamodb-global-replicas-provisioned'); const table = new dynamodb.Table(stack, 'Table', { partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json similarity index 80% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json index 996f476ac4ef5..959fdfaefac44 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "760886bc5e09df8d8ecf794d3b9604739062c355e50ca5ae1b07e70ec9233e8b": { "source": { @@ -29,29 +29,29 @@ } } }, - "4084e346026d946757a61510812eb9915ac9ec3a1ed9aa6f16f5076fa98d7c16": { + "3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc": { "source": { - "path": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json", + "path": "cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json", "packaging": "file" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "4084e346026d946757a61510812eb9915ac9ec3a1ed9aa6f16f5076fa98d7c16.json", + "objectKey": "3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } } }, - "4b9ba4a06baae1a9365fe83d7ee157cfc5f3fc9ee5eb9108c49d4fb7fc410d43": { + "4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59": { "source": { - "path": "cdk-dynamodb-global-20191121.template.json", + "path": "cdk-dynamodb-global.template.json", "packaging": "file" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "4b9ba4a06baae1a9365fe83d7ee157cfc5f3fc9ee5eb9108c49d4fb7fc410d43.json", + "objectKey": "4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json index aabd97f28da51..90ff9547cf7bb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json @@ -41,7 +41,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C": { + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -121,13 +121,13 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" ] } ] } }, - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880": { + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -177,7 +177,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" ] } ] @@ -189,7 +189,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" ] }, "TableName": { @@ -198,8 +198,8 @@ "Region": "eu-west-2" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D", + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -210,7 +210,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" ] }, "TableName": { @@ -220,8 +220,8 @@ }, "DependsOn": [ "TableReplicaeuwest290D3CD3A", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D", + "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -230,7 +230,7 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetocdkdynamodbglobal20191121TableB640876BRef": { + "referencetocdkdynamodbglobalTableF3B61EA4Ref": { "Ref": "TableCD117FA1" } }, @@ -246,7 +246,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/4084e346026d946757a61510812eb9915ac9ec3a1ed9aa6f16f5076fa98d7c16.json" + "/3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out index 2313ab5436501..c5cb2e5de6344 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json index bc94a4ffc69e2..84ac257543795 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json @@ -78,7 +78,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" + "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" } ] ] @@ -97,7 +97,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" + "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" } ] ] @@ -302,7 +302,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -439,7 +439,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -573,7 +573,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -723,17 +723,17 @@ } }, "Outputs": { - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": { + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": { "Value": { "Ref": "OnEventHandlerServiceRole15A26729" } }, - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": { + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": { "Value": { "Ref": "IsCompleteHandlerServiceRole5810CC58" } }, - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": { + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -743,7 +743,7 @@ } }, "Parameters": { - "referencetocdkdynamodbglobal20191121TableB640876BRef": { + "referencetocdkdynamodbglobalTableF3B61EA4Ref": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json similarity index 83% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json index 24bd5878f2f77..3cfc6420547a9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json @@ -1,9 +1,9 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json", + "path": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json index 86c845db56291..0086428143d1a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json @@ -1,13 +1,13 @@ { - "version": "34.0.0", + "version": "35.0.0", "testCases": { - "cdk-dynamodb-global-20191121-test/DefaultTest": { + "cdk-dynamodb-global-integ/DefaultTest": { "stacks": [ - "cdk-dynamodb-global-20191121" + "cdk-dynamodb-global" ], "diffAssets": true, - "assertionStack": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert", - "assertionStackName": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611" + "assertionStack": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert", + "assertionStackName": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json index 25e7e3e7adfa8..03392e3e27290 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { - "version": "34.0.0", + "version": "35.0.0", "artifacts": { - "cdk-dynamodb-global-20191121.assets": { + "cdk-dynamodb-global.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdk-dynamodb-global-20191121.assets.json", + "file": "cdk-dynamodb-global.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdk-dynamodb-global-20191121": { + "cdk-dynamodb-global": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/eu-west-1", "properties": { - "templateFile": "cdk-dynamodb-global-20191121.template.json", + "templateFile": "cdk-dynamodb-global.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-eu-west-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-eu-west-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/4b9ba4a06baae1a9365fe83d7ee157cfc5f3fc9ee5eb9108c49d4fb7fc410d43.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdk-dynamodb-global-20191121.assets" + "cdk-dynamodb-global.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-eu-west-1", @@ -31,199 +31,199 @@ } }, "dependencies": [ - "cdk-dynamodb-global-20191121.assets" + "cdk-dynamodb-global.assets" ], "metadata": { - "/cdk-dynamodb-global-20191121/Table/Resource": [ + "/cdk-dynamodb-global/Table/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableCD117FA1" } ], - "/cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/Resource": [ + "/cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" + "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" } ], - "/cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/Resource": [ + "/cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880" + "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D" } ], - "/cdk-dynamodb-global-20191121/Table/Replicaeu-west-2/Default": [ + "/cdk-dynamodb-global/Table/Replicaeu-west-2/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeuwest290D3CD3A" } ], - "/cdk-dynamodb-global-20191121/Table/Replicaeu-central-1/Default": [ + "/cdk-dynamodb-global/Table/Replicaeu-central-1/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeucentral100A6A6E0" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRoleDefaultPolicyC57085D4" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" + "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" + "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" + "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobal20191121TableB640876BRef": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobalTableF3B61EA4Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetocdkdynamodbglobal20191121TableB640876BRef" + "data": "referencetocdkdynamodbglobalTableF3B61EA4Ref" } ], - "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ + "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D" } ], - "/cdk-dynamodb-global-20191121/BootstrapVersion": [ + "/cdk-dynamodb-global/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-dynamodb-global-20191121/CheckBootstrapVersion": [ + "/cdk-dynamodb-global/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-dynamodb-global-20191121" + "displayName": "cdk-dynamodb-global" }, - "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets": { + "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json", + "file": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611": { + "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json", + "templateFile": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -232,7 +232,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets" + "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -241,23 +241,23 @@ } }, "dependencies": [ - "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets" + "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets" ], "metadata": { - "/cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/BootstrapVersion": [ + "/cdk-dynamodb-global-integ/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/cdk-dynamodb-global-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert" + "displayName": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json index f84d85dc1d3d7..3ce9cfa0e1a69 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "cdk-dynamodb-global-20191121": { - "id": "cdk-dynamodb-global-20191121", - "path": "cdk-dynamodb-global-20191121", + "cdk-dynamodb-global": { + "id": "cdk-dynamodb-global", + "path": "cdk-dynamodb-global", "children": { "Table": { "id": "Table", - "path": "cdk-dynamodb-global-20191121/Table", + "path": "cdk-dynamodb-global/Table", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/Table/Resource", + "path": "cdk-dynamodb-global/Table/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -61,23 +61,23 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "cdk-dynamodb-global-20191121/Table/ScalingRole", + "path": "cdk-dynamodb-global/Table/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, - "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A": { - "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A", + "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F": { + "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/ImportedResource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -85,7 +85,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/Resource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -166,7 +166,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" ] } ] @@ -186,20 +186,20 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, - "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128": { - "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128", + "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34": { + "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/ImportedResource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -207,7 +207,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/Resource", + "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -258,7 +258,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" + "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" ] } ] @@ -278,16 +278,16 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "Replicaeu-west-2": { "id": "Replicaeu-west-2", - "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-west-2", + "path": "cdk-dynamodb-global/Table/Replicaeu-west-2", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-west-2/Default", + "path": "cdk-dynamodb-global/Table/Replicaeu-west-2/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -301,11 +301,11 @@ }, "Replicaeu-central-1": { "id": "Replicaeu-central-1", - "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-central-1", + "path": "cdk-dynamodb-global/Table/Replicaeu-central-1", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-central-1/Default", + "path": "cdk-dynamodb-global/Table/Replicaeu-central-1/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -325,19 +325,19 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { "OnEventHandler": { "id": "OnEventHandler", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -345,7 +345,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -384,11 +384,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -436,7 +436,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" + "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" } ] ] @@ -455,7 +455,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" + "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" } ] ] @@ -492,11 +492,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -504,7 +504,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -518,7 +518,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -552,15 +552,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -568,7 +568,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -611,9 +611,35 @@ "version": "0.0.0" } }, + "Code": { + "id": "Code", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -647,19 +673,19 @@ }, "Provider": { "id": "Provider", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -667,7 +693,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -706,11 +732,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -799,11 +825,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -811,7 +837,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -825,7 +851,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -835,7 +861,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -879,15 +905,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -895,7 +921,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -934,11 +960,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1020,11 +1046,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1032,7 +1058,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1046,7 +1072,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1056,7 +1082,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1097,15 +1123,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1113,7 +1139,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1152,11 +1178,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1238,11 +1264,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1250,7 +1276,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1264,7 +1290,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1274,7 +1300,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1315,15 +1341,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1331,7 +1357,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1356,11 +1382,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1442,7 +1468,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1451,7 +1477,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, @@ -1460,33 +1486,33 @@ "version": "0.0.0" } }, - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": { - "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref", + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": { + "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": { - "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref", + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": { + "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": { - "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn", + "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": { + "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-cdkdynamodbglobal20191121TableB640876BRef": { - "id": "reference-to-cdkdynamodbglobal20191121TableB640876BRef", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobal20191121TableB640876BRef", + "reference-to-cdkdynamodbglobalTableF3B61EA4Ref": { + "id": "reference-to-cdkdynamodbglobalTableF3B61EA4Ref", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobalTableF3B61EA4Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1500,16 +1526,16 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", "children": { "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", + "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetocdkdynamodbglobal20191121TableB640876BRef": { + "referencetocdkdynamodbglobalTableF3B61EA4Ref": { "Ref": "TableCD117FA1" } }, @@ -1525,7 +1551,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/4084e346026d946757a61510812eb9915ac9ec3a1ed9aa6f16f5076fa98d7c16.json" + "/3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json" ] ] } @@ -1539,12 +1565,12 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-dynamodb-global-20191121/BootstrapVersion", + "path": "cdk-dynamodb-global/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1552,7 +1578,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-dynamodb-global-20191121/CheckBootstrapVersion", + "path": "cdk-dynamodb-global/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1564,29 +1590,29 @@ "version": "0.0.0" } }, - "cdk-dynamodb-global-20191121-test": { - "id": "cdk-dynamodb-global-20191121-test", - "path": "cdk-dynamodb-global-20191121-test", + "cdk-dynamodb-global-integ": { + "id": "cdk-dynamodb-global-integ", + "path": "cdk-dynamodb-global-integ", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "cdk-dynamodb-global-20191121-test/DefaultTest", + "path": "cdk-dynamodb-global-integ/DefaultTest", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global-20191121-test/DefaultTest/Default", + "path": "cdk-dynamodb-global-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "DeployAssert": { "id": "DeployAssert", - "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert", + "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/BootstrapVersion", + "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1594,7 +1620,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1623,7 +1649,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts index 06eb5360ce0b0..fa88da0b48d07 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts @@ -30,7 +30,7 @@ class TestStack extends Stack { } const app = new App(); -const stack = new TestStack(app, 'cdk-dynamodb-global-20191121', { env: { region: 'eu-west-1' } }); +const stack = new TestStack(app, 'cdk-dynamodb-global', { env: { region: 'eu-west-1' } }); new IntegTest(app, 'cdk-dynamodb-global-integ', { testCases: [stack], From e61ff82bba6105d893e9b8f99fe952db7993c6d4 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 14:53:58 -0800 Subject: [PATCH 35/74] global replicas provisioned snaps Signed-off-by: Francis --- ...faultTestDeployAssertEF84B38D.assets.json} | 4 +- ...ultTestDeployAssertEF84B38D.template.json} | 0 .../cdk.out | 2 +- ...b-global-replicas-provisioned.assets.json} | 14 +- ...global-replicas-provisioned.template.json} | 26 +- ...licaProvider246E3869.nested.template.json} | 18 +- .../integ.json | 10 +- .../manifest.json | 114 ++++---- .../tree.json | 272 ++++++++++-------- 9 files changed, 243 insertions(+), 217 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json => awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json} (81%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json => awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{aws-cdk-dynamodb-global-replicas-provisioned.assets.json => dynamodb-global-replicas-provisioned.assets.json} (78%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{aws-cdk-dynamodb-global-replicas-provisioned.template.json => dynamodb-global-replicas-provisioned.template.json} (81%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json => dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json} (94%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json similarity index 81% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json index 28aa8f93b1502..533422b936105 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json @@ -1,9 +1,9 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json", + "path": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out index 2313ab5436501..c5cb2e5de6344 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json similarity index 78% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json index 6aa345dfe2951..d934c52dbeba0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "760886bc5e09df8d8ecf794d3b9604739062c355e50ca5ae1b07e70ec9233e8b": { "source": { @@ -27,28 +27,28 @@ } } }, - "ac8e78dd6cdba3c08283cefbc33e5e4096ec136d831df9b0754e3d41ca86dfc9": { + "7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe": { "source": { - "path": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json", + "path": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ac8e78dd6cdba3c08283cefbc33e5e4096ec136d831df9b0754e3d41ca86dfc9.json", + "objectKey": "7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "63241861e0bebd27e43e4488ef198d090cae314e8a255dab361b6c8899874900": { + "9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6": { "source": { - "path": "aws-cdk-dynamodb-global-replicas-provisioned.template.json", + "path": "dynamodb-global-replicas-provisioned.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "63241861e0bebd27e43e4488ef198d090cae314e8a255dab361b6c8899874900.json", + "objectKey": "9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json similarity index 81% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json index a2497b3f4e6aa..ab6512c372206 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json @@ -26,7 +26,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB": { + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -103,13 +103,13 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" ] } ] } }, - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2": { + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" ] } ] @@ -160,7 +160,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" ] }, "TableName": { @@ -169,8 +169,8 @@ "Region": "us-east-2" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2", - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB", + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621", + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -184,7 +184,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" ] }, "TableName": { @@ -193,8 +193,8 @@ "Region": "eu-west-3" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2", - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB", + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621", + "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -254,7 +254,7 @@ "TableWriteScalingTargetTrackingD78DCCD8": { "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", "Properties": { - "PolicyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTrackingD631E2EC", + "PolicyName": "dynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking682B78E1", "PolicyType": "TargetTrackingScaling", "ScalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -271,7 +271,7 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { + "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { "Ref": "TableCD117FA1" } }, @@ -291,7 +291,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/ac8e78dd6cdba3c08283cefbc33e5e4096ec136d831df9b0754e3d41ca86dfc9.json" + "/7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json similarity index 94% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json index 4e1fe6633c1e6..0955141449d29 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json @@ -82,7 +82,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" + "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" } ] ] @@ -101,7 +101,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" + "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" } ] ] @@ -306,7 +306,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -443,7 +443,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -577,7 +577,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -727,17 +727,17 @@ } }, "Outputs": { - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": { + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": { "Value": { "Ref": "OnEventHandlerServiceRole15A26729" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": { + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": { "Value": { "Ref": "IsCompleteHandlerServiceRole5810CC58" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": { + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -747,7 +747,7 @@ } }, "Parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { + "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json index 78c5680443cd1..9bf034aa1e140 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json @@ -1,13 +1,13 @@ { - "version": "34.0.0", + "version": "35.0.0", "testCases": { - "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest": { + "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest": { "stacks": [ - "aws-cdk-dynamodb-global-replicas-provisioned" + "dynamodb-global-replicas-provisioned" ], "diffAssets": true, - "assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert", - "assertionStackName": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54" + "assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert", + "assertionStackName": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json index 98fe5a0e8ba8c..e37dd97b75952 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { - "version": "34.0.0", + "version": "35.0.0", "artifacts": { - "aws-cdk-dynamodb-global-replicas-provisioned.assets": { + "dynamodb-global-replicas-provisioned.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdk-dynamodb-global-replicas-provisioned.assets.json", + "file": "dynamodb-global-replicas-provisioned.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdk-dynamodb-global-replicas-provisioned": { + "dynamodb-global-replicas-provisioned": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-cdk-dynamodb-global-replicas-provisioned.template.json", + "templateFile": "dynamodb-global-replicas-provisioned.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/63241861e0bebd27e43e4488ef198d090cae314e8a255dab361b6c8899874900.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdk-dynamodb-global-replicas-provisioned.assets" + "dynamodb-global-replicas-provisioned.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,223 +31,223 @@ } }, "dependencies": [ - "aws-cdk-dynamodb-global-replicas-provisioned.assets" + "dynamodb-global-replicas-provisioned.assets" ], "metadata": { - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Resource": [ + "/dynamodb-global-replicas-provisioned/Table/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableCD117FA1" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/Resource": [ + "/dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB" + "data": "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/Resource": [ + "/dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2" + "data": "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ + "/dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicauseast28A15C236" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ + "/dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualsuseast2D20A1E77" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ + "/dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeuwest314C3E552" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ + "/dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualseuwest302B3591C" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ + "/dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetE5669214" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ + "/dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetTrackingD78DCCD8" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRoleDefaultPolicyC57085D4" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" + "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" + "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" + "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" + "data": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ + "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/BootstrapVersion": [ + "/dynamodb-global-replicas-provisioned/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ + "/dynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-dynamodb-global-replicas-provisioned" + "displayName": "dynamodb-global-replicas-provisioned" }, - "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets": { + "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json", + "file": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54": { + "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json", + "templateFile": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -256,7 +256,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets" + "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -265,23 +265,23 @@ } }, "dependencies": [ - "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets" + "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets" ], "metadata": { - "/aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert" + "displayName": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json index 50b041ebc9655..cd659b5446464 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-cdk-dynamodb-global-replicas-provisioned": { - "id": "aws-cdk-dynamodb-global-replicas-provisioned", - "path": "aws-cdk-dynamodb-global-replicas-provisioned", + "dynamodb-global-replicas-provisioned": { + "id": "dynamodb-global-replicas-provisioned", + "path": "dynamodb-global-replicas-provisioned", "children": { "Table": { "id": "Table", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table", + "path": "dynamodb-global-replicas-provisioned/Table", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -46,23 +46,23 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/ScalingRole", + "path": "dynamodb-global-replicas-provisioned/Table/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, - "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77": { - "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77", + "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D": { + "id": "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/ImportedResource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -70,7 +70,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" ] } ] @@ -168,20 +168,20 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, - "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A": { - "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A", + "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98": { + "id": "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/ImportedResource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -189,7 +189,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -229,7 +229,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" + "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" ] } ] @@ -249,16 +249,16 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "Replicaus-east-2": { "id": "Replicaus-east-2", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2", + "path": "dynamodb-global-replicas-provisioned/Table/Replicaus-east-2", "children": { "Default": { "id": "Default", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", + "path": "dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -272,7 +272,7 @@ }, "StackRegionNotEqualsus-east-2": { "id": "StackRegionNotEqualsus-east-2", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", + "path": "dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -280,11 +280,11 @@ }, "Replicaeu-west-3": { "id": "Replicaeu-west-3", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", + "path": "dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", "children": { "Default": { "id": "Default", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", + "path": "dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -298,7 +298,7 @@ }, "StackRegionNotEqualseu-west-3": { "id": "StackRegionNotEqualseu-west-3", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", + "path": "dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -306,15 +306,15 @@ }, "WriteScaling": { "id": "WriteScaling", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling", + "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling", "children": { "Target": { "id": "Target", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target", + "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", "aws:cdk:cloudformation:props": { @@ -358,15 +358,15 @@ }, "Tracking": { "id": "Tracking", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", + "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", + "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", "aws:cdk:cloudformation:props": { - "policyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTrackingD631E2EC", + "policyName": "dynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking682B78E1", "policyType": "TargetTrackingScaling", "scalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -410,19 +410,19 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { "OnEventHandler": { "id": "OnEventHandler", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -430,7 +430,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -469,11 +469,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -525,7 +525,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" + "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" } ] ] @@ -544,7 +544,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" + "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" } ] ] @@ -581,11 +581,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -593,7 +593,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -607,7 +607,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -641,15 +641,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -657,7 +657,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -700,9 +700,35 @@ "version": "0.0.0" } }, + "Code": { + "id": "Code", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -736,19 +762,19 @@ }, "Provider": { "id": "Provider", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -756,7 +782,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -795,11 +821,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -888,11 +914,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -900,7 +926,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -914,7 +940,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -924,7 +950,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -968,15 +994,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -984,7 +1010,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1023,11 +1049,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1109,11 +1135,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1121,7 +1147,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1135,7 +1161,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1145,7 +1171,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1186,15 +1212,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1202,7 +1228,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1241,11 +1267,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1327,11 +1353,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1339,7 +1365,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1353,7 +1379,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1363,7 +1389,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1404,15 +1430,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1420,7 +1446,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1445,11 +1471,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1531,7 +1557,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1540,7 +1566,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, @@ -1549,33 +1575,33 @@ "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef", + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": { + "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref", + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": { + "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn", + "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": { + "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { - "id": "reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref", + "reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef": { + "id": "reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1589,16 +1615,16 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", "children": { "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", + "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { + "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { "Ref": "TableCD117FA1" } }, @@ -1618,7 +1644,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/ac8e78dd6cdba3c08283cefbc33e5e4096ec136d831df9b0754e3d41ca86dfc9.json" + "/7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json" ] ] } @@ -1632,12 +1658,12 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/BootstrapVersion", + "path": "dynamodb-global-replicas-provisioned/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1645,7 +1671,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned/CheckBootstrapVersion", + "path": "dynamodb-global-replicas-provisioned/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1657,29 +1683,29 @@ "version": "0.0.0" } }, - "aws-cdk-dynamodb-global-replicas-provisioned-test": { - "id": "aws-cdk-dynamodb-global-replicas-provisioned-test", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test", + "aws-cdk-dynamodb-global-replicas-provisioned-integ": { + "id": "aws-cdk-dynamodb-global-replicas-provisioned-integ", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/Default", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1687,7 +1713,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1716,7 +1742,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, From cc52bdf565ccb31f698bf0a10121afb96fe4efb9 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 15:00:55 -0800 Subject: [PATCH 36/74] updated receipt to use cdk handler and cdk singleton function Signed-off-by: Francis --- .../test/aws-ses/test/integ.receipt.ts | 4 ++-- packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts index 67fe056c31020..a8eeb733ab36b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts @@ -4,7 +4,7 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-cdk-ses-receipt'); +const stack = new cdk.Stack(app, 'AwsCdkSesReceipt'); const ruleSet = new ses.ReceiptRuleSet(stack, 'RuleSet', { dropSpam: true, @@ -25,7 +25,7 @@ new ses.AllowListReceiptFilter(stack, 'Allowlist', { ], }); -new IntegTest(app, 'cdk-ses-receipt-integ', { +new IntegTest(app, 'CdkSesReceiptInteg', { testCases: [stack], diffAssets: true, }); diff --git a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts index f0bf13f0008d1..ffc4bbf6fe2d3 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts @@ -6,6 +6,8 @@ import { CfnReceiptRule } from './ses.generated'; import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, IResource, Lazy, Resource } from '../../core'; +import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; +import { CdkSingletonFunction } from '../../custom-resources/lib/handler-framework/cdk-singleton-function'; /** * A receipt rule. @@ -171,10 +173,13 @@ export class DropSpamReceiptRule extends Construct { constructor(scope: Construct, id: string, props: DropSpamReceiptRuleProps) { super(scope, id); - const fn = new lambda.SingletonFunction(this, 'Function', { - runtime: lambda.Runtime.NODEJS_18_X, + const handler = CdkHandler.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler'), { handler: 'index.handler', - code: lambda.Code.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler')), + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); + + const fn = new CdkSingletonFunction(this, 'Function', { + handler, uuid: '224e77f9-a32e-4b4d-ac32-983477abba16', }); From 6fa5f4a3708914fb3e1e29ad3534af02e5529646 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 20 Nov 2023 15:16:52 -0800 Subject: [PATCH 37/74] receipt snaps Signed-off-by: Francis --- ...sets.json => AwsCdkSesReceipt.assets.json} | 4 +- ...te.json => AwsCdkSesReceipt.template.json} | 0 ...faultTestDeployAssert45B267B0.assets.json} | 4 +- ...ultTestDeployAssert45B267B0.template.json} | 0 .../test/integ.receipt.js.snapshot/cdk.out | 2 +- .../test/integ.receipt.js.snapshot/integ.json | 10 +-- .../integ.receipt.js.snapshot/manifest.json | 56 ++++++------- .../test/integ.receipt.js.snapshot/tree.json | 78 +++++++++---------- 8 files changed, 77 insertions(+), 77 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{aws-cdk-ses-receipt.assets.json => AwsCdkSesReceipt.assets.json} (94%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{aws-cdk-ses-receipt.template.json => AwsCdkSesReceipt.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json => CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json} (84%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json => CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json similarity index 94% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json index b106dbfbee98c..d4782e45d6caf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec": { "source": { @@ -16,7 +16,7 @@ }, "01f1f22cef4fedb5237147fa8010b633dff484879b4c558102725a9d9494c8fe": { "source": { - "path": "aws-cdk-ses-receipt.template.json", + "path": "AwsCdkSesReceipt.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json similarity index 84% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json index dda93d64b6263..1e0f35e80e9e6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json @@ -1,9 +1,9 @@ { - "version": "34.0.0", + "version": "35.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json", + "path": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out index 2313ab5436501..c5cb2e5de6344 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json index 56efa0063e353..fb42b7842f234 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json @@ -1,13 +1,13 @@ { - "version": "34.0.0", + "version": "35.0.0", "testCases": { - "cdk-ses-receipt-integ/DefaultTest": { + "CdkSesReceiptInteg/DefaultTest": { "stacks": [ - "aws-cdk-ses-receipt" + "AwsCdkSesReceipt" ], "diffAssets": true, - "assertionStack": "cdk-ses-receipt-integ/DefaultTest/DeployAssert", - "assertionStackName": "cdksesreceiptintegDefaultTestDeployAssertA2776C75" + "assertionStack": "CdkSesReceiptInteg/DefaultTest/DeployAssert", + "assertionStackName": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json index cd61ccb2dddf6..1ab73367fb37b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json @@ -1,19 +1,19 @@ { - "version": "34.0.0", + "version": "35.0.0", "artifacts": { - "aws-cdk-ses-receipt.assets": { + "AwsCdkSesReceipt.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdk-ses-receipt.assets.json", + "file": "AwsCdkSesReceipt.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdk-ses-receipt": { + "AwsCdkSesReceipt": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-cdk-ses-receipt.template.json", + "templateFile": "AwsCdkSesReceipt.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -22,7 +22,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdk-ses-receipt.assets" + "AwsCdkSesReceipt.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,91 +31,91 @@ } }, "dependencies": [ - "aws-cdk-ses-receipt.assets" + "AwsCdkSesReceipt.assets" ], "metadata": { - "/aws-cdk-ses-receipt/RuleSet/Resource": [ + "/AwsCdkSesReceipt/RuleSet/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetE30C6C48" } ], - "/aws-cdk-ses-receipt/RuleSet/DropSpam/Rule/Resource": [ + "/AwsCdkSesReceipt/RuleSet/DropSpam/Rule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetDropSpamRule5809F51B" } ], - "/aws-cdk-ses-receipt/RuleSet/FirstRule/Resource": [ + "/AwsCdkSesReceipt/RuleSet/FirstRule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetFirstRule0A27C8CC" } ], - "/aws-cdk-ses-receipt/RuleSet/SecondRule/Resource": [ + "/AwsCdkSesReceipt/RuleSet/SecondRule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetSecondRule03178AD4" } ], - "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource": [ + "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4" } ], - "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource": [ + "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15" } ], - "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes": [ + "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba16AllowSesB42DF904" } ], - "/aws-cdk-ses-receipt/Allowlist/BlockAll/Resource": [ + "/AwsCdkSesReceipt/Allowlist/BlockAll/Resource": [ { "type": "aws:cdk:logicalId", "data": "AllowlistBlockAll7E0A7F11" } ], - "/aws-cdk-ses-receipt/Allowlist/Allow1000016/Resource": [ + "/AwsCdkSesReceipt/Allowlist/Allow1000016/Resource": [ { "type": "aws:cdk:logicalId", "data": "AllowlistAllow1000016E9465A18" } ], - "/aws-cdk-ses-receipt/BootstrapVersion": [ + "/AwsCdkSesReceipt/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-ses-receipt/CheckBootstrapVersion": [ + "/AwsCdkSesReceipt/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-ses-receipt" + "displayName": "AwsCdkSesReceipt" }, - "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets": { + "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json", + "file": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdksesreceiptintegDefaultTestDeployAssertA2776C75": { + "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json", + "templateFile": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -124,7 +124,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets" + "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -133,23 +133,23 @@ } }, "dependencies": [ - "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets" + "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets" ], "metadata": { - "/cdk-ses-receipt-integ/DefaultTest/DeployAssert/BootstrapVersion": [ + "/CdkSesReceiptInteg/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-ses-receipt-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/CdkSesReceiptInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-ses-receipt-integ/DefaultTest/DeployAssert" + "displayName": "CdkSesReceiptInteg/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json index a1bfec6fdcbe9..178ec0c62ed87 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-cdk-ses-receipt": { - "id": "aws-cdk-ses-receipt", - "path": "aws-cdk-ses-receipt", + "AwsCdkSesReceipt": { + "id": "AwsCdkSesReceipt", + "path": "AwsCdkSesReceipt", "children": { "RuleSet": { "id": "RuleSet", - "path": "aws-cdk-ses-receipt/RuleSet", + "path": "AwsCdkSesReceipt/RuleSet", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/RuleSet/Resource", + "path": "AwsCdkSesReceipt/RuleSet/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRuleSet", "aws:cdk:cloudformation:props": {} @@ -26,11 +26,11 @@ }, "DropSpam": { "id": "DropSpam", - "path": "aws-cdk-ses-receipt/RuleSet/DropSpam", + "path": "AwsCdkSesReceipt/RuleSet/DropSpam", "children": { "Function": { "id": "Function", - "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Function", + "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Function", "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", "version": "0.0.0" @@ -38,11 +38,11 @@ }, "Rule": { "id": "Rule", - "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Rule", + "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Rule", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Rule/Resource", + "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Rule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -87,11 +87,11 @@ }, "FirstRule": { "id": "FirstRule", - "path": "aws-cdk-ses-receipt/RuleSet/FirstRule", + "path": "AwsCdkSesReceipt/RuleSet/FirstRule", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/RuleSet/FirstRule/Resource", + "path": "AwsCdkSesReceipt/RuleSet/FirstRule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -125,11 +125,11 @@ }, "SecondRule": { "id": "SecondRule", - "path": "aws-cdk-ses-receipt/RuleSet/SecondRule", + "path": "AwsCdkSesReceipt/RuleSet/SecondRule", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/RuleSet/SecondRule/Resource", + "path": "AwsCdkSesReceipt/RuleSet/SecondRule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -163,15 +163,15 @@ }, "SingletonLambda224e77f9a32e4b4dac32983477abba16": { "id": "SingletonLambda224e77f9a32e4b4dac32983477abba16", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/ImportServiceRole", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -179,7 +179,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -224,11 +224,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/Stage", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -236,7 +236,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/AssetBucket", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -250,7 +250,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -277,7 +277,7 @@ }, "AllowSes": { "id": "AllowSes", - "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes", + "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { @@ -307,15 +307,15 @@ }, "Allowlist": { "id": "Allowlist", - "path": "aws-cdk-ses-receipt/Allowlist", + "path": "AwsCdkSesReceipt/Allowlist", "children": { "BlockAll": { "id": "BlockAll", - "path": "aws-cdk-ses-receipt/Allowlist/BlockAll", + "path": "AwsCdkSesReceipt/Allowlist/BlockAll", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/Allowlist/BlockAll/Resource", + "path": "AwsCdkSesReceipt/Allowlist/BlockAll/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptFilter", "aws:cdk:cloudformation:props": { @@ -340,11 +340,11 @@ }, "Allow1000016": { "id": "Allow1000016", - "path": "aws-cdk-ses-receipt/Allowlist/Allow1000016", + "path": "AwsCdkSesReceipt/Allowlist/Allow1000016", "children": { "Resource": { "id": "Resource", - "path": "aws-cdk-ses-receipt/Allowlist/Allow1000016/Resource", + "path": "AwsCdkSesReceipt/Allowlist/Allow1000016/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptFilter", "aws:cdk:cloudformation:props": { @@ -375,7 +375,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-ses-receipt/BootstrapVersion", + "path": "AwsCdkSesReceipt/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -383,7 +383,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-ses-receipt/CheckBootstrapVersion", + "path": "AwsCdkSesReceipt/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -395,29 +395,29 @@ "version": "0.0.0" } }, - "cdk-ses-receipt-integ": { - "id": "cdk-ses-receipt-integ", - "path": "cdk-ses-receipt-integ", + "CdkSesReceiptInteg": { + "id": "CdkSesReceiptInteg", + "path": "CdkSesReceiptInteg", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "cdk-ses-receipt-integ/DefaultTest", + "path": "CdkSesReceiptInteg/DefaultTest", "children": { "Default": { "id": "Default", - "path": "cdk-ses-receipt-integ/DefaultTest/Default", + "path": "CdkSesReceiptInteg/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } }, "DeployAssert": { "id": "DeployAssert", - "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert", + "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert/BootstrapVersion", + "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -425,7 +425,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -454,7 +454,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.2.70" + "version": "10.3.0" } } }, From ac37074eeb96fe624329feea18eff58a6a0f7306 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 05:04:38 -0800 Subject: [PATCH 38/74] refactored runtime determiner Signed-off-by: Francis --- .../lib/handler-framework/cdk-function.ts | 8 ++-- .../cdk-singleton-function.ts | 8 ++-- .../helpers-internal/runtime-determiner.ts | 40 +++++++++-------- .../runtime-determiner.test.ts | 44 +++++++++---------- 4 files changed, 52 insertions(+), 48 deletions(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts index 35cd62d718d17..5c44e6c2bf727 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { Function, FunctionOptions, Runtime } from '../../../aws-lambda'; +import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** @@ -18,7 +18,8 @@ export interface CdkFunctionProps extends FunctionOptions { */ export class CdkFunction extends Function { private static determineRuntime(compatibleRuntimes: Runtime[]) { - const latestNodeJsRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(compatibleRuntimes); + const nodeJsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); if (latestNodeJsRuntime !== undefined) { if (latestNodeJsRuntime.isDeprecated) { throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); @@ -26,7 +27,8 @@ export class CdkFunction extends Function { return latestNodeJsRuntime; } - const latestPythonRuntime = RuntimeDeterminer.determineLatestPythonRuntime(compatibleRuntimes); + const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); if (latestPythonRuntime !== undefined) { if (latestPythonRuntime.isDeprecated) { throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts index 417be5bdcd8b0..964685c306e54 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { FunctionOptions, Runtime, SingletonFunction } from '../../../aws-lambda'; +import { FunctionOptions, Runtime, RuntimeFamily, SingletonFunction } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; /** @@ -38,7 +38,8 @@ export interface CdkSingletonFunctionProps extends FunctionOptions { */ export class CdkSingletonFunction extends SingletonFunction { private static determineRuntime(compatibleRuntimes: Runtime[]) { - const latestNodeJsRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(compatibleRuntimes); + const nodeJsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); if (latestNodeJsRuntime !== undefined) { if (latestNodeJsRuntime.isDeprecated) { throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); @@ -46,7 +47,8 @@ export class CdkSingletonFunction extends SingletonFunction { return latestNodeJsRuntime; } - const latestPythonRuntime = RuntimeDeterminer.determineLatestPythonRuntime(compatibleRuntimes); + const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); if (latestPythonRuntime !== undefined) { if (latestPythonRuntime.isDeprecated) { throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts index 0de201315cbe4..e310383aee8bd 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts @@ -7,13 +7,14 @@ export class RuntimeDeterminer { public static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; /** - * Determines the latest nodejs runtime from a list of runtimes + * Determines the latest nodejs runtime from a list of nodejs runtimes * - * @param runtimes the list of runtimes to search in + * @param nodeJsRuntimes the list of nodejs runtimes to search in * @returns the latest nodejs runtime or undefined if no nodejs runtimes are provided */ - public static determineLatestNodeJsRuntime(runtimes: Runtime[]) { - const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + public static latestNodeJsRuntime(nodeJsRuntimes: Runtime[]) { + RuntimeDeterminer.validateRuntimes(nodeJsRuntimes, RuntimeFamily.NODEJS); + if (nodeJsRuntimes.length === 0) { return undefined; } @@ -24,41 +25,34 @@ export class RuntimeDeterminer { let latestRuntime = nodeJsRuntimes[0]; for (let idx = 1; idx < nodeJsRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.compareNodeJsRuntimes(latestRuntime, nodeJsRuntimes[idx]); + latestRuntime = RuntimeDeterminer.latestRuntime(latestRuntime, nodeJsRuntimes[idx], RuntimeFamily.NODEJS); } return latestRuntime; } /** - * Determines the latest python runtime from a list of runtimes + * Determines the latest python runtime from a list of python runtimes * - * @param runtimes the list of runtimes to search in + * @param pythonRuntimes the list of python runtimes to search in * @returns the latest python runtime or undefined if no python runtimes are provided */ - public static determineLatestPythonRuntime(runtimes: Runtime[]) { - const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + public static latestPythonRuntime(pythonRuntimes: Runtime[]) { + RuntimeDeterminer.validateRuntimes(pythonRuntimes, RuntimeFamily.PYTHON); + if (pythonRuntimes.length === 0) { return undefined; } let latestRuntime = pythonRuntimes[0]; for (let idx = 1; idx < pythonRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.comparePythonRuntimes(latestRuntime, pythonRuntimes[idx]); + latestRuntime = RuntimeDeterminer.latestRuntime(latestRuntime, pythonRuntimes[idx], RuntimeFamily.PYTHON); } return latestRuntime; } - private static compareNodeJsRuntimes(runtime1: Runtime, runtime2: Runtime) { - return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.NODEJS); - } - - private static comparePythonRuntimes(runtime1: Runtime, runtime2: Runtime) { - return RuntimeDeterminer.compareRuntimes(runtime1, runtime2, RuntimeFamily.PYTHON); - } - - private static compareRuntimes(runtime1: Runtime, runtime2: Runtime, family: RuntimeFamily) { + private static latestRuntime(runtime1: Runtime, runtime2: Runtime, family: RuntimeFamily) { let sliceStart: number; switch (family) { case RuntimeFamily.NODEJS: { @@ -92,5 +86,13 @@ export class RuntimeDeterminer { return runtime1; } + private static validateRuntimes(runtimes: Runtime[], family: RuntimeFamily) { + for (let runtime of runtimes) { + if (runtime.family !== family) { + throw new Error(`All runtime familys must be the same when determining latest runtime. Found runtime family ${runtime.family}, expected ${family}`); + } + } + } + private constructor() {} } \ No newline at end of file diff --git a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts index 0ca5cfe4bc5c3..88dcac9b8cbc3 100644 --- a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts @@ -7,7 +7,7 @@ describe('nodejs runtimes', () => { const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.PYTHON_3_11]; // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); // THEN expect(latestRuntime?.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME)).toEqual(true); @@ -18,32 +18,31 @@ describe('nodejs runtimes', () => { const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X, Runtime.NODEJS_20_X, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12]; // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); // THEN expect(latestRuntime?.runtimeEquals(Runtime.NODEJS_20_X)).toEqual(true); }); - test('returns undefined if no nodejs runtimes specified', () => { + test('returns undefined if no runtimes are specified', () => { // GIVEN - const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12]; + const runtimes = []; // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); // THEN expect(latestRuntime).toBeUndefined; }); - test('returns undefined if no runtimes are specified', () => { + test('throws if not all runtimes are nodejs', () => { // GIVEN - const runtimes = []; + const runtimes = [Runtime.NODEJS_16_X, Runtime.PYTHON_3_11, Runtime.NODEJS_18_X]; - // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestNodeJsRuntime(runtimes); - - // THEN - expect(latestRuntime).toBeUndefined; + // WHEN / THEN + expect(() => { + RuntimeDeterminer.latestNodeJsRuntime(runtimes); + }).toThrow('All runtime familys must be the same when determining latest runtime. Found runtime family python, expected nodejs'); }); }); @@ -53,31 +52,30 @@ describe('python runtimes', () => { const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_7]; // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.latestPythonRuntime(runtimes); // THEN expect(latestRuntime?.runtimeEquals(Runtime.PYTHON_3_11)).toEqual(true); }); - test('returns undefined if no python runtimes specified', () => { + test('returns undefined if no runtimes are specified', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.NODEJS_20_X]; + const runtimes = []; // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.latestPythonRuntime(runtimes); // THEN expect(latestRuntime).toBeUndefined; }); - test('returns undefined if no runtimes are specified', () => { + test('throws if not all runtimes are python', () => { // GIVEN - const runtimes = []; + const runtimes = [Runtime.PYTHON_3_11, Runtime.NODEJS_18_X, Runtime.PYTHON_3_12]; - // WHEN - const latestRuntime = RuntimeDeterminer.determineLatestPythonRuntime(runtimes); - - // THEN - expect(latestRuntime).toBeUndefined; + // WHEN / THEN + expect(() => { + RuntimeDeterminer.latestPythonRuntime(runtimes); + }).toThrow('All runtime familys must be the same when determining latest runtime. Found runtime family nodejs, expected python'); }); }); From 8c6c0ac35d4cfb728cfaa9d6afa9012894feb957 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 05:30:47 -0800 Subject: [PATCH 39/74] refactored runtime determiner and moved handler framework into its own module Signed-off-by: Francis --- .../aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts | 4 ++-- packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts | 4 ++-- packages/aws-cdk-lib/handler-framework/README.md | 0 .../lib}/cdk-function.ts | 4 ++-- .../lib}/cdk-handler.ts | 2 +- .../lib}/cdk-singleton-function.ts | 4 ++-- .../lib/utils}/runtime-determiner.ts | 0 .../test}/cdk-function.test.ts | 10 +++++----- .../test}/cdk-handler.test.ts | 4 ++-- .../test}/cdk-singleton-function.test.ts | 10 +++++----- .../test}/test-handler/index.ts | 0 .../test/utils}/runtime-determiner.test.ts | 6 +++--- 12 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 packages/aws-cdk-lib/handler-framework/README.md rename packages/aws-cdk-lib/{custom-resources/lib/handler-framework => handler-framework/lib}/cdk-function.ts (94%) rename packages/aws-cdk-lib/{custom-resources/lib/handler-framework => handler-framework/lib}/cdk-handler.ts (95%) rename packages/aws-cdk-lib/{custom-resources/lib/handler-framework => handler-framework/lib}/cdk-singleton-function.ts (95%) rename packages/aws-cdk-lib/{custom-resources/lib/helpers-internal => handler-framework/lib/utils}/runtime-determiner.ts (100%) rename packages/aws-cdk-lib/{custom-resources/test/handler-framework => handler-framework/test}/cdk-function.test.ts (89%) rename packages/aws-cdk-lib/{custom-resources/test/handler-framework => handler-framework/test}/cdk-handler.test.ts (87%) rename packages/aws-cdk-lib/{custom-resources/test/handler-framework => handler-framework/test}/cdk-singleton-function.test.ts (90%) rename packages/aws-cdk-lib/{custom-resources/test/handler-framework => handler-framework/test}/test-handler/index.ts (100%) rename packages/aws-cdk-lib/{custom-resources/test/helpers-internal => handler-framework/test/utils}/runtime-determiner.test.ts (90%) diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 045f9b9e894db..3d2e017f9edc1 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -4,8 +4,8 @@ import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, Duration, NestedStack, Stack } from '../../core'; import * as cr from '../../custom-resources'; -import { CdkFunction } from '../../custom-resources/lib/handler-framework/cdk-function'; -import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; +import { CdkFunction } from '../../handler-framework/lib/cdk-function'; +import { CdkHandler } from '../../handler-framework/lib/cdk-handler'; /** * Properties for a ReplicaProvider diff --git a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts index ffc4bbf6fe2d3..6a62f95eab615 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts @@ -6,8 +6,8 @@ import { CfnReceiptRule } from './ses.generated'; import * as iam from '../../aws-iam'; import * as lambda from '../../aws-lambda'; import { Aws, IResource, Lazy, Resource } from '../../core'; -import { CdkHandler } from '../../custom-resources/lib/handler-framework/cdk-handler'; -import { CdkSingletonFunction } from '../../custom-resources/lib/handler-framework/cdk-singleton-function'; +import { CdkHandler } from '../../handler-framework/lib/cdk-handler'; +import { CdkSingletonFunction } from '../../handler-framework/lib/cdk-singleton-function'; /** * A receipt rule. diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts similarity index 94% rename from packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts rename to packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index 5c44e6c2bf727..5f1180b99d18d 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../../aws-lambda'; -import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; +import { RuntimeDeterminer } from './utils/runtime-determiner'; +import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../aws-lambda'; /** * Properties used to define a Lambda function used as a custom resource provider. diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts similarity index 95% rename from packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts rename to packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts index de5917fd4eb08..17b2f531230c9 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-handler.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts @@ -1,4 +1,4 @@ -import { Code, Runtime } from '../../../aws-lambda'; +import { Code, Runtime } from '../../aws-lambda'; /** * Properties used to define source code executed within a Lambda function acting as a diff --git a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts similarity index 95% rename from packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts rename to packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index 964685c306e54..3d6f26ea746db 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/handler-framework/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { FunctionOptions, Runtime, RuntimeFamily, SingletonFunction } from '../../../aws-lambda'; -import { RuntimeDeterminer } from '../helpers-internal/runtime-determiner'; +import { RuntimeDeterminer } from './utils/runtime-determiner'; +import { FunctionOptions, Runtime, RuntimeFamily, SingletonFunction } from '../../aws-lambda'; /** * Properties used to define a singleton Lambda function to be used as a custom resource diff --git a/packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts similarity index 100% rename from packages/aws-cdk-lib/custom-resources/lib/helpers-internal/runtime-determiner.ts rename to packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts similarity index 89% rename from packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts rename to packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts index 4352a114f89f0..785d6a4ef85eb 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts @@ -1,9 +1,9 @@ import * as path from 'path'; -import { Template } from '../../../assertions'; -import { Runtime } from '../../../aws-lambda'; -import { Stack } from '../../../core'; -import { CdkFunction } from '../../lib/handler-framework/cdk-function'; -import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; +import { Template } from '../../assertions'; +import { Runtime } from '../../aws-lambda'; +import { Stack } from '../../core'; +import { CdkFunction } from '../lib/cdk-function'; +import { CdkHandler } from '../lib/cdk-handler'; describe('cdk function', () => { test('stack contains expected lambda function', () => { diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts similarity index 87% rename from packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts rename to packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts index ab74c50e54484..f167f5335fc05 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-handler.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; -import { Runtime } from '../../../aws-lambda'; -import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; +import { Runtime } from '../../aws-lambda'; +import { CdkHandler } from '../lib/cdk-handler'; describe('code from asset', () => { test('correctly sets compatibleRuntimes property', () => { diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts similarity index 90% rename from packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts rename to packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts index 181ea4e5f3a85..bb6d44e7f24a9 100644 --- a/packages/aws-cdk-lib/custom-resources/test/handler-framework/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts @@ -1,9 +1,9 @@ import * as path from 'path'; -import { Template } from '../../../assertions'; -import { Runtime } from '../../../aws-lambda'; -import { Stack } from '../../../core'; -import { CdkHandler } from '../../lib/handler-framework/cdk-handler'; -import { CdkSingletonFunction } from '../../lib/handler-framework/cdk-singleton-function'; +import { Template } from '../../assertions'; +import { Runtime } from '../../aws-lambda'; +import { Stack } from '../../core'; +import { CdkHandler } from '../lib/cdk-handler'; +import { CdkSingletonFunction } from '../lib/cdk-singleton-function'; describe('cdk singleton function', () => { test('stack contains expected lambda function', () => { diff --git a/packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts b/packages/aws-cdk-lib/handler-framework/test/test-handler/index.ts similarity index 100% rename from packages/aws-cdk-lib/custom-resources/test/handler-framework/test-handler/index.ts rename to packages/aws-cdk-lib/handler-framework/test/test-handler/index.ts diff --git a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts b/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts similarity index 90% rename from packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts rename to packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts index 88dcac9b8cbc3..231a00edbf742 100644 --- a/packages/aws-cdk-lib/custom-resources/test/helpers-internal/runtime-determiner.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts @@ -1,10 +1,10 @@ import { Runtime } from '../../../aws-lambda'; -import { RuntimeDeterminer } from '../../lib/helpers-internal/runtime-determiner'; +import { RuntimeDeterminer } from '../../lib/utils/runtime-determiner'; describe('nodejs runtimes', () => { test('selects default runtime', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X, Runtime.PYTHON_3_11]; + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; // WHEN const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); @@ -15,7 +15,7 @@ describe('nodejs runtimes', () => { test('selects latest nodejs runtime', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X, Runtime.NODEJS_20_X, Runtime.PYTHON_3_11, Runtime.PYTHON_3_12]; + const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X, Runtime.NODEJS_20_X]; // WHEN const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); From 8febdf1d47471aa8cbf3e26bb45f88fb58052539 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 06:10:40 -0800 Subject: [PATCH 40/74] renamed handler property to entrypoint Signed-off-by: Francis --- .../aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts | 4 ++-- packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts | 2 +- packages/aws-cdk-lib/handler-framework/README.md | 11 +++++++++++ .../aws-cdk-lib/handler-framework/lib/cdk-function.ts | 2 +- .../aws-cdk-lib/handler-framework/lib/cdk-handler.ts | 6 +++--- .../handler-framework/lib/cdk-singleton-function.ts | 2 +- .../handler-framework/test/cdk-function.test.ts | 8 ++++---- .../handler-framework/test/cdk-handler.test.ts | 8 ++++---- .../test/cdk-singleton-function.test.ts | 8 ++++---- 9 files changed, 31 insertions(+), 20 deletions(-) diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 3d2e017f9edc1..a9334b1fe95fe 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -58,12 +58,12 @@ export class ReplicaProvider extends NestedStack { super(scope, id); const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { - handler: 'index.onEventHandler', + entrypoint: 'index.onEventHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); const onCompleteHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { - handler: 'index.isCompleteHandler', + entrypoint: 'index.isCompleteHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts index 6a62f95eab615..8e80c447d5552 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts @@ -174,7 +174,7 @@ export class DropSpamReceiptRule extends Construct { super(scope, id); const handler = CdkHandler.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md index e69de29bb2d1d..a20412abb90db 100644 --- a/packages/aws-cdk-lib/handler-framework/README.md +++ b/packages/aws-cdk-lib/handler-framework/README.md @@ -0,0 +1,11 @@ +# AWS CDK Vended Handler Framework + +This module is an internal framework used to establish best practices for vending Lambda handlers that are deployed to user accounts. Primarily, this framework includes a centralized definition of the default runtime version which is the latest version of NodeJs available across all AWS Regions. + +In addition to including a default runtime version, this framework forces the user to specify compatible runtimes for each Lambda handler being used. The framework first checks for the default runtime in the list of compatible runtimes. If found, the default runtime is used. If not found, the framework will look for the latest defined runtime in the list of compatible runtimes. If the latest runtime found is marked as deprecated, then the framework will force the build to fail. To continue, the user must specify a non-deprecated runtime version that the handler code is compatible with. + +## CDK Handler + +## CDK Function + +## CDK Singleton Function diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index 5f1180b99d18d..3ccfbe3a27da8 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -43,7 +43,7 @@ export class CdkFunction extends Function { super(scope, id, { ...props, code: props.handler.code, - handler: props.handler.handler, + handler: props.handler.entrypoint, runtime: CdkFunction.determineRuntime(props.handler.compatibleRuntimes), }); } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts index 17b2f531230c9..9e6afc0eb9a0e 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts @@ -8,7 +8,7 @@ export interface CdkHandlerProps { /** * The name of the method within your code that Lambda calls to execute your function. */ - readonly handler: string; + readonly entrypoint: string; /** * Runtimes that are compatible with the source code. @@ -36,7 +36,7 @@ export class CdkHandler { /** * The name of the method within your code that Lambda calls to execute your function. */ - public readonly handler: string; + public readonly entrypoint: string; /** * Runtimes that are compatible with the source code. @@ -45,7 +45,7 @@ export class CdkHandler { private constructor(path: string, props: CdkHandlerProps) { this.code = Code.fromAsset(path); - this.handler = props.handler; + this.entrypoint = props.entrypoint; this.compatibleRuntimes = props.compatibleRuntimes; } } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index 3d6f26ea746db..329cbb83f28da 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -63,7 +63,7 @@ export class CdkSingletonFunction extends SingletonFunction { super(scope, id, { ...props, code: props.handler.code, - handler: props.handler.handler, + handler: props.handler.entrypoint, runtime: CdkSingletonFunction.determineRuntime(props.handler.compatibleRuntimes), }); } diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts index 785d6a4ef85eb..81bc421c1c91c 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts @@ -10,7 +10,7 @@ describe('cdk function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); @@ -40,7 +40,7 @@ describe('cdk function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); @@ -54,7 +54,7 @@ describe('cdk function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], }); @@ -68,7 +68,7 @@ describe('cdk function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], }); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts index f167f5335fc05..eb29fdca27b8d 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts @@ -9,7 +9,7 @@ describe('code from asset', () => { // WHEN const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes, }); @@ -17,17 +17,17 @@ describe('code from asset', () => { expect(handler.compatibleRuntimes).toEqual(compatibleRuntimes); }); - test('correctly sets handler property', () => { + test('correctly sets entrypoint property', () => { // GIVEN const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; // WHEN const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes, }); // THEN - expect(handler.handler).toEqual('index.handler'); + expect(handler.entrypoint).toEqual('index.handler'); }); }); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts index bb6d44e7f24a9..9b600542f8c92 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts @@ -10,7 +10,7 @@ describe('cdk singleton function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); @@ -43,7 +43,7 @@ describe('cdk singleton function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], }); @@ -60,7 +60,7 @@ describe('cdk singleton function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], }); @@ -77,7 +77,7 @@ describe('cdk singleton function', () => { // GIVEN const stack = new Stack(); const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - handler: 'index.handler', + entrypoint: 'index.handler', compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], }); From 32439cffc0696218dc7b5e3ee48789f7acdb5984 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 07:37:19 -0800 Subject: [PATCH 41/74] refactored runtime determiner and added content to readme Signed-off-by: Francis --- .../aws-cdk-lib/handler-framework/README.md | 48 +++++++++++++- .../handler-framework/lib/cdk-function.ts | 26 +------- .../lib/cdk-singleton-function.ts | 26 +------- .../lib/utils/runtime-determiner.ts | 56 ++++++++++------- .../test/cdk-function.test.ts | 44 +------------ .../test/cdk-singleton-function.test.ts | 55 +--------------- .../test/utils/runtime-determiner.test.ts | 62 +++++++++---------- 7 files changed, 117 insertions(+), 200 deletions(-) diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md index a20412abb90db..7daacbb5e1cad 100644 --- a/packages/aws-cdk-lib/handler-framework/README.md +++ b/packages/aws-cdk-lib/handler-framework/README.md @@ -2,10 +2,56 @@ This module is an internal framework used to establish best practices for vending Lambda handlers that are deployed to user accounts. Primarily, this framework includes a centralized definition of the default runtime version which is the latest version of NodeJs available across all AWS Regions. -In addition to including a default runtime version, this framework forces the user to specify compatible runtimes for each Lambda handler being used. The framework first checks for the default runtime in the list of compatible runtimes. If found, the default runtime is used. If not found, the framework will look for the latest defined runtime in the list of compatible runtimes. If the latest runtime found is marked as deprecated, then the framework will force the build to fail. To continue, the user must specify a non-deprecated runtime version that the handler code is compatible with. +In addition to including a default runtime version, this framework forces the user to specify `compatibleRuntimes` for each Lambda handler being used. The framework first checks for the default runtime in the list of `compatibleRuntimes`. If found, the default runtime is used. If not found, the framework will look for the latest defined runtime in the list of `compatibleRuntimes`. If the latest runtime found is marked as deprecated, then the framework will force the build to fail. To continue, the user must specify a non-deprecated runtime version that the handler code is compatible with. ## CDK Handler +`CdkHandler` is a class that represents the source code that will be executed within a Lambda `Function` acting as a custom resource provider. Once constructed, this class contains three attributes: +1. `code` - the source code that is loaded from a local disk path +2. `entrypoint` - the name of the method within your `code` that Lambda calls to execute your `Function` +3. `compatibleRuntimes` - the runtimes that your `code` is compatible with + +Note that `compatibleRuntimes` can be any python or nodejs runtimes, but the nodejs runtime family are preferred. Python runtimes are supported to provide support for legacy handler code that was written using python. + +The following is an example of how to use `CdkHandler`: + +```ts +const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { + entrypoint: 'index.handler', + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], +}); +``` + ## CDK Function +The `CdkFunction` construct represents a Lambda `Function` that will act as a custom resource provider. The key difference between `CdkFunction` and Lambda `Function` is that `runtime`, `handler`, and `code` are all determined for `CdkFunction` via `CdkHandler` which is a required property. Notably, the `runtime` is determined via the `compatibleRuntimes` property of `CdkHandler`. + +Note that the build will fail if the latest `runtime` found is marked as deprecated. If this happens you must specify a latest `code` compatible `runtime` that is not deprecated. Additionally, the build will fail if none of the `compatibleRuntimes` are in the python or nodejs family. + +The following is an example of how to use `CdkFunction`: + +```ts +const stack = new Stack(); + +const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { + entrypoint: 'index.handler', + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], +}); + +const fn = new CdkFunction(stack, 'CdkFunction', { handler }); +``` + ## CDK Singleton Function + +The following is an example of how to use `CdkSingletonFunction`: + +```ts +const stack = new Stack(); + +const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { + entrypoint: 'index.handler', + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], +}); + +const fn = new CdkSingletonFunction(stack, 'CdkSingletonFunction', { handler }); +``` diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index 3ccfbe3a27da8..3dd5cf83276af 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; import { RuntimeDeterminer } from './utils/runtime-determiner'; -import { Function, FunctionOptions, Runtime, RuntimeFamily } from '../../aws-lambda'; +import { Function, FunctionOptions } from '../../aws-lambda'; /** * Properties used to define a Lambda function used as a custom resource provider. @@ -17,34 +17,12 @@ export interface CdkFunctionProps extends FunctionOptions { * Represents a Lambda function used as a custom resource provider. */ export class CdkFunction extends Function { - private static determineRuntime(compatibleRuntimes: Runtime[]) { - const nodeJsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); - if (latestNodeJsRuntime !== undefined) { - if (latestNodeJsRuntime.isDeprecated) { - throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); - } - return latestNodeJsRuntime; - } - - const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); - if (latestPythonRuntime !== undefined) { - if (latestPythonRuntime.isDeprecated) { - throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); - } - return latestPythonRuntime; - } - - throw new Error('Compatible runtimes must contain either nodejs or python runtimes'); - } - public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { ...props, code: props.handler.code, handler: props.handler.entrypoint, - runtime: CdkFunction.determineRuntime(props.handler.compatibleRuntimes), + runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index 329cbb83f28da..5e39225e133ce 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -1,7 +1,7 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; import { RuntimeDeterminer } from './utils/runtime-determiner'; -import { FunctionOptions, Runtime, RuntimeFamily, SingletonFunction } from '../../aws-lambda'; +import { FunctionOptions, SingletonFunction } from '../../aws-lambda'; /** * Properties used to define a singleton Lambda function to be used as a custom resource @@ -37,34 +37,12 @@ export interface CdkSingletonFunctionProps extends FunctionOptions { * Represents a singleton Lambda function to be used as a custom resource provider. */ export class CdkSingletonFunction extends SingletonFunction { - private static determineRuntime(compatibleRuntimes: Runtime[]) { - const nodeJsRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); - if (latestNodeJsRuntime !== undefined) { - if (latestNodeJsRuntime.isDeprecated) { - throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated`); - } - return latestNodeJsRuntime; - } - - const pythonRuntimes = compatibleRuntimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); - if (latestPythonRuntime !== undefined) { - if (latestPythonRuntime.isDeprecated) { - throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated`); - } - return latestPythonRuntime; - } - - throw new Error('Compatible runtimes must contain either nodejs or python runtimes'); - } - public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { super(scope, id, { ...props, code: props.handler.code, handler: props.handler.entrypoint, - runtime: CdkSingletonFunction.determineRuntime(props.handler.compatibleRuntimes), + runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes), }); } } diff --git a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts index e310383aee8bd..0c32f011456d2 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts @@ -7,14 +7,42 @@ export class RuntimeDeterminer { public static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; /** - * Determines the latest nodejs runtime from a list of nodejs runtimes + * Determines the latest runtime from a list of runtimes. * - * @param nodeJsRuntimes the list of nodejs runtimes to search in - * @returns the latest nodejs runtime or undefined if no nodejs runtimes are provided + * Note: runtimes must only be nodejs or python. Nodejs runtimes will be given preference over + * python runtimes. + * + * @param runtimes the list of runtimes to search in + * @returns the latest nodejs or python runtime found, otherwise undefined if no nodejs or python + * runtimes are specified */ - public static latestNodeJsRuntime(nodeJsRuntimes: Runtime[]) { - RuntimeDeterminer.validateRuntimes(nodeJsRuntimes, RuntimeFamily.NODEJS); + public static determineLatestRuntime(runtimes: Runtime[]) { + if (runtimes.length === 0) { + throw new Error('You must specify at least one compatible runtime'); + } + + const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); + const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); + if (latestNodeJsRuntime !== undefined) { + if (latestNodeJsRuntime.isDeprecated) { + throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated. You must upgrade to the latest code compatible nodejs runtime`); + } + return latestNodeJsRuntime; + } + + const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); + const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); + if (latestPythonRuntime !== undefined) { + if (latestPythonRuntime.isDeprecated) { + throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated. You must upgrade to the latest code compatible python runtime`); + } + return latestPythonRuntime; + } + + throw new Error('Compatible runtimes must contain only nodejs or python runtimes'); + } + private static latestNodeJsRuntime(nodeJsRuntimes: Runtime[]) { if (nodeJsRuntimes.length === 0) { return undefined; } @@ -31,15 +59,7 @@ export class RuntimeDeterminer { return latestRuntime; } - /** - * Determines the latest python runtime from a list of python runtimes - * - * @param pythonRuntimes the list of python runtimes to search in - * @returns the latest python runtime or undefined if no python runtimes are provided - */ - public static latestPythonRuntime(pythonRuntimes: Runtime[]) { - RuntimeDeterminer.validateRuntimes(pythonRuntimes, RuntimeFamily.PYTHON); - + private static latestPythonRuntime(pythonRuntimes: Runtime[]) { if (pythonRuntimes.length === 0) { return undefined; } @@ -86,13 +106,5 @@ export class RuntimeDeterminer { return runtime1; } - private static validateRuntimes(runtimes: Runtime[], family: RuntimeFamily) { - for (let runtime of runtimes) { - if (runtime.family !== family) { - throw new Error(`All runtime familys must be the same when determining latest runtime. Found runtime family ${runtime.family}, expected ${family}`); - } - } - } - private constructor() {} } \ No newline at end of file diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts index 81bc421c1c91c..fac8e4aaac4b9 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts @@ -23,7 +23,7 @@ describe('cdk function', () => { S3Bucket: { 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', }, - S3Key: '02227527d0e41dc9ca1090db083832a1fd9a8ec58cc140edb308086dc100a25b.zip', + S3Key: '4d4b98cd9c36b776ced5c91f31e9aa292cb824a13cb0d1a4d4d91e128b8e4fb6.zip', }, Handler: 'index.handler', Role: { @@ -35,46 +35,4 @@ describe('cdk function', () => { Runtime: 'nodejs18.x', }); }); - - test('throws if no nodejs or python runtimes are specified in cdk code', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], - }); - - // WHEN / THEN - expect(() => { - new CdkFunction(stack, 'Function', { handler }); - }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); - }); - - test('throws if latest nodejs runtime is deprecated', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], - }); - - // WHEN / THEN - expect(() => { - new CdkFunction(stack, 'Function', { handler }); - }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); - }); - - test('throws if latest python runtime is deprecated', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], - }); - - // WHEN / THEN - expect(() => { - new CdkFunction(stack, 'Function', { handler }); - }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); - }); }); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts index 9b600542f8c92..6405d8f27e290 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts @@ -26,7 +26,7 @@ describe('cdk singleton function', () => { S3Bucket: { 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', }, - S3Key: '02227527d0e41dc9ca1090db083832a1fd9a8ec58cc140edb308086dc100a25b.zip', + S3Key: '4d4b98cd9c36b776ced5c91f31e9aa292cb824a13cb0d1a4d4d91e128b8e4fb6.zip', }, Handler: 'index.handler', Role: { @@ -38,55 +38,4 @@ describe('cdk singleton function', () => { Runtime: 'nodejs18.x', }); }); - - test('throws if no nodejs or python runtimes are specified in cdk code', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.JAVA_11, Runtime.RUBY_3_2], - }); - - // WHEN / THEN - expect(() => { - new CdkSingletonFunction(stack, 'Function', { - handler, - uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', - }); - }).toThrow('Compatible runtimes must contain either nodejs or python runtimes'); - }); - - test('throws if latest nodejs runtime is deprecated', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X], - }); - - // WHEN / THEN - expect(() => { - new CdkSingletonFunction(stack, 'Function', { - handler, - uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', - }); - }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated`); - }); - - test('throws if latest python runtime is deprecated', () => { - // GIVEN - const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes: [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6], - }); - - // WHEN / THEN - expect(() => { - new CdkSingletonFunction(stack, 'Function', { - handler, - uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', - }); - }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated`); - }); -}); \ No newline at end of file +}); diff --git a/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts b/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts index 231a00edbf742..a5923e3fe55ba 100644 --- a/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/utils/runtime-determiner.test.ts @@ -1,13 +1,13 @@ import { Runtime } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../../lib/utils/runtime-determiner'; -describe('nodejs runtimes', () => { +describe('latest runtime', () => { test('selects default runtime', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; + const runtimes = [Runtime.NODEJS_16_X, Runtime.PYTHON_3_12, Runtime.NODEJS_18_X]; // WHEN - const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.determineLatestRuntime(runtimes); // THEN expect(latestRuntime?.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME)).toEqual(true); @@ -15,67 +15,63 @@ describe('nodejs runtimes', () => { test('selects latest nodejs runtime', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_14_X, Runtime.NODEJS_20_X]; + const runtimes = [Runtime.NODEJS_16_X, Runtime.PYTHON_3_12, Runtime.NODEJS_14_X, Runtime.PYTHON_3_11, Runtime.NODEJS_20_X]; // WHEN - const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.determineLatestRuntime(runtimes); // THEN expect(latestRuntime?.runtimeEquals(Runtime.NODEJS_20_X)).toEqual(true); }); - test('returns undefined if no runtimes are specified', () => { + test('selects latest python runtime', () => { // GIVEN - const runtimes = []; + const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_7]; // WHEN - const latestRuntime = RuntimeDeterminer.latestNodeJsRuntime(runtimes); + const latestRuntime = RuntimeDeterminer.determineLatestRuntime(runtimes); // THEN - expect(latestRuntime).toBeUndefined; + expect(latestRuntime?.runtimeEquals(Runtime.PYTHON_3_11)).toEqual(true); }); - test('throws if not all runtimes are nodejs', () => { + test('throws if no runtimes are specified', () => { // GIVEN - const runtimes = [Runtime.NODEJS_16_X, Runtime.PYTHON_3_11, Runtime.NODEJS_18_X]; + const runtimes = []; // WHEN / THEN expect(() => { - RuntimeDeterminer.latestNodeJsRuntime(runtimes); - }).toThrow('All runtime familys must be the same when determining latest runtime. Found runtime family python, expected nodejs'); + RuntimeDeterminer.determineLatestRuntime(runtimes); + }).toThrow('You must specify at least one compatible runtime'); }); -}); -describe('python runtimes', () => { - test('selects latest python runtime', () => { + test('throws if latest nodejs runtime is deprecated', () => { // GIVEN - const runtimes = [Runtime.PYTHON_3_10, Runtime.PYTHON_3_11, Runtime.PYTHON_3_7]; - - // WHEN - const latestRuntime = RuntimeDeterminer.latestPythonRuntime(runtimes); + const runtimes = [Runtime.NODEJS_12_X, Runtime.NODEJS_14_X]; - // THEN - expect(latestRuntime?.runtimeEquals(Runtime.PYTHON_3_11)).toEqual(true); + // WHEN / THEN + expect(() => { + RuntimeDeterminer.determineLatestRuntime(runtimes); + }).toThrow(`Latest nodejs runtime ${Runtime.NODEJS_14_X} is deprecated. You must upgrade to the latest code compatible nodejs runtime`); }); - test('returns undefined if no runtimes are specified', () => { + test('throws if latest python runtime is deprecated', () => { // GIVEN - const runtimes = []; + const runtimes = [Runtime.PYTHON_2_7, Runtime.PYTHON_3_6]; - // WHEN - const latestRuntime = RuntimeDeterminer.latestPythonRuntime(runtimes); - - // THEN - expect(latestRuntime).toBeUndefined; + // WHEN / THEN + expect(() => { + RuntimeDeterminer.determineLatestRuntime(runtimes); + }).toThrow(`Latest python runtime ${Runtime.PYTHON_3_6} is deprecated. You must upgrade to the latest code compatible python runtime`); }); - test('throws if not all runtimes are python', () => { + test('throws if runtimes are neither nodejs nor python', () => { // GIVEN - const runtimes = [Runtime.PYTHON_3_11, Runtime.NODEJS_18_X, Runtime.PYTHON_3_12]; + const runtimes = [Runtime.JAVA_17, Runtime.RUBY_3_2]; // WHEN / THEN expect(() => { - RuntimeDeterminer.latestPythonRuntime(runtimes); - }).toThrow('All runtime familys must be the same when determining latest runtime. Found runtime family nodejs, expected python'); + RuntimeDeterminer.determineLatestRuntime(runtimes); + }).toThrow('Compatible runtimes must contain only nodejs or python runtimes'); }); }); From 31e43abb27bafdbd47476e6b4023bc6a1b7de068 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 07:49:09 -0800 Subject: [PATCH 42/74] readme Signed-off-by: Francis --- packages/aws-cdk-lib/handler-framework/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md index 7daacbb5e1cad..4e6dddb19c586 100644 --- a/packages/aws-cdk-lib/handler-framework/README.md +++ b/packages/aws-cdk-lib/handler-framework/README.md @@ -43,6 +43,10 @@ const fn = new CdkFunction(stack, 'CdkFunction', { handler }); ## CDK Singleton Function +The `CdkSingletonFunction` construct represents a Lambda `SingletonFunction` that will act as a custom resource provider. The key difference between `CdkSingletonFunction` and Lambda `SingletonFunction` is that `runtime`, `handler`, and `code` are all determined for `CdkSingletonFunction` via `CdkHandler` which is a required property. + +Note that the build will fail if the latest `runtime` found is marked as deprecated. If this happens you must specify a latest `code` compatible `runtime` that is not deprecated. Additionally, the build will fail if none of the `compatibleRuntimes` are in the python or nodejs family. + The following is an example of how to use `CdkSingletonFunction`: ```ts From bd62d07f4471e126165c3013796d3a36574a6b0a Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Nov 2023 08:16:53 -0800 Subject: [PATCH 43/74] default runtime docstring Signed-off-by: Francis --- .../handler-framework/lib/utils/runtime-determiner.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts index 0c32f011456d2..a267e9526a1ae 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts @@ -4,6 +4,9 @@ import { Runtime, RuntimeFamily } from '../../../aws-lambda'; * A utility class used to determine the latest runtime for a specific runtime family */ export class RuntimeDeterminer { + /** + * The latest nodejs runtime version available across all AWS regions + */ public static readonly DEFAULT_RUNTIME = Runtime.NODEJS_LATEST; /** From b1ec4d3da47eed8bf04ad9eaf60a4f3124697cfd Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Nov 2023 09:14:13 -0800 Subject: [PATCH 44/74] added initial code for CdkCustomResourceProvider Signed-off-by: Francis --- .../lib/cdk-custom-resource-provider.ts | 74 +++++++++++++++++++ .../lib/utils/runtime-determiner.ts | 12 +-- 2 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts new file mode 100644 index 0000000000000..1370030ca2ffd --- /dev/null +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts @@ -0,0 +1,74 @@ +import { Construct } from 'constructs'; +import { CdkFunction } from './cdk-function'; +import { CdkHandler } from './cdk-handler'; +import { Duration, Size, Stack } from '../../core'; + +export interface CdkCustomResourceProviderProps { + /** + * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. + */ + readonly handler: CdkHandler; + + /** + * AWS Lambda timeout for the provider. + * + * @default Duration.minutes(15) + */ + readonly timeout?: Duration; + + /** + * The amount of memory that your function has access to. Increasing the function's memory also increases its CPU + * allocation. + * + * @default Size.mebibytes(128) + */ + readonly memorySize?: Size; + + /** + * Key-value pairs that are passed to Lambda as Environment + * + * @default - No environment variables. + */ + readonly environment?: { [key: string]: string }; + + /** + * A description of the function. + * + * @default - No description. + */ + readonly description?: string; +} + +export class CdkCustomResourceProvider extends Construct { + public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; + } + + public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + const id = `${uniqueid}CustomResourceProvider`; + const stack = Stack.of(scope); + const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider + ?? new CdkCustomResourceProvider(stack, id, props); + return provider; + } + + /** + * The ARN of the provider's AWS Lambda function which should be used as the `serviceToken` when defining a custom + * resource. + */ + public readonly serviceToken: string; + + protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { + super(scope, id); + + const fn = new CdkFunction(this, 'Handler', { + handler: props.handler, + timeout: props.timeout ?? Duration.minutes(15), + memorySize: props.memorySize?.toMebibytes(), + description: props.description, + environment: props.environment, + }); + + this.serviceToken = fn.functionArn; + } +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts index a267e9526a1ae..6f268038b6f78 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/utils/runtime-determiner.ts @@ -25,7 +25,7 @@ export class RuntimeDeterminer { } const nodeJsRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.NODEJS); - const latestNodeJsRuntime = RuntimeDeterminer.latestNodeJsRuntime(nodeJsRuntimes); + const latestNodeJsRuntime = this.latestNodeJsRuntime(nodeJsRuntimes); if (latestNodeJsRuntime !== undefined) { if (latestNodeJsRuntime.isDeprecated) { throw new Error(`Latest nodejs runtime ${latestNodeJsRuntime} is deprecated. You must upgrade to the latest code compatible nodejs runtime`); @@ -34,7 +34,7 @@ export class RuntimeDeterminer { } const pythonRuntimes = runtimes.filter(runtime => runtime.family === RuntimeFamily.PYTHON); - const latestPythonRuntime = RuntimeDeterminer.latestPythonRuntime(pythonRuntimes); + const latestPythonRuntime = this.latestPythonRuntime(pythonRuntimes); if (latestPythonRuntime !== undefined) { if (latestPythonRuntime.isDeprecated) { throw new Error(`Latest python runtime ${latestPythonRuntime} is deprecated. You must upgrade to the latest code compatible python runtime`); @@ -50,13 +50,13 @@ export class RuntimeDeterminer { return undefined; } - if (nodeJsRuntimes.some(runtime => runtime.runtimeEquals(RuntimeDeterminer.DEFAULT_RUNTIME))) { - return RuntimeDeterminer.DEFAULT_RUNTIME; + if (nodeJsRuntimes.some(runtime => runtime.runtimeEquals(this.DEFAULT_RUNTIME))) { + return this.DEFAULT_RUNTIME; } let latestRuntime = nodeJsRuntimes[0]; for (let idx = 1; idx < nodeJsRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.latestRuntime(latestRuntime, nodeJsRuntimes[idx], RuntimeFamily.NODEJS); + latestRuntime = this.latestRuntime(latestRuntime, nodeJsRuntimes[idx], RuntimeFamily.NODEJS); } return latestRuntime; @@ -69,7 +69,7 @@ export class RuntimeDeterminer { let latestRuntime = pythonRuntimes[0]; for (let idx = 1; idx < pythonRuntimes.length; idx++) { - latestRuntime = RuntimeDeterminer.latestRuntime(latestRuntime, pythonRuntimes[idx], RuntimeFamily.PYTHON); + latestRuntime = this.latestRuntime(latestRuntime, pythonRuntimes[idx], RuntimeFamily.PYTHON); } return latestRuntime; From abbf10a711e310f603874e54255335f16d0891e3 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Nov 2023 16:17:53 -0800 Subject: [PATCH 45/74] custom resource provider base class Signed-off-by: Francis --- .../custom-resource-provider-base.ts | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts new file mode 100644 index 0000000000000..8bef745c0e691 --- /dev/null +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -0,0 +1,134 @@ +import { Construct } from 'constructs'; +import { CfnResource } from '../cfn-resource'; +import { PolicySynthesizer, getPrecreatedRoleConfig } from '../helpers-internal'; +import { Lazy } from '../lazy'; +import { Stack } from '../stack'; +import { Token } from '../token'; + +export abstract class CustomResourceProviderBase extends Construct { + private policyStatements?: any[]; + protected _role?: CfnResource; + + /** + * The ARN of the provider's AWS Lambda function which should be used as the `serviceToken` when defining a custom + * resource. + */ + public abstract readonly serviceToken: string; + + /** + * The ARN of the provider's AWS Lambda function role. + */ + public abstract readonly roleArn: string; + + /** + * Add an IAM policy statement to the inline policy of the + * provider's lambda function's role. + * + * **Please note**: this is a direct IAM JSON policy blob, *not* a `iam.PolicyStatement` + * object like you will see in the rest of the CDK. + * + * + * @example + * declare const myProvider: CustomResourceProvider; + * + * myProvider.addToRolePolicy({ + * Effect: 'Allow', + * Action: 's3:GetObject', + * Resource: '*', + * }); + */ + public addToRolePolicy(statement: any): void { + if (!this.policyStatements) { + this.policyStatements = []; + } + this.policyStatements.push(statement); + } + + private renderPolicies() { + if (!this.policyStatements) { + return undefined; + } + + const policies = [{ + PolicyName: 'Inline', + PolicyDocument: { + Version: '2012-10-17', + Statement: this.policyStatements, + }, + }]; + + return policies; + } + + protected renderEnvironmentVariables(env?: { [key: string]: string }) { + if (!env || Object.keys(env).length === 0) { + return undefined; + } + + env = { ...env }; // Copy + + // Always use regional endpoints + env.AWS_STS_REGIONAL_ENDPOINTS = 'regional'; + + // Sort environment so the hash of the function used to create + // `currentVersion` is not affected by key order (this is how lambda does + // it) + const variables: { [key: string]: string } = {}; + const keys = Object.keys(env).sort(); + + for (const key of keys) { + variables[key] = env[key]; + } + + return { Variables: variables }; + } + + protected renderRoleArn(id: string) { + const config = getPrecreatedRoleConfig(this, `${this.node.path}/Role`); + const assumeRolePolicyDoc = [{ Action: 'sts:AssumeRole', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' } }]; + const managedPolicyArn = 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'; + + if (config.enabled) { + // gives policyStatements a chance to resolve + this.node.addValidation({ + validate: () => { + PolicySynthesizer.getOrCreate(this).addRole(`${this.node.path}/Role`, { + missing: !config.precreatedRoleName, + roleName: config.precreatedRoleName ?? id+'Role', + managedPolicies: [{ managedPolicyArn: managedPolicyArn }], + policyStatements: this.policyStatements ?? [], + assumeRolePolicy: assumeRolePolicyDoc as any, + }); + return []; + }, + }); + return Stack.of(this).formatArn({ + region: '', + service: 'iam', + resource: 'role', + resourceName: config.precreatedRoleName, + }); + } + + if (!config.preventSynthesis) { + this._role = new CfnResource(this, 'Role', { + type: 'AWS::IAM::Role', + properties: { + AssumeRolePolicyDocument: { + Version: '2012-10-17', + Statement: assumeRolePolicyDoc, + }, + ManagedPolicyArns: [ + { 'Fn::Sub': managedPolicyArn }, + ], + Policies: Lazy.any({ produce: () => this.renderPolicies() }), + }, + }); + return Token.asString(this._role.getAtt('Arn')); + } + + // used to satisfy all code paths returning a value, but there should never be an instance + // where config.enabled=true && config.preventSynthesis=true + return ''; + } +} From d45a76cbe7e431ba94d83796657c24da1f6de670 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Nov 2023 16:35:27 -0800 Subject: [PATCH 46/74] cdk custom resource provider Signed-off-by: Francis --- .../lib/experimental/edge-function.ts | 26 +++- .../cdk-custom-resource-provider.ts | 123 ++++++++++++++++++ .../lib/cdk-custom-resource-provider.ts | 74 ----------- 3 files changed, 143 insertions(+), 80 deletions(-) create mode 100644 packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts delete mode 100644 packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index 27ac19d11c25b..4ae6bfc7df4c7 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -8,14 +8,14 @@ import * as ssm from '../../../aws-ssm'; import { CfnResource, CustomResource, - CustomResourceProvider, - CustomResourceProviderRuntime, Lazy, Resource, Stack, Stage, Token, } from '../../../core'; +import { CdkCustomResourceProvider } from '../../../core/lib/custom-resource-provider/cdk-custom-resource-provider'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; /** * Properties for creating a Lambda@Edge function @@ -199,18 +199,32 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }); const resourceType = 'Custom::CrossRegionStringParameterReader'; - const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { - codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), - runtime: CustomResourceProviderRuntime.NODEJS_18_X, + const handler = CdkHandler.fromAsset(path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), { + entrypoint: '__entrypoint__.handler', + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); + const provider = CdkCustomResourceProvider.getOrCreateProvider(this, resourceType, { + handler, policyStatements: [{ Effect: 'Allow', Resource: parameterArnPrefix, Action: ['ssm:GetParameter'], }], }); + + // const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { + // codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), + // runtime: CustomResourceProviderRuntime.NODEJS_18_X, + // policyStatements: [{ + // Effect: 'Allow', + // Resource: parameterArnPrefix, + // Action: ['ssm:GetParameter'], + // }], + // }); + const resource = new CustomResource(this, 'ArnReader', { resourceType: resourceType, - serviceToken, + serviceToken: provider.serviceToken, properties: { Region: EdgeFunction.EDGE_REGION, ParameterName: parameterName, diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts new file mode 100644 index 0000000000000..a0363364952e2 --- /dev/null +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -0,0 +1,123 @@ +import { Construct } from 'constructs'; +import { CustomResourceProviderBase } from './custom-resource-provider-base'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; +import { RuntimeDeterminer } from '../../../handler-framework/lib/utils/runtime-determiner'; +import { CfnResource } from '../cfn-resource'; +import { Duration } from '../duration'; +import { Size } from '../size'; +import { Stack } from '../stack'; +import { Token } from '../token'; + +export interface CdkCustomResourceProviderProps { + /** + * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. + */ + readonly handler: CdkHandler; + + /** + * A set of IAM policy statements to include in the inline policy of the + * provider's lambda function. + * + * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` + * objects like you will see in the rest of the CDK. + * + * @default - no additional inline policy + * + * @example + * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { + * codeDirectory: `${__dirname}/my-handler`, + * runtime: CustomResourceProviderRuntime.NODEJS_18_X, + * policyStatements: [ + * { + * Effect: 'Allow', + * Action: 's3:PutObject*', + * Resource: '*', + * } + * ], + * }); + */ + readonly policyStatements?: any[]; + + /** + * AWS Lambda timeout for the provider. + * + * @default Duration.minutes(15) + */ + readonly timeout?: Duration; + + /** + * The amount of memory that your function has access to. Increasing the function's memory also increases its CPU + * allocation. + * + * @default Size.mebibytes(128) + */ + readonly memorySize?: Size; + + /** + * Key-value pairs that are passed to Lambda as Environment + * + * @default - No environment variables. + */ + readonly environment?: { [key: string]: string }; + + /** + * A description of the function. + * + * @default - No description. + */ + readonly description?: string; +} + +export class CdkCustomResourceProvider extends CustomResourceProviderBase { + public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; + } + + public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + const id = `${uniqueid}CustomResourceProvider`; + const stack = Stack.of(scope); + const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider + ?? new CdkCustomResourceProvider(stack, id, props); + return provider; + } + + public readonly serviceToken; + public readonly roleArn; + + protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { + super(scope, id); + + if (props.policyStatements) { + for (const statement of props.policyStatements) { + this.addToRolePolicy(statement); + } + } + + this.roleArn = this.renderRoleArn(id); + + const timeout = props.timeout ?? Duration.minutes(15); + const memory = props.memorySize ?? Size.mebibytes(128); + + const handler = new CfnResource(this, 'Handler', { + type: 'AWS::Lambda::Function', + properties: { + Code: props.handler.code.bind(Stack.of(this)), + Timeout: timeout.toSeconds(), + MemorySize: memory.toMebibytes(), + Handler: props.handler.entrypoint, + Role: this.roleArn, + Runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes).name, + Environment: this.renderEnvironmentVariables(props.environment), + Description: props.description ?? undefined, + }, + }); + + props.handler.code.bindToResource(handler); + + if (this._role) { + handler.addDependency(this._role); + } + + this.serviceToken = Token.asString(handler.getAtt('Arn')); + } +} \ No newline at end of file diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts deleted file mode 100644 index 1370030ca2ffd..0000000000000 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { Construct } from 'constructs'; -import { CdkFunction } from './cdk-function'; -import { CdkHandler } from './cdk-handler'; -import { Duration, Size, Stack } from '../../core'; - -export interface CdkCustomResourceProviderProps { - /** - * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. - */ - readonly handler: CdkHandler; - - /** - * AWS Lambda timeout for the provider. - * - * @default Duration.minutes(15) - */ - readonly timeout?: Duration; - - /** - * The amount of memory that your function has access to. Increasing the function's memory also increases its CPU - * allocation. - * - * @default Size.mebibytes(128) - */ - readonly memorySize?: Size; - - /** - * Key-value pairs that are passed to Lambda as Environment - * - * @default - No environment variables. - */ - readonly environment?: { [key: string]: string }; - - /** - * A description of the function. - * - * @default - No description. - */ - readonly description?: string; -} - -export class CdkCustomResourceProvider extends Construct { - public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { - return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; - } - - public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { - const id = `${uniqueid}CustomResourceProvider`; - const stack = Stack.of(scope); - const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider - ?? new CdkCustomResourceProvider(stack, id, props); - return provider; - } - - /** - * The ARN of the provider's AWS Lambda function which should be used as the `serviceToken` when defining a custom - * resource. - */ - public readonly serviceToken: string; - - protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { - super(scope, id); - - const fn = new CdkFunction(this, 'Handler', { - handler: props.handler, - timeout: props.timeout ?? Duration.minutes(15), - memorySize: props.memorySize?.toMebibytes(), - description: props.description, - environment: props.environment, - }); - - this.serviceToken = fn.functionArn; - } -} \ No newline at end of file From a5fd5b55ac51378f0076f7f52e5be1c605b41d45 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Nov 2023 17:15:22 -0800 Subject: [PATCH 47/74] options interface Signed-off-by: Francis --- .../cdk-custom-resource-provider.ts | 66 +++--------------- .../custom-resource-provider-base.ts | 67 +++++++++++++++++++ 2 files changed, 77 insertions(+), 56 deletions(-) diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts index a0363364952e2..eb034b8c8c223 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -1,5 +1,5 @@ import { Construct } from 'constructs'; -import { CustomResourceProviderBase } from './custom-resource-provider-base'; +import { CustomResourceProviderBase, CustomResourceProviderOptions } from './custom-resource-provider-base'; import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; import { RuntimeDeterminer } from '../../../handler-framework/lib/utils/runtime-determiner'; import { CfnResource } from '../cfn-resource'; @@ -8,64 +8,11 @@ import { Size } from '../size'; import { Stack } from '../stack'; import { Token } from '../token'; -export interface CdkCustomResourceProviderProps { +export interface CdkCustomResourceProviderProps extends CustomResourceProviderOptions { /** * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. */ readonly handler: CdkHandler; - - /** - * A set of IAM policy statements to include in the inline policy of the - * provider's lambda function. - * - * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` - * objects like you will see in the rest of the CDK. - * - * @default - no additional inline policy - * - * @example - * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { - * codeDirectory: `${__dirname}/my-handler`, - * runtime: CustomResourceProviderRuntime.NODEJS_18_X, - * policyStatements: [ - * { - * Effect: 'Allow', - * Action: 's3:PutObject*', - * Resource: '*', - * } - * ], - * }); - */ - readonly policyStatements?: any[]; - - /** - * AWS Lambda timeout for the provider. - * - * @default Duration.minutes(15) - */ - readonly timeout?: Duration; - - /** - * The amount of memory that your function has access to. Increasing the function's memory also increases its CPU - * allocation. - * - * @default Size.mebibytes(128) - */ - readonly memorySize?: Size; - - /** - * Key-value pairs that are passed to Lambda as Environment - * - * @default - No environment variables. - */ - readonly environment?: { [key: string]: string }; - - /** - * A description of the function. - * - * @default - No description. - */ - readonly description?: string; } export class CdkCustomResourceProvider extends CustomResourceProviderBase { @@ -95,13 +42,20 @@ export class CdkCustomResourceProvider extends CustomResourceProviderBase { this.roleArn = this.renderRoleArn(id); + const code = props.handler.code.bind(Stack.of(this)); + const timeout = props.timeout ?? Duration.minutes(15); const memory = props.memorySize ?? Size.mebibytes(128); const handler = new CfnResource(this, 'Handler', { type: 'AWS::Lambda::Function', properties: { - Code: props.handler.code.bind(Stack.of(this)), + Code: { + code: { + S3Bucket: code.s3Location?.bucketName, + S3Key: code.s3Location?.objectKey, + }, + }, Timeout: timeout.toSeconds(), MemorySize: memory.toMebibytes(), Handler: props.handler.entrypoint, diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts index 8bef745c0e691..301cf0248c29f 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -1,10 +1,77 @@ import { Construct } from 'constructs'; import { CfnResource } from '../cfn-resource'; +import { Duration } from '../duration'; import { PolicySynthesizer, getPrecreatedRoleConfig } from '../helpers-internal'; import { Lazy } from '../lazy'; +import { Size } from '../size'; import { Stack } from '../stack'; import { Token } from '../token'; +export interface CustomResourceProviderOptions { + /** + * Whether or not the cloudformation response wrapper (`nodejs-entrypoint.ts`) is used. + * If set to `true`, `nodejs-entrypoint.js` is bundled in the same asset as the custom resource + * and set as the entrypoint. If set to `false`, the custom resource provided is the + * entrypoint. + * + * @default - `true` if `inlineCode: false` and `false` otherwise. + */ + readonly useCfnResponseWrapper?: boolean; + + /** + * A set of IAM policy statements to include in the inline policy of the + * provider's lambda function. + * + * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` + * objects like you will see in the rest of the CDK. + * + * @default - no additional inline policy + * + * @example + * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { + * codeDirectory: `${__dirname}/my-handler`, + * runtime: CustomResourceProviderRuntime.NODEJS_18_X, + * policyStatements: [ + * { + * Effect: 'Allow', + * Action: 's3:PutObject*', + * Resource: '*', + * } + * ], + * }); + */ + readonly policyStatements?: any[]; + + /** + * AWS Lambda timeout for the provider. + * + * @default Duration.minutes(15) + */ + readonly timeout?: Duration; + + /** + * The amount of memory that your function has access to. Increasing the + * function's memory also increases its CPU allocation. + * + * @default Size.mebibytes(128) + */ + readonly memorySize?: Size; + + /** + * Key-value pairs that are passed to Lambda as Environment + * + * @default - No environment variables. + */ + readonly environment?: { [key: string]: string }; + + /** + * A description of the function. + * + * @default - No description. + */ + readonly description?: string; +} + export abstract class CustomResourceProviderBase extends Construct { private policyStatements?: any[]; protected _role?: CfnResource; From 81781355cff4007256306d76aa2d6921a771d111 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 09:24:36 -0800 Subject: [PATCH 48/74] reverted changes in edge function Signed-off-by: Francis --- .../lib/experimental/edge-function.ts | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index 4ae6bfc7df4c7..c6790393d0751 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -8,14 +8,14 @@ import * as ssm from '../../../aws-ssm'; import { CfnResource, CustomResource, + CustomResourceProvider, + CustomResourceProviderRuntime, Lazy, Resource, Stack, Stage, Token, } from '../../../core'; -import { CdkCustomResourceProvider } from '../../../core/lib/custom-resource-provider/cdk-custom-resource-provider'; -import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; /** * Properties for creating a Lambda@Edge function @@ -199,12 +199,9 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }); const resourceType = 'Custom::CrossRegionStringParameterReader'; - const handler = CdkHandler.fromAsset(path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), { - entrypoint: '__entrypoint__.handler', - compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], - }); - const provider = CdkCustomResourceProvider.getOrCreateProvider(this, resourceType, { - handler, + const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { + codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), + runtime: CustomResourceProviderRuntime.NODEJS_18_X, policyStatements: [{ Effect: 'Allow', Resource: parameterArnPrefix, @@ -212,19 +209,9 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }], }); - // const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { - // codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), - // runtime: CustomResourceProviderRuntime.NODEJS_18_X, - // policyStatements: [{ - // Effect: 'Allow', - // Resource: parameterArnPrefix, - // Action: ['ssm:GetParameter'], - // }], - // }); - const resource = new CustomResource(this, 'ArnReader', { resourceType: resourceType, - serviceToken: provider.serviceToken, + serviceToken: serviceToken, properties: { Region: EdgeFunction.EDGE_REGION, ParameterName: parameterName, From 2ea9e3771e011e3260c4b5bc43423ba930d00eea Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Nov 2023 21:35:19 -0800 Subject: [PATCH 49/74] refactored custom resource provider Signed-off-by: Francis --- .../cdk-custom-resource-provider.ts | 96 +++-- .../custom-resource-provider-base.ts | 274 ++++++++------ .../custom-resource-provider.ts | 340 +----------------- .../lib/custom-resource-provider/index.ts | 4 +- .../lib/custom-resource-provider/shared.ts | 72 ++++ 5 files changed, 300 insertions(+), 486 deletions(-) create mode 100644 packages/aws-cdk-lib/core/lib/custom-resource-provider/shared.ts diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts index eb034b8c8c223..5997bf2485dc0 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -1,77 +1,67 @@ import { Construct } from 'constructs'; -import { CustomResourceProviderBase, CustomResourceProviderOptions } from './custom-resource-provider-base'; -import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; +import { CustomResourceProviderBase } from './custom-resource-provider-base'; +import { CustomResourceProviderOptions } from './shared'; +import { Runtime } from '../../../aws-lambda'; import { RuntimeDeterminer } from '../../../handler-framework/lib/utils/runtime-determiner'; -import { CfnResource } from '../cfn-resource'; -import { Duration } from '../duration'; -import { Size } from '../size'; import { Stack } from '../stack'; -import { Token } from '../token'; +/** + * Initialization properties for `CdkCustomResourceProvider` + */ export interface CdkCustomResourceProviderProps extends CustomResourceProviderOptions { /** - * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. + * A local file system directory with the provider's code. The code will be + * bundled into a zip asset and wired to the provider's AWS Lambda function. */ - readonly handler: CdkHandler; + readonly codeDirectory: string; + + /** + * Runtimes that are compatible with the source code. + */ + readonly compatibleRuntimes: Runtime[]; } export class CdkCustomResourceProvider extends CustomResourceProviderBase { + /** + * Returns a stack-level singleton ARN (service token) for the custom resource + * provider. + * + * @param scope Construct scope + * @param uniqueid A globally unique id that will be used for the stack-level + * construct. + * @param props Provider properties which will only be applied when the + * provider is first created. + * @returns the service token of the custom resource provider, which should be + * used when defining a `CustomResource`. + */ public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; } + /** + * Returns a stack-level singleton for the custom resource provider. + * + * @param scope Construct scope + * @param uniqueid A globally unique id that will be used for the stack-level + * construct. + * @param props Provider properties which will only be applied when the + * provider is first created. + * @returns the service token of the custom resource provider, which should be + * used when defining a `CustomResource`. + */ public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { const id = `${uniqueid}CustomResourceProvider`; const stack = Stack.of(scope); const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider - ?? new CdkCustomResourceProvider(stack, id, props); + ?? new CdkCustomResourceProvider(scope, id, props); + return provider; } - public readonly serviceToken; - public readonly roleArn; - protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { - super(scope, id); - - if (props.policyStatements) { - for (const statement of props.policyStatements) { - this.addToRolePolicy(statement); - } - } - - this.roleArn = this.renderRoleArn(id); - - const code = props.handler.code.bind(Stack.of(this)); - - const timeout = props.timeout ?? Duration.minutes(15); - const memory = props.memorySize ?? Size.mebibytes(128); - - const handler = new CfnResource(this, 'Handler', { - type: 'AWS::Lambda::Function', - properties: { - Code: { - code: { - S3Bucket: code.s3Location?.bucketName, - S3Key: code.s3Location?.objectKey, - }, - }, - Timeout: timeout.toSeconds(), - MemorySize: memory.toMebibytes(), - Handler: props.handler.entrypoint, - Role: this.roleArn, - Runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes).name, - Environment: this.renderEnvironmentVariables(props.environment), - Description: props.description ?? undefined, - }, + super(scope, id, { + ...props, + runtimeName: RuntimeDeterminer.determineLatestRuntime(props.compatibleRuntimes).name, }); - - props.handler.code.bindToResource(handler); - - if (this._role) { - handler.addDependency(this._role); - } - - this.serviceToken = Token.asString(handler.getAtt('Arn')); } -} \ No newline at end of file +} diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts index 301cf0248c29f..03fc00bb1e358 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -1,91 +1,152 @@ +import * as path from 'path'; import { Construct } from 'constructs'; +import * as fs from 'fs-extra'; +import { CustomResourceProviderOptions, INLINE_CUSTOM_RESOURCE_CONTEXT } from './shared'; +import * as cxapi from '../../../cx-api'; +import { AssetStaging } from '../asset-staging'; +import { FileAssetPackaging } from '../assets'; import { CfnResource } from '../cfn-resource'; import { Duration } from '../duration'; +import { FileSystem } from '../fs'; import { PolicySynthesizer, getPrecreatedRoleConfig } from '../helpers-internal'; import { Lazy } from '../lazy'; import { Size } from '../size'; import { Stack } from '../stack'; import { Token } from '../token'; -export interface CustomResourceProviderOptions { - /** - * Whether or not the cloudformation response wrapper (`nodejs-entrypoint.ts`) is used. - * If set to `true`, `nodejs-entrypoint.js` is bundled in the same asset as the custom resource - * and set as the entrypoint. If set to `false`, the custom resource provided is the - * entrypoint. - * - * @default - `true` if `inlineCode: false` and `false` otherwise. - */ - readonly useCfnResponseWrapper?: boolean; - - /** - * A set of IAM policy statements to include in the inline policy of the - * provider's lambda function. - * - * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` - * objects like you will see in the rest of the CDK. - * - * @default - no additional inline policy - * - * @example - * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { - * codeDirectory: `${__dirname}/my-handler`, - * runtime: CustomResourceProviderRuntime.NODEJS_18_X, - * policyStatements: [ - * { - * Effect: 'Allow', - * Action: 's3:PutObject*', - * Resource: '*', - * } - * ], - * }); - */ - readonly policyStatements?: any[]; - - /** - * AWS Lambda timeout for the provider. - * - * @default Duration.minutes(15) - */ - readonly timeout?: Duration; +const ENTRYPOINT_FILENAME = '__entrypoint__'; +const ENTRYPOINT_NODEJS_SOURCE = path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'core', 'nodejs-entrypoint-handler', 'index.js'); +/** + * Initialization properties for `CustomResourceProviderBase` + */ +export interface CustomResourceProviderBaseProps extends CustomResourceProviderOptions { /** - * The amount of memory that your function has access to. Increasing the - * function's memory also increases its CPU allocation. - * - * @default Size.mebibytes(128) + * A local file system directory with the provider's code. The code will be + * bundled into a zip asset and wired to the provider's AWS Lambda function. */ - readonly memorySize?: Size; + readonly codeDirectory: string; /** - * Key-value pairs that are passed to Lambda as Environment - * - * @default - No environment variables. + * The AWS Lambda runtime and version to use for the provider. */ - readonly environment?: { [key: string]: string }; + readonly runtimeName: string; +} +/** + * Base class for creating a custom resource provider + */ +export abstract class CustomResourceProviderBase extends Construct { /** - * A description of the function. - * - * @default - No description. + * The hash of the lambda code backing this provider. Can be used to trigger updates + * on code changes, even when the properties of a custom resource remain unchanged. */ - readonly description?: string; -} + public get codeHash(): string { + if (!this._codeHash) { + throw new Error('This custom resource uses inlineCode: true and does not have a codeHash'); + } + return this._codeHash; + } -export abstract class CustomResourceProviderBase extends Construct { + private _codeHash?: string; private policyStatements?: any[]; - protected _role?: CfnResource; + private role?: CfnResource; /** * The ARN of the provider's AWS Lambda function which should be used as the `serviceToken` when defining a custom * resource. */ - public abstract readonly serviceToken: string; + public readonly serviceToken: string; /** * The ARN of the provider's AWS Lambda function role. */ - public abstract readonly roleArn: string; + public readonly roleArn: string; + + public constructor(scope: Construct, id: string, props: CustomResourceProviderBaseProps) { + super(scope, id); + + const stack = Stack.of(this); + + // verify we have an index file there + if (!fs.existsSync(path.join(props.codeDirectory, 'index.js'))) { + throw new Error(`cannot find ${props.codeDirectory}/index.js`); + } + + const { code, codeHandler, metadata } = this.createCodePropAndMetadata(props, stack); + + const config = getPrecreatedRoleConfig(this, `${this.node.path}/Role`); + const assumeRolePolicyDoc = [{ Action: 'sts:AssumeRole', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' } }]; + const managedPolicyArn = 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'; + + // need to initialize this attribute, but there should never be an instance + // where config.enabled=true && config.preventSynthesis=true + this.roleArn = ''; + if (config.enabled) { + // gives policyStatements a chance to resolve + this.node.addValidation({ + validate: () => { + PolicySynthesizer.getOrCreate(this).addRole(`${this.node.path}/Role`, { + missing: !config.precreatedRoleName, + roleName: config.precreatedRoleName ?? id+'Role', + managedPolicies: [{ managedPolicyArn: managedPolicyArn }], + policyStatements: this.policyStatements ?? [], + assumeRolePolicy: assumeRolePolicyDoc as any, + }); + return []; + }, + }); + this.roleArn = Stack.of(this).formatArn({ + region: '', + service: 'iam', + resource: 'role', + resourceName: config.precreatedRoleName, + }); + } + if (!config.preventSynthesis) { + this.role = new CfnResource(this, 'Role', { + type: 'AWS::IAM::Role', + properties: { + AssumeRolePolicyDocument: { + Version: '2012-10-17', + Statement: assumeRolePolicyDoc, + }, + ManagedPolicyArns: [ + { 'Fn::Sub': managedPolicyArn }, + ], + Policies: Lazy.any({ produce: () => this.renderPolicies() }), + }, + }); + this.roleArn = Token.asString(this.role.getAtt('Arn')); + } + + const timeout = props.timeout ?? Duration.minutes(15); + const memory = props.memorySize ?? Size.mebibytes(128); + + const handler = new CfnResource(this, 'Handler', { + type: 'AWS::Lambda::Function', + properties: { + Code: code, + Timeout: timeout.toSeconds(), + MemorySize: memory.toMebibytes(), + Handler: codeHandler, + Role: this.roleArn, + Runtime: props.runtimeName, + Environment: this.renderEnvironmentVariables(props.environment), + Description: props.description ?? undefined, + }, + }); + + if (this.role) { + handler.addDependency(this.role); + } + + if (metadata) { + Object.entries(metadata).forEach(([k, v]) => handler.addMetadata(k, v)); + } + + this.serviceToken = Token.asString(handler.getAtt('Arn')); + } /** * Add an IAM policy statement to the inline policy of the @@ -127,7 +188,7 @@ export abstract class CustomResourceProviderBase extends Construct { return policies; } - protected renderEnvironmentVariables(env?: { [key: string]: string }) { + private renderEnvironmentVariables(env?: { [key: string]: string }) { if (!env || Object.keys(env).length === 0) { return undefined; } @@ -150,52 +211,65 @@ export abstract class CustomResourceProviderBase extends Construct { return { Variables: variables }; } - protected renderRoleArn(id: string) { - const config = getPrecreatedRoleConfig(this, `${this.node.path}/Role`); - const assumeRolePolicyDoc = [{ Action: 'sts:AssumeRole', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' } }]; - const managedPolicyArn = 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'; + /** + * Returns the code property for the custom resource as well as any metadata. + * If the code is to be uploaded as an asset, the asset gets created in this function. + */ + private createCodePropAndMetadata(props: CustomResourceProviderBaseProps, stack: Stack): { + code: Code, + codeHandler: string, + metadata?: {[key: string]: string}, + } { + let codeHandler = 'index.handler'; + const inlineCode = this.node.tryGetContext(INLINE_CUSTOM_RESOURCE_CONTEXT); + if (!inlineCode) { + const stagingDirectory = FileSystem.mkdtemp('cdk-custom-resource'); + fs.copySync(props.codeDirectory, stagingDirectory, { filter: (src, _dest) => !src.endsWith('.ts') }); - if (config.enabled) { - // gives policyStatements a chance to resolve - this.node.addValidation({ - validate: () => { - PolicySynthesizer.getOrCreate(this).addRole(`${this.node.path}/Role`, { - missing: !config.precreatedRoleName, - roleName: config.precreatedRoleName ?? id+'Role', - managedPolicies: [{ managedPolicyArn: managedPolicyArn }], - policyStatements: this.policyStatements ?? [], - assumeRolePolicy: assumeRolePolicyDoc as any, - }); - return []; - }, + if (props.useCfnResponseWrapper ?? true) { + fs.copyFileSync(ENTRYPOINT_NODEJS_SOURCE, path.join(stagingDirectory, `${ENTRYPOINT_FILENAME}.js`)); + codeHandler = `${ENTRYPOINT_FILENAME}.handler`; + } + + const staging = new AssetStaging(this, 'Staging', { + sourcePath: stagingDirectory, }); - return Stack.of(this).formatArn({ - region: '', - service: 'iam', - resource: 'role', - resourceName: config.precreatedRoleName, + + const assetFileName = staging.relativeStagedPath(stack); + + const asset = stack.synthesizer.addFileAsset({ + fileName: assetFileName, + sourceHash: staging.assetHash, + packaging: FileAssetPackaging.ZIP_DIRECTORY, }); - } - if (!config.preventSynthesis) { - this._role = new CfnResource(this, 'Role', { - type: 'AWS::IAM::Role', - properties: { - AssumeRolePolicyDocument: { - Version: '2012-10-17', - Statement: assumeRolePolicyDoc, - }, - ManagedPolicyArns: [ - { 'Fn::Sub': managedPolicyArn }, - ], - Policies: Lazy.any({ produce: () => this.renderPolicies() }), + this._codeHash = staging.assetHash; + + return { + code: { + S3Bucket: asset.bucketName, + S3Key: asset.objectKey, }, - }); - return Token.asString(this._role.getAtt('Arn')); + codeHandler, + metadata: this.node.tryGetContext(cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT) ? { + [cxapi.ASSET_RESOURCE_METADATA_PATH_KEY]: assetFileName, + [cxapi.ASSET_RESOURCE_METADATA_PROPERTY_KEY]: 'Code', + } : undefined, + }; } - // used to satisfy all code paths returning a value, but there should never be an instance - // where config.enabled=true && config.preventSynthesis=true - return ''; + return { + code: { + ZipFile: fs.readFileSync(path.join(props.codeDirectory, 'index.js'), 'utf-8'), + }, + codeHandler, + }; } } + +type Code = { + ZipFile: string, +} | { + S3Bucket: string, + S3Key: string, +}; diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts index e2a15e3211263..1cfaedea81b66 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -1,37 +1,13 @@ -import * as path from 'path'; import { Construct } from 'constructs'; -import * as fs from 'fs-extra'; -import * as cxapi from '../../../cx-api'; -import { AssetStaging } from '../asset-staging'; -import { FileAssetPackaging } from '../assets'; -import { CfnResource } from '../cfn-resource'; -import { Duration } from '../duration'; -import { FileSystem } from '../fs'; -import { PolicySynthesizer, getPrecreatedRoleConfig } from '../helpers-internal'; -import { Lazy } from '../lazy'; -import { Size } from '../size'; +import { CustomResourceProviderBase } from './custom-resource-provider-base'; +import { CustomResourceProviderOptions } from './shared'; import { Stack } from '../stack'; -import { Token } from '../token'; - -const ENTRYPOINT_FILENAME = '__entrypoint__'; -const ENTRYPOINT_NODEJS_SOURCE = path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'core', 'nodejs-entrypoint-handler', 'index.js'); -export const INLINE_CUSTOM_RESOURCE_CONTEXT = '@aws-cdk/core:inlineCustomResourceIfPossible'; /** * Initialization properties for `CustomResourceProvider`. * */ -export interface CustomResourceProviderProps { - /** - * Whether or not the cloudformation response wrapper (`nodejs-entrypoint.ts`) is used. - * If set to `true`, `nodejs-entrypoint.js` is bundled in the same asset as the custom resource - * and set as the entrypoint. If set to `false`, the custom resource provided is the - * entrypoint. - * - * @default - `true` if `inlineCode: false` and `false` otherwise. - */ - readonly useCfnResponseWrapper?: boolean; - +export interface CustomResourceProviderProps extends CustomResourceProviderOptions { /** * A local file system directory with the provider's code. The code will be * bundled into a zip asset and wired to the provider's AWS Lambda function. @@ -42,59 +18,6 @@ export interface CustomResourceProviderProps { * The AWS Lambda runtime and version to use for the provider. */ readonly runtime: CustomResourceProviderRuntime; - - /** - * A set of IAM policy statements to include in the inline policy of the - * provider's lambda function. - * - * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` - * objects like you will see in the rest of the CDK. - * - * @default - no additional inline policy - * - * @example - * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { - * codeDirectory: `${__dirname}/my-handler`, - * runtime: CustomResourceProviderRuntime.NODEJS_18_X, - * policyStatements: [ - * { - * Effect: 'Allow', - * Action: 's3:PutObject*', - * Resource: '*', - * } - * ], - * }); - */ - readonly policyStatements?: any[]; - - /** - * AWS Lambda timeout for the provider. - * - * @default Duration.minutes(15) - */ - readonly timeout?: Duration; - - /** - * The amount of memory that your function has access to. Increasing the - * function's memory also increases its CPU allocation. - * - * @default Size.mebibytes(128) - */ - readonly memorySize?: Size; - - /** - * Key-value pairs that are passed to Lambda as Environment - * - * @default - No environment variables. - */ - readonly environment?: { [key: string]: string }; - - /** - * A description of the function. - * - * @default - No description. - */ - readonly description?: string; } /** @@ -154,7 +77,7 @@ export enum CustomResourceProviderRuntime { * in that module a read, regardless of whether you end up using the Provider * class in there or this one. */ -export class CustomResourceProvider extends Construct { +export class CustomResourceProvider extends CustomResourceProviderBase { /** * Returns a stack-level singleton ARN (service token) for the custom resource * provider. @@ -186,256 +109,16 @@ export class CustomResourceProvider extends Construct { const id = `${uniqueid}CustomResourceProvider`; const stack = Stack.of(scope); const provider = stack.node.tryFindChild(id) as CustomResourceProvider - ?? new CustomResourceProvider(stack, id, props); + ?? new CustomResourceProvider(scope, id, props); return provider; } - /** - * The ARN of the provider's AWS Lambda function which should be used as the - * `serviceToken` when defining a custom resource. - * - * @example - * declare const myProvider: CustomResourceProvider; - * - * new CustomResource(this, 'MyCustomResource', { - * serviceToken: myProvider.serviceToken, - * properties: { - * myPropertyOne: 'one', - * myPropertyTwo: 'two', - * }, - * }); - */ - public readonly serviceToken: string; - - /** - * The ARN of the provider's AWS Lambda function role. - */ - public readonly roleArn: string; - - /** - * The hash of the lambda code backing this provider. Can be used to trigger updates - * on code changes, even when the properties of a custom resource remain unchanged. - */ - public get codeHash(): string { - if (!this._codeHash) { - throw new Error('This custom resource uses inlineCode: true and does not have a codeHash'); - } - return this._codeHash; - } - - private _codeHash?: string; - - private policyStatements?: any[]; - private _role?: CfnResource; - protected constructor(scope: Construct, id: string, props: CustomResourceProviderProps) { - super(scope, id); - - const stack = Stack.of(scope); - - // verify we have an index file there - if (!fs.existsSync(path.join(props.codeDirectory, 'index.js'))) { - throw new Error(`cannot find ${props.codeDirectory}/index.js`); - } - - const { code, codeHandler, metadata } = this.createCodePropAndMetadata(props, stack); - - if (props.policyStatements) { - for (const statement of props.policyStatements) { - this.addToRolePolicy(statement); - } - } - - const config = getPrecreatedRoleConfig(this, `${this.node.path}/Role`); - const assumeRolePolicyDoc = [{ Action: 'sts:AssumeRole', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' } }]; - const managedPolicyArn = 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'; - - // need to initialize this attribute, but there should never be an instance - // where config.enabled=true && config.preventSynthesis=true - this.roleArn = ''; - if (config.enabled) { - // gives policyStatements a chance to resolve - this.node.addValidation({ - validate: () => { - PolicySynthesizer.getOrCreate(this).addRole(`${this.node.path}/Role`, { - missing: !config.precreatedRoleName, - roleName: config.precreatedRoleName ?? id+'Role', - managedPolicies: [{ managedPolicyArn: managedPolicyArn }], - policyStatements: this.policyStatements ?? [], - assumeRolePolicy: assumeRolePolicyDoc as any, - }); - return []; - }, - }); - this.roleArn = Stack.of(this).formatArn({ - region: '', - service: 'iam', - resource: 'role', - resourceName: config.precreatedRoleName, - }); - } - if (!config.preventSynthesis) { - this._role = new CfnResource(this, 'Role', { - type: 'AWS::IAM::Role', - properties: { - AssumeRolePolicyDocument: { - Version: '2012-10-17', - Statement: assumeRolePolicyDoc, - }, - ManagedPolicyArns: [ - { 'Fn::Sub': managedPolicyArn }, - ], - Policies: Lazy.any({ produce: () => this.renderPolicies() }), - }, - }); - this.roleArn = Token.asString(this._role.getAtt('Arn')); - } - - const timeout = props.timeout ?? Duration.minutes(15); - const memory = props.memorySize ?? Size.mebibytes(128); - - const handler = new CfnResource(this, 'Handler', { - type: 'AWS::Lambda::Function', - properties: { - Code: code, - Timeout: timeout.toSeconds(), - MemorySize: memory.toMebibytes(), - Handler: codeHandler, - Role: this.roleArn, - Runtime: customResourceProviderRuntimeToString(props.runtime), - Environment: this.renderEnvironmentVariables(props.environment), - Description: props.description ?? undefined, - }, + super(scope, id, { + ...props, + runtimeName: customResourceProviderRuntimeToString(props.runtime), }); - - if (this._role) { - handler.addDependency(this._role); - } - - if (metadata) { - Object.entries(metadata).forEach(([k, v]) => handler.addMetadata(k, v)); - } - - this.serviceToken = Token.asString(handler.getAtt('Arn')); - } - - /** - * Returns the code property for the custom resource as well as any metadata. - * If the code is to be uploaded as an asset, the asset gets created in this function. - */ - private createCodePropAndMetadata(props: CustomResourceProviderProps, stack: Stack): { - code: Code, - codeHandler: string, - metadata?: {[key: string]: string}, - } { - let codeHandler = 'index.handler'; - const inlineCode = this.node.tryGetContext(INLINE_CUSTOM_RESOURCE_CONTEXT); - if (!inlineCode) { - const stagingDirectory = FileSystem.mkdtemp('cdk-custom-resource'); - fs.copySync(props.codeDirectory, stagingDirectory, { filter: (src, _dest) => !src.endsWith('.ts') }); - - if (props.useCfnResponseWrapper ?? true) { - fs.copyFileSync(ENTRYPOINT_NODEJS_SOURCE, path.join(stagingDirectory, `${ENTRYPOINT_FILENAME}.js`)); - codeHandler = `${ENTRYPOINT_FILENAME}.handler`; - } - - const staging = new AssetStaging(this, 'Staging', { - sourcePath: stagingDirectory, - }); - - const assetFileName = staging.relativeStagedPath(stack); - - const asset = stack.synthesizer.addFileAsset({ - fileName: assetFileName, - sourceHash: staging.assetHash, - packaging: FileAssetPackaging.ZIP_DIRECTORY, - }); - - this._codeHash = staging.assetHash; - - return { - code: { - S3Bucket: asset.bucketName, - S3Key: asset.objectKey, - }, - codeHandler, - metadata: this.node.tryGetContext(cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT) ? { - [cxapi.ASSET_RESOURCE_METADATA_PATH_KEY]: assetFileName, - [cxapi.ASSET_RESOURCE_METADATA_PROPERTY_KEY]: 'Code', - } : undefined, - }; - } - - return { - code: { - ZipFile: fs.readFileSync(path.join(props.codeDirectory, 'index.js'), 'utf-8'), - }, - codeHandler, - }; - } - - /** - * Add an IAM policy statement to the inline policy of the - * provider's lambda function's role. - * - * **Please note**: this is a direct IAM JSON policy blob, *not* a `iam.PolicyStatement` - * object like you will see in the rest of the CDK. - * - * - * @example - * declare const myProvider: CustomResourceProvider; - * - * myProvider.addToRolePolicy({ - * Effect: 'Allow', - * Action: 's3:GetObject', - * Resource: '*', - * }); - */ - public addToRolePolicy(statement: any): void { - if (!this.policyStatements) { - this.policyStatements = []; - } - this.policyStatements.push(statement); - } - - private renderPolicies() { - if (!this.policyStatements) { - return undefined; - } - - const policies = [{ - PolicyName: 'Inline', - PolicyDocument: { - Version: '2012-10-17', - Statement: this.policyStatements, - }, - }]; - - return policies; - } - - private renderEnvironmentVariables(env?: { [key: string]: string }) { - if (!env || Object.keys(env).length === 0) { - return undefined; - } - - env = { ...env }; // Copy - - // Always use regional endpoints - env.AWS_STS_REGIONAL_ENDPOINTS = 'regional'; - - // Sort environment so the hash of the function used to create - // `currentVersion` is not affected by key order (this is how lambda does - // it) - const variables: { [key: string]: string } = {}; - const keys = Object.keys(env).sort(); - - for (const key of keys) { - variables[key] = env[key]; - } - - return { Variables: variables }; } } @@ -452,10 +135,3 @@ function customResourceProviderRuntimeToString(x: CustomResourceProviderRuntime) return 'nodejs18.x'; } } - -type Code = { - ZipFile: string, -} | { - S3Bucket: string, - S3Key: string, -}; diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/index.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/index.ts index 9ff36ec201b71..95841d8fa7525 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/index.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/index.ts @@ -1 +1,3 @@ -export * from './custom-resource-provider'; \ No newline at end of file +export * from './custom-resource-provider-base'; +export * from './custom-resource-provider'; +export * from './shared'; \ No newline at end of file diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/shared.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/shared.ts new file mode 100644 index 0000000000000..0f5f13e250afc --- /dev/null +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/shared.ts @@ -0,0 +1,72 @@ +import { Duration } from '../duration'; +import { Size } from '../size'; + +export const INLINE_CUSTOM_RESOURCE_CONTEXT = '@aws-cdk/core:inlineCustomResourceIfPossible'; + +/** + * Initialization options for custom resource providers + */ +export interface CustomResourceProviderOptions { + /** + * Whether or not the cloudformation response wrapper (`nodejs-entrypoint.ts`) is used. + * If set to `true`, `nodejs-entrypoint.js` is bundled in the same asset as the custom resource + * and set as the entrypoint. If set to `false`, the custom resource provided is the + * entrypoint. + * + * @default - `true` if `inlineCode: false` and `false` otherwise. + */ + readonly useCfnResponseWrapper?: boolean; + + /** + * A set of IAM policy statements to include in the inline policy of the + * provider's lambda function. + * + * **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement` + * objects like you will see in the rest of the CDK. + * + * @default - no additional inline policy + * + * @example + * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { + * codeDirectory: `${__dirname}/my-handler`, + * runtime: CustomResourceProviderRuntime.NODEJS_18_X, + * policyStatements: [ + * { + * Effect: 'Allow', + * Action: 's3:PutObject*', + * Resource: '*', + * } + * ], + * }); + */ + readonly policyStatements?: any[]; + + /** + * AWS Lambda timeout for the provider. + * + * @default Duration.minutes(15) + */ + readonly timeout?: Duration; + + /** + * The amount of memory that your function has access to. Increasing the + * function's memory also increases its CPU allocation. + * + * @default Size.mebibytes(128) + */ + readonly memorySize?: Size; + + /** + * Key-value pairs that are passed to Lambda as Environment + * + * @default - No environment variables. + */ + readonly environment?: { [key: string]: string }; + + /** + * A description of the function. + * + * @default - No description. + */ + readonly description?: string; +} From f0a4b61c68dc84c20dbbf09f2c465e039493c69c Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 08:44:24 -0800 Subject: [PATCH 50/74] wip Signed-off-by: Francis --- .../cdk-custom-resource-provider.ts | 49 +------------------ .../custom-resource-provider-base.ts | 6 +-- 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts index 5997bf2485dc0..ef435b5ea59df 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -1,9 +1,5 @@ -import { Construct } from 'constructs'; -import { CustomResourceProviderBase } from './custom-resource-provider-base'; import { CustomResourceProviderOptions } from './shared'; import { Runtime } from '../../../aws-lambda'; -import { RuntimeDeterminer } from '../../../handler-framework/lib/utils/runtime-determiner'; -import { Stack } from '../stack'; /** * Initialization properties for `CdkCustomResourceProvider` @@ -21,47 +17,4 @@ export interface CdkCustomResourceProviderProps extends CustomResourceProviderOp readonly compatibleRuntimes: Runtime[]; } -export class CdkCustomResourceProvider extends CustomResourceProviderBase { - /** - * Returns a stack-level singleton ARN (service token) for the custom resource - * provider. - * - * @param scope Construct scope - * @param uniqueid A globally unique id that will be used for the stack-level - * construct. - * @param props Provider properties which will only be applied when the - * provider is first created. - * @returns the service token of the custom resource provider, which should be - * used when defining a `CustomResource`. - */ - public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { - return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; - } - - /** - * Returns a stack-level singleton for the custom resource provider. - * - * @param scope Construct scope - * @param uniqueid A globally unique id that will be used for the stack-level - * construct. - * @param props Provider properties which will only be applied when the - * provider is first created. - * @returns the service token of the custom resource provider, which should be - * used when defining a `CustomResource`. - */ - public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { - const id = `${uniqueid}CustomResourceProvider`; - const stack = Stack.of(scope); - const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider - ?? new CdkCustomResourceProvider(scope, id, props); - - return provider; - } - - protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { - super(scope, id, { - ...props, - runtimeName: RuntimeDeterminer.determineLatestRuntime(props.compatibleRuntimes).name, - }); - } -} +export class CdkCustomResourceProvider {} diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts index 03fc00bb1e358..067218d776d10 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -63,10 +63,10 @@ export abstract class CustomResourceProviderBase extends Construct { */ public readonly roleArn: string; - public constructor(scope: Construct, id: string, props: CustomResourceProviderBaseProps) { + protected constructor(scope: Construct, id: string, props: CustomResourceProviderBaseProps) { super(scope, id); - const stack = Stack.of(this); + const stack = Stack.of(scope); // verify we have an index file there if (!fs.existsSync(path.join(props.codeDirectory, 'index.js'))) { @@ -267,7 +267,7 @@ export abstract class CustomResourceProviderBase extends Construct { } } -type Code = { +export type Code = { ZipFile: string, } | { S3Bucket: string, From 009858059e9c9430b6ca0e2d2d4d7311752632e8 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 10:42:38 -0800 Subject: [PATCH 51/74] wip Signed-off-by: Francis --- .../custom-resource-provider-base.ts | 6 ++++++ .../custom-resource-provider/custom-resource-provider.ts | 3 +-- packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts index 067218d776d10..d2d59ca436e54 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -73,6 +73,12 @@ export abstract class CustomResourceProviderBase extends Construct { throw new Error(`cannot find ${props.codeDirectory}/index.js`); } + if (props.policyStatements) { + for (const statement of props.policyStatements) { + this.addToRolePolicy(statement); + } + } + const { code, codeHandler, metadata } = this.createCodePropAndMetadata(props, stack); const config = getPrecreatedRoleConfig(this, `${this.node.path}/Role`); diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts index 1cfaedea81b66..1b0dd0e81a984 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -109,8 +109,7 @@ export class CustomResourceProvider extends CustomResourceProviderBase { const id = `${uniqueid}CustomResourceProvider`; const stack = Stack.of(scope); const provider = stack.node.tryFindChild(id) as CustomResourceProvider - ?? new CustomResourceProvider(scope, id, props); - + ?? new CustomResourceProvider(stack, id, props); return provider; } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts index 9e6afc0eb9a0e..2dc6d422b375a 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts @@ -1,3 +1,4 @@ +import { RuntimeDeterminer } from './utils/runtime-determiner'; import { Code, Runtime } from '../../aws-lambda'; /** @@ -39,13 +40,13 @@ export class CdkHandler { public readonly entrypoint: string; /** - * Runtimes that are compatible with the source code. + * The latest runtime that is compatible with the source code. */ - public readonly compatibleRuntimes: Runtime[]; + public readonly runtime: Runtime; private constructor(path: string, props: CdkHandlerProps) { this.code = Code.fromAsset(path); this.entrypoint = props.entrypoint; - this.compatibleRuntimes = props.compatibleRuntimes; + this.runtime = RuntimeDeterminer.determineLatestRuntime(props.compatibleRuntimes); } } From 490eda12d3a8cb65e3458d0c5dd574ad8262870e Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 11:07:53 -0800 Subject: [PATCH 52/74] CdkCustomResourceProvider Signed-off-by: Francis --- .../cdk-custom-resource-provider.ts | 53 ++++++++++++++++--- .../handler-framework/lib/cdk-function.ts | 3 +- .../lib/cdk-singleton-function.ts | 3 +- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts index ef435b5ea59df..990f0558d6367 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -1,20 +1,57 @@ +import { Construct } from 'constructs'; +import { CustomResourceProviderBase } from './custom-resource-provider-base'; import { CustomResourceProviderOptions } from './shared'; -import { Runtime } from '../../../aws-lambda'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; +import { Stack } from '../stack'; /** * Initialization properties for `CdkCustomResourceProvider` */ export interface CdkCustomResourceProviderProps extends CustomResourceProviderOptions { + readonly handler: CdkHandler +} + +export class CdkCustomResourceProvider extends CustomResourceProviderBase { /** - * A local file system directory with the provider's code. The code will be - * bundled into a zip asset and wired to the provider's AWS Lambda function. + * Returns a stack-level singleton ARN (service token) for the custom resource + * provider. + * + * @param scope Construct scope + * @param uniqueid A globally unique id that will be used for the stack-level + * construct. + * @param props Provider properties which will only be applied when the + * provider is first created. + * @returns the service token of the custom resource provider, which should be + * used when defining a `CustomResource`. */ - readonly codeDirectory: string; + public static getOrCreate(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + return this.getOrCreateProvider(scope, uniqueid, props).serviceToken; + } /** - * Runtimes that are compatible with the source code. + * Returns a stack-level singleton for the custom resource provider. + * + * @param scope Construct scope + * @param uniqueid A globally unique id that will be used for the stack-level + * construct. + * @param props Provider properties which will only be applied when the + * provider is first created. + * @returns the service token of the custom resource provider, which should be + * used when defining a `CustomResource`. */ - readonly compatibleRuntimes: Runtime[]; -} + public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { + const id = `${uniqueid}CustomResourceProvider`; + const stack = Stack.of(scope); + const provider = stack.node.tryFindChild(id) as CdkCustomResourceProvider + ?? new CdkCustomResourceProvider(stack, id, props); + return provider; + } -export class CdkCustomResourceProvider {} + protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { + super(scope, id, { + ...props, + codeDirectory: props.handler.entrypoint, + runtimeName: props.handler.runtime.name, + }); + } +} diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index 3dd5cf83276af..bd2a40af59e43 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -1,6 +1,5 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { RuntimeDeterminer } from './utils/runtime-determiner'; import { Function, FunctionOptions } from '../../aws-lambda'; /** @@ -22,7 +21,7 @@ export class CdkFunction extends Function { ...props, code: props.handler.code, handler: props.handler.entrypoint, - runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes), + runtime: props.handler.runtime, }); } } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index 5e39225e133ce..de0308fd278e5 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -1,6 +1,5 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { RuntimeDeterminer } from './utils/runtime-determiner'; import { FunctionOptions, SingletonFunction } from '../../aws-lambda'; /** @@ -42,7 +41,7 @@ export class CdkSingletonFunction extends SingletonFunction { ...props, code: props.handler.code, handler: props.handler.entrypoint, - runtime: RuntimeDeterminer.determineLatestRuntime(props.handler.compatibleRuntimes), + runtime: props.handler.runtime, }); } } From 7f9395556be1c51195a50d4eb17eedf6be040310 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 12:26:34 -0800 Subject: [PATCH 53/74] refactored cdk handler, cdk function, and cdk singleton function. completed initial cdk custom resource provider implementation Signed-off-by: Francis --- .../lib/experimental/edge-function.ts | 21 +++++++++--- .../aws-dynamodb/lib/replica-provider.ts | 6 ++-- .../aws-cdk-lib/aws-ses/lib/receipt-rule.ts | 4 +-- .../cdk-custom-resource-provider.ts | 5 ++- .../handler-framework/lib/cdk-function.ts | 4 +-- .../handler-framework/lib/cdk-handler.ts | 33 ++++++++++--------- .../lib/cdk-singleton-function.ts | 4 +-- .../test/cdk-function.test.ts | 3 +- .../test/cdk-handler.test.ts | 33 ------------------- .../test/cdk-singleton-function.test.ts | 3 +- 10 files changed, 53 insertions(+), 63 deletions(-) delete mode 100644 packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index c6790393d0751..1f9aac911033c 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -8,14 +8,14 @@ import * as ssm from '../../../aws-ssm'; import { CfnResource, CustomResource, - CustomResourceProvider, - CustomResourceProviderRuntime, Lazy, Resource, Stack, Stage, Token, } from '../../../core'; +import { CdkCustomResourceProvider } from '../../../core/lib/custom-resource-provider/cdk-custom-resource-provider'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; /** * Properties for creating a Lambda@Edge function @@ -199,9 +199,12 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }); const resourceType = 'Custom::CrossRegionStringParameterReader'; - const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { + const handler = new CdkHandler(this, 'Handler', { codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), - runtime: CustomResourceProviderRuntime.NODEJS_18_X, + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], + }); + const serviceToken = CdkCustomResourceProvider.getOrCreate(this, resourceType, { + handler, policyStatements: [{ Effect: 'Allow', Resource: parameterArnPrefix, @@ -209,6 +212,16 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }], }); + // const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { + // codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), + // runtime: CustomResourceProviderRuntime.NODEJS_18_X, + // policyStatements: [{ + // Effect: 'Allow', + // Resource: parameterArnPrefix, + // Action: ['ssm:GetParameter'], + // }], + // }); + const resource = new CustomResource(this, 'ArnReader', { resourceType: resourceType, serviceToken: serviceToken, diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index a9334b1fe95fe..65f9d21d6758e 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -57,12 +57,14 @@ export class ReplicaProvider extends NestedStack { private constructor(scope: Construct, id: string, props: ReplicaProviderProps) { super(scope, id); - const onEventHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { + const onEventHandler = new CdkHandler(this, 'OnEvent', { + codeDirectory: path.join(__dirname, 'replica-handler'), entrypoint: 'index.onEventHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); - const onCompleteHandler = CdkHandler.fromAsset(path.join(__dirname, 'replica-handler'), { + const onCompleteHandler = new CdkHandler(this, 'OnComplete', { + codeDirectory: path.join(__dirname, 'replica-handler'), entrypoint: 'index.isCompleteHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts index 8e80c447d5552..c49d1a62a9815 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts @@ -173,8 +173,8 @@ export class DropSpamReceiptRule extends Construct { constructor(scope: Construct, id: string, props: DropSpamReceiptRuleProps) { super(scope, id); - const handler = CdkHandler.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler'), { - entrypoint: 'index.handler', + const handler = new CdkHandler(this, 'DropSpamHandler', { + codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler'), compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts index 990f0558d6367..1fac09d7913b0 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts @@ -8,6 +8,9 @@ import { Stack } from '../stack'; * Initialization properties for `CdkCustomResourceProvider` */ export interface CdkCustomResourceProviderProps extends CustomResourceProviderOptions { + /** + * The source code, compatible runtimes, and the method within your code that Lambda calls to execute your function. + */ readonly handler: CdkHandler } @@ -50,7 +53,7 @@ export class CdkCustomResourceProvider extends CustomResourceProviderBase { protected constructor(scope: Construct, id: string, props: CdkCustomResourceProviderProps) { super(scope, id, { ...props, - codeDirectory: props.handler.entrypoint, + codeDirectory: props.handler.codeDirectory, runtimeName: props.handler.runtime.name, }); } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index bd2a40af59e43..e96ec15ef16ae 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { Function, FunctionOptions } from '../../aws-lambda'; +import { Code, Function, FunctionOptions } from '../../aws-lambda'; /** * Properties used to define a Lambda function used as a custom resource provider. @@ -19,7 +19,7 @@ export class CdkFunction extends Function { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { ...props, - code: props.handler.code, + code: Code.fromAsset(props.handler.codeDirectory), handler: props.handler.entrypoint, runtime: props.handler.runtime, }); diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts index 2dc6d422b375a..77009e6e7a82f 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { RuntimeDeterminer } from './utils/runtime-determiner'; -import { Code, Runtime } from '../../aws-lambda'; +import { Runtime } from '../../aws-lambda'; /** * Properties used to define source code executed within a Lambda function acting as a @@ -7,32 +8,33 @@ import { Code, Runtime } from '../../aws-lambda'; */ export interface CdkHandlerProps { /** - * The name of the method within your code that Lambda calls to execute your function. + * A local file system directory with the provider's code. The code will be + * bundled into a zip asset and wired to the provider's AWS Lambda function. */ - readonly entrypoint: string; + readonly codeDirectory: string; /** * Runtimes that are compatible with the source code. */ readonly compatibleRuntimes: Runtime[]; + + /** + * The name of the method within your code that Lambda calls to execute your function. + * + * @default 'index.handler' + */ + readonly entrypoint?: string; } /** * Represents source code that will be executed within a Lambda function acting as a * custom resource provider. */ -export class CdkHandler { - /** - * Loads the source code from a local disk path. - */ - public static fromAsset(path: string, props: CdkHandlerProps) { - return new CdkHandler(path, props); - } - +export class CdkHandler extends Construct { /** * The source code loaded from a local disk path. */ - public readonly code: Code; + public readonly codeDirectory: string; /** * The name of the method within your code that Lambda calls to execute your function. @@ -44,9 +46,10 @@ export class CdkHandler { */ public readonly runtime: Runtime; - private constructor(path: string, props: CdkHandlerProps) { - this.code = Code.fromAsset(path); - this.entrypoint = props.entrypoint; + public constructor(scope: Construct, id: string, props: CdkHandlerProps) { + super(scope, id); + this.codeDirectory = props.codeDirectory; + this.entrypoint = props.entrypoint ?? 'index.handler'; this.runtime = RuntimeDeterminer.determineLatestRuntime(props.compatibleRuntimes); } } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index de0308fd278e5..028e703dd2307 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { FunctionOptions, SingletonFunction } from '../../aws-lambda'; +import { Code, FunctionOptions, SingletonFunction } from '../../aws-lambda'; /** * Properties used to define a singleton Lambda function to be used as a custom resource @@ -39,7 +39,7 @@ export class CdkSingletonFunction extends SingletonFunction { public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { super(scope, id, { ...props, - code: props.handler.code, + code: Code.fromAsset(props.handler.codeDirectory), handler: props.handler.entrypoint, runtime: props.handler.runtime, }); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts index fac8e4aaac4b9..1d3bf7429958e 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-function.test.ts @@ -9,7 +9,8 @@ describe('cdk function', () => { test('stack contains expected lambda function', () => { // GIVEN const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory: path.join(__dirname, 'test-handler'), entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts deleted file mode 100644 index eb29fdca27b8d..0000000000000 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as path from 'path'; -import { Runtime } from '../../aws-lambda'; -import { CdkHandler } from '../lib/cdk-handler'; - -describe('code from asset', () => { - test('correctly sets compatibleRuntimes property', () => { - // GIVEN - const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; - - // WHEN - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes, - }); - - // THEN - expect(handler.compatibleRuntimes).toEqual(compatibleRuntimes); - }); - - test('correctly sets entrypoint property', () => { - // GIVEN - const compatibleRuntimes = [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X]; - - // WHEN - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { - entrypoint: 'index.handler', - compatibleRuntimes, - }); - - // THEN - expect(handler.entrypoint).toEqual('index.handler'); - }); -}); diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts index 6405d8f27e290..65d23601f2798 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-singleton-function.test.ts @@ -9,7 +9,8 @@ describe('cdk singleton function', () => { test('stack contains expected lambda function', () => { // GIVEN const stack = new Stack(); - const handler = CdkHandler.fromAsset(path.join(__dirname, 'test-handler'), { + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory: path.join(__dirname, 'test-handler'), entrypoint: 'index.handler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); From 98601bf16577c65de67b2bf0a79c4664b2b2ffe9 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Nov 2023 13:49:37 -0800 Subject: [PATCH 54/74] cdk-handler tests Signed-off-by: Francis --- .../test/cdk-handler.test.ts | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts new file mode 100644 index 0000000000000..b7cc17945762d --- /dev/null +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts @@ -0,0 +1,58 @@ +import * as path from 'path'; +import { Runtime } from '../../aws-lambda'; +import { Stack } from '../../core'; +import { CdkHandler } from '../lib/cdk-handler'; + +describe('cdk handler', () => { + let stack: Stack; + let codeDirectory: string; + beforeAll(() => { + stack = new Stack(); + codeDirectory = path.join(__dirname, 'test-handler'); + }); + + test('code directory property is correctly set', () => { + // WHEN + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory, + compatibleRuntimes: [Runtime.NODEJS_LATEST], + }); + + // THEN + expect(handler.codeDirectory).toEqual(codeDirectory); + }); + + test('runtime property is correctly set', () => { + // WHEN + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory, + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_LATEST, Runtime.PYTHON_3_12], + }); + + // THEN + expect(handler.runtime.runtimeEquals(Runtime.NODEJS_LATEST)).toBe(true); + }); + + test('index.handler is default entrypoint', () => { + // WHEN + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory, + compatibleRuntimes: [Runtime.NODEJS_LATEST], + }); + + // THEN + expect(handler.entrypoint).toEqual('index.handler'); + }); + + test('entrypoint property is set correctly for non-default entrypoint', () => { + // WHEN + const handler = new CdkHandler(stack, 'CdkHandler', { + codeDirectory, + compatibleRuntimes: [Runtime.NODEJS_LATEST], + entrypoint: 'index.onEventHandler', + }); + + // THEN + expect(handler.entrypoint).toEqual('index.onEventHandler'); + }); +}); From fe7bd4237575dc573c813994d806e56e66c02c0e Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 11:00:19 -0800 Subject: [PATCH 55/74] unit tests for cdk custom resource provider Signed-off-by: Francis --- .../cdk-custom-resource-provider.test.ts | 478 ++++++++++++++++++ 1 file changed, 478 insertions(+) create mode 100644 packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts diff --git a/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts b/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts new file mode 100644 index 0000000000000..f7de24d58cf2b --- /dev/null +++ b/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts @@ -0,0 +1,478 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { Runtime } from '../../../aws-lambda'; +import * as cxapi from '../../../cx-api'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; +import { App, AssetStaging, DockerImageAssetLocation, DockerImageAssetSource, Duration, FileAssetLocation, FileAssetSource, ISynthesisSession, Size, Stack, CfnResource } from '../../lib'; +import { CdkCustomResourceProvider } from '../../lib/custom-resource-provider/cdk-custom-resource-provider'; +import { CUSTOMIZE_ROLES_CONTEXT_KEY } from '../../lib/helpers-internal'; +import { toCloudFormation } from '../util'; + +const TEST_HANDLER = `${__dirname}/mock-provider`; +const STANDARD_PROVIDER = Runtime.NODEJS_18_X; + +describe('cdk custom resource provider', () => { + describe('customize roles', () => { + test('role is not created if preventSynthesis!=false', () => { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'MyStack'); + stack.node.setContext(CUSTOMIZE_ROLES_CONTEXT_KEY, { + usePrecreatedRoles: { + 'MyStack/Custom:MyResourceTypeCustomResourceProvider/Role': 'my-custom-role-name', + }, + }); + const someResource = new CfnResource(stack, 'SomeResource', { + type: 'AWS::SomeResource', + properties: {}, + }); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + const cr = CdkCustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { handler }); + cr.addToRolePolicy({ + Action: 's3:GetBucket', + Effect: 'Allow', + Resource: someResource.ref, + }); + + // THEN + const assembly = app.synth(); + const template = assembly.getStackByName('MyStack').template; + const resourceTypes = Object.values(template.Resources).flatMap((value: any) => { + return value.Type; + }); + // role is not created + expect(resourceTypes).not.toContain('AWS::IAM::Role'); + // lambda function references precreated role + expect(template.Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A.Properties.Role).toEqual({ + 'Fn::Join': [ + '', + [ + 'arn:', + { + Ref: 'AWS::Partition', + }, + ':iam::', + { + Ref: 'AWS::AccountId', + }, + ':role/my-custom-role-name', + ], + ], + }); + + // report is generated correctly + const filePath = path.join(assembly.directory, 'iam-policy-report.json'); + const file = fs.readFileSync(filePath, { encoding: 'utf-8' }); + expect(JSON.parse(file)).toEqual({ + roles: [{ + roleConstructPath: 'MyStack/Custom:MyResourceTypeCustomResourceProvider/Role', + roleName: 'my-custom-role-name', + missing: false, + assumeRolePolicy: [{ + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }], + managedPolicyArns: [ + 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + ], + managedPolicyStatements: [], + identityPolicyStatements: [{ + Action: 's3:GetBucket', + Effect: 'Allow', + Resource: '(MyStack/SomeResource.Ref)', + }], + }], + }); + }); + + test('role is created if preventSynthesis=false', () => { + // GIVEN + const app = new App(); + const stack = new Stack(app, 'MyStack'); + stack.node.setContext(CUSTOMIZE_ROLES_CONTEXT_KEY, { + preventSynthesis: false, + }); + const someResource = new CfnResource(stack, 'SomeResource', { + type: 'AWS::SomeResource', + properties: {}, + }); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + const cr = CdkCustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { handler }); + cr.addToRolePolicy({ + Action: 's3:GetBucket', + Effect: 'Allow', + Resource: someResource.ref, + }); + + // THEN + const assembly = app.synth(); + const template = assembly.getStackByName('MyStack').template; + const resourceTypes = Object.values(template.Resources).flatMap((value: any) => { + return value.Type; + }); + // IAM role _is_ created + expect(resourceTypes).toContain('AWS::IAM::Role'); + // lambda function references the created role + expect(template.Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A.Properties.Role).toEqual({ + 'Fn::GetAtt': [ + 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', + 'Arn', + ], + }); + + // report is still generated + const filePath = path.join(assembly.directory, 'iam-policy-report.json'); + const file = fs.readFileSync(filePath, { encoding: 'utf-8' }); + expect(JSON.parse(file)).toEqual({ + roles: [{ + roleConstructPath: 'MyStack/Custom:MyResourceTypeCustomResourceProvider/Role', + roleName: 'missing role', + missing: true, + assumeRolePolicy: [{ + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }], + managedPolicyArns: [ + 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + ], + managedPolicyStatements: [], + identityPolicyStatements: [{ + Action: 's3:GetBucket', + Effect: 'Allow', + Resource: '(MyStack/SomeResource.Ref)', + }], + }], + }); + }); + }); + + test('minimal configuration', () => { + // GIVEN + const app = new App({ context: { [cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT]: false } }); + const stack = new Stack(app); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { handler }); + + // THEN + const cfn = toCloudFormation(stack); + + // The asset hash constantly changes, so in order to not have to chase it, just look + // it up from the output. + const staging = stack.node.tryFindChild('Custom:MyResourceTypeCustomResourceProvider')?.node.tryFindChild('Staging') as AssetStaging; + const assetHash = staging.assetHash; + const sourcePath = staging.sourcePath; + const paramNames = Object.keys(cfn.Parameters); + const bucketParam = paramNames[0]; + const keyParam = paramNames[1]; + const hashParam = paramNames[2]; + + expect(fs.existsSync(path.join(sourcePath, '__entrypoint__.js'))).toEqual(true); + + expect(cfn).toEqual({ + Resources: { + CustomMyResourceTypeCustomResourceProviderRoleBD5E655F: { + Type: 'AWS::IAM::Role', + Properties: { + AssumeRolePolicyDocument: { + Version: '2012-10-17', + Statement: [ + { + Action: 'sts:AssumeRole', + Effect: 'Allow', + Principal: { + Service: 'lambda.amazonaws.com', + }, + }, + ], + }, + ManagedPolicyArns: [ + { + 'Fn::Sub': 'arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', + }, + ], + }, + }, + CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A: { + Type: 'AWS::Lambda::Function', + Properties: { + Code: { + S3Bucket: { Ref: bucketParam }, + S3Key: { + 'Fn::Join': [ + '', + [ + { + 'Fn::Select': [ + 0, + { + 'Fn::Split': [ + '||', + { Ref: keyParam }, + ], + }, + ], + }, + { + 'Fn::Select': [ + 1, + { + 'Fn::Split': [ + '||', + { Ref: keyParam }, + ], + }, + ], + }, + ], + ], + }, + }, + Timeout: 900, + MemorySize: 128, + Handler: '__entrypoint__.handler', + Role: { + 'Fn::GetAtt': [ + 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', + 'Arn', + ], + }, + Runtime: STANDARD_PROVIDER, + }, + DependsOn: [ + 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', + ], + }, + }, + Parameters: { + [bucketParam]: { + Type: 'String', + Description: `S3 bucket for asset "${assetHash}"`, + }, + [keyParam]: { + Type: 'String', + Description: `S3 key for asset version "${assetHash}"`, + }, + [hashParam]: { + Type: 'String', + Description: `Artifact hash for asset "${assetHash}"`, + }, + }, + }); + + }); + + test('asset metadata added to custom resource that contains code definition', () => { + // GIVEN + const stack = new Stack(); + stack.node.setContext(cxapi.ASSET_RESOURCE_METADATA_ENABLED_CONTEXT, true); + stack.node.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { handler }); + + // Then + const lambda = toCloudFormation(stack).Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A; + expect(lambda).toHaveProperty('Metadata'); + + expect(lambda.Metadata).toMatchObject({ + 'aws:asset:property': 'Code', + + // The asset path should be a temporary folder prefixed with 'cdk-custom-resource' + 'aws:asset:path': expect.stringMatching(/^.*\/cdk-custom-resource\w{6}\/?$/), + }); + + }); + + test('custom resource provided creates asset in new-style synthesis with relative path', () => { + // GIVEN + let assetFilename : string | undefined; + + const app = new App(); + const stack = new Stack(app, 'Stack', { + synthesizer: { + bind(_stack: Stack): void { }, + addFileAsset(asset: FileAssetSource): FileAssetLocation { + assetFilename = asset.fileName; + return { bucketName: '', httpUrl: '', objectKey: '', s3ObjectUrl: '', s3Url: '', kmsKeyArn: '' }; + }, + addDockerImageAsset(_asset: DockerImageAssetSource): DockerImageAssetLocation { + return { imageUri: '', repositoryName: '' }; + }, + synthesize(_session: ISynthesisSession): void { }, + }, + }); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { handler }); + + // THEN -- no exception + if (!assetFilename || assetFilename.startsWith(path.sep)) { + throw new Error(`Asset filename must be a relative path, got: ${assetFilename}`); + } + + }); + + test('policyStatements can be used to add statements to the inline policy', () => { + // GIVEN + const stack = new Stack(); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { + handler, + policyStatements: [ + { statement1: 123 }, + { statement2: { foo: 111 } }, + ], + }); + + // THEN + const template = toCloudFormation(stack); + const role = template.Resources.CustomMyResourceTypeCustomResourceProviderRoleBD5E655F; + expect(role.Properties.Policies).toEqual([{ + PolicyName: 'Inline', + PolicyDocument: { + Version: '2012-10-17', + Statement: [{ statement1: 123 }, { statement2: { foo: 111 } }], + }, + }]); + + }); + + test('addToRolePolicy() can be used to add statements to the inline policy', () => { + // GIVEN + const stack = new Stack(); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + const provider = CdkCustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { + handler, + policyStatements: [ + { statement1: 123 }, + { statement2: { foo: 111 } }, + ], + }); + provider.addToRolePolicy({ statement3: 456 }); + + // THEN + const template = toCloudFormation(stack); + const role = template.Resources.CustomMyResourceTypeCustomResourceProviderRoleBD5E655F; + expect(role.Properties.Policies).toEqual([{ + PolicyName: 'Inline', + PolicyDocument: { + Version: '2012-10-17', + Statement: [{ statement1: 123 }, { statement2: { foo: 111 } }, { statement3: 456 }], + }, + }]); + }); + + test('memorySize, timeout and description', () => { + // GIVEN + const stack = new Stack(); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { + handler, + memorySize: Size.gibibytes(2), + timeout: Duration.minutes(5), + description: 'veni vidi vici', + }); + + // THEN + const template = toCloudFormation(stack); + const lambda = template.Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A; + expect(lambda.Properties.MemorySize).toEqual(2048); + expect(lambda.Properties.Timeout).toEqual(300); + expect(lambda.Properties.Description).toEqual('veni vidi vici'); + + }); + + test('environment variables', () => { + // GIVEN + const stack = new Stack(); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + CdkCustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { + handler, + environment: { + B: 'b', + A: 'a', + }, + }); + + // THEN + const template = toCloudFormation(stack); + const lambda = template.Resources.CustomMyResourceTypeCustomResourceProviderHandler29FBDD2A; + expect(lambda.Properties.Environment).toEqual({ + Variables: expect.objectContaining({ + A: 'a', + B: 'b', + }), + }); + + }); + + test('roleArn', () => { + // GIVEN + const stack = new Stack(); + const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: TEST_HANDLER, + compatibleRuntimes: [STANDARD_PROVIDER], + }); + + // WHEN + const cr = CdkCustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { handler }); + + // THEN + expect(stack.resolve(cr.roleArn)).toEqual({ + 'Fn::GetAtt': [ + 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', + 'Arn', + ], + }); + + }); +}); \ No newline at end of file From fdaee2cf9cc9fe87a70eb16bbaf71fe782fdea5f Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 11:10:19 -0800 Subject: [PATCH 56/74] removed commented out code from edge function Signed-off-by: Francis --- .../aws-cloudfront/lib/experimental/edge-function.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index 1f9aac911033c..f209c6d311304 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -212,16 +212,6 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }], }); - // const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { - // codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'aws-cloudfront', 'edge-function'), - // runtime: CustomResourceProviderRuntime.NODEJS_18_X, - // policyStatements: [{ - // Effect: 'Allow', - // Resource: parameterArnPrefix, - // Action: ['ssm:GetParameter'], - // }], - // }); - const resource = new CustomResource(this, 'ArnReader', { resourceType: resourceType, serviceToken: serviceToken, From 0b463101f162d536b0bc2d5deb4fb6d36a229d4c Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 15:30:58 -0800 Subject: [PATCH 57/74] updated aws custom resource provider and reverted changes in integ tests Signed-off-by: Francis --- .../test/integ.global-replicas-provisioned.ts | 4 ++-- .../test/aws-dynamodb/test/integ.global.ts | 4 ++-- .../test/aws-ses/test/integ.receipt.ts | 4 ++-- .../lib/aws-custom-resource/aws-custom-resource.ts | 13 +++++++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts index f839ce0d1e925..06d76719f1a60 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts @@ -3,7 +3,7 @@ import * as cdk from 'aws-cdk-lib'; import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'dynamodb-global-replicas-provisioned'); +const stack = new cdk.Stack(app, 'aws-cdkdynamodb-global-replicas-provisioned'); const table = new dynamodb.Table(stack, 'Table', { partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING }, @@ -17,7 +17,7 @@ table.autoScaleWriteCapacity({ maxCapacity: 10, }).scaleOnUtilization({ targetUtilizationPercent: 75 }); -new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-integ', { +new IntegTest(app, 'aws-cdk-dynamodb-global-replicas-provisioned-test', { testCases: [stack], diffAssets: true, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts index fa88da0b48d07..56e69af775a69 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts @@ -30,9 +30,9 @@ class TestStack extends Stack { } const app = new App(); -const stack = new TestStack(app, 'cdk-dynamodb-global', { env: { region: 'eu-west-1' } }); +const stack = new TestStack(app, 'cdk-dynamodb-global-20191121', { env: { region: 'eu-west-1' } }); -new IntegTest(app, 'cdk-dynamodb-global-integ', { +new IntegTest(app, 'cdk-dynamodb-global-integ-20191121-test', { testCases: [stack], diffAssets: true, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts index a8eeb733ab36b..67fe056c31020 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.ts @@ -4,7 +4,7 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'AwsCdkSesReceipt'); +const stack = new cdk.Stack(app, 'aws-cdk-ses-receipt'); const ruleSet = new ses.ReceiptRuleSet(stack, 'RuleSet', { dropSpam: true, @@ -25,7 +25,7 @@ new ses.AllowListReceiptFilter(stack, 'Allowlist', { ], }); -new IntegTest(app, 'CdkSesReceiptInteg', { +new IntegTest(app, 'cdk-ses-receipt-integ', { testCases: [stack], diffAssets: true, }); diff --git a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index aae56b70556cc..0c14c939f2c66 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -7,6 +7,8 @@ import * as logs from '../../../aws-logs'; import * as cdk from '../../../core'; import { Annotations } from '../../../core'; import * as cxapi from '../../../cx-api'; +import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; +import { CdkSingletonFunction } from '../../../handler-framework/lib/cdk-singleton-function'; import { awsSdkToIamAction } from '../helpers-internal/sdk-info'; // Shared definition with packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/shared.ts @@ -446,10 +448,13 @@ export class AwsCustomResource extends Construct implements iam.IGrantable { this.props = props; - const provider = new lambda.SingletonFunction(this, 'Provider', { - code: lambda.Code.fromAsset(path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'custom-resources', 'aws-custom-resource-handler')), - runtime: lambda.Runtime.NODEJS_18_X, - handler: 'index.handler', + const handler = new CdkHandler(this, 'Handler', { + codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'custom-resources', 'aws-custom-resource-handler'), + compatibleRuntimes: [lambda.Runtime.NODEJS_LATEST], + }); + + const provider = new CdkSingletonFunction(this, 'Provider', { + handler, uuid: AwsCustomResource.PROVIDER_FUNCTION_UUID, lambdaPurpose: 'AWS', timeout: props.timeout || cdk.Duration.minutes(2), From cd27faca289a6c58f9db35da5a9369caad1a8eb9 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 15:50:44 -0800 Subject: [PATCH 58/74] global replicas provisioned snaps Signed-off-by: Francis --- .../index.js | 1 - .../index.d.ts | 3 + .../index.js | 73 +++++ ...b-global-replicas-provisioned.assets.json} | 18 +- ...global-replicas-provisioned.template.json} | 26 +- ...licaProvider99CDA21E.nested.template.json} | 22 +- ...faultTestDeployAssertE7F91F54.assets.json} | 2 +- ...ultTestDeployAssertE7F91F54.template.json} | 0 .../integ.json | 8 +- .../manifest.json | 112 ++++---- .../tree.json | 260 ++++++++++-------- 11 files changed, 308 insertions(+), 217 deletions(-) delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{dynamodb-global-replicas-provisioned.assets.json => aws-cdkdynamodb-global-replicas-provisioned.assets.json} (69%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{dynamodb-global-replicas-provisioned.template.json => aws-cdkdynamodb-global-replicas-provisioned.template.json} (81%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json => awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json} (93%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json => awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json} (84%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json => awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js deleted file mode 100644 index d991c8c6a6e37..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var m=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:!0})},b=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of d(s))!u.call(e,a)&&a!==t&&n(e,a,{get:()=>s[a],enumerable:!(o=R(s,a))||o.enumerable});return e};var T=e=>b(n({},"__esModule",{value:!0}),e);var y={};m(y,{isCompleteHandler:()=>g,onEventHandler:()=>C});module.exports=T(y);var c=require("@aws-sdk/client-dynamodb");async function C(e){console.log("Event: %j",{...e,ResponseURL:"..."});let s=new c.DynamoDB({}),t=e.ResourceProperties.TableName,o=e.ResourceProperties.Region,a;if(e.RequestType==="Create"||e.RequestType==="Delete")a=e.RequestType;else{let l=await s.describeTable({TableName:t});console.log("Describe table: %j",l),a=l.Table?.Replicas?.some(i=>i.RegionName===o)?void 0:"Create"}if(a){let l=await s.updateTable({TableName:t,ReplicaUpdates:[{[a]:{RegionName:o}}]});console.log("Update table: %j",l)}else console.log("Skipping updating Table, as a replica in '%s' already exists",o);return e.RequestType==="Create"||e.RequestType==="Update"?{PhysicalResourceId:`${t}-${o}`}:{}}async function g(e){console.log("Event: %j",{...e,ResponseURL:"..."});let t=await new c.DynamoDB({}).describeTable({TableName:e.ResourceProperties.TableName});console.log("Describe table: %j",t);let o=t.Table?.TableStatus==="ACTIVE",l=(t.Table?.Replicas??[]).find(r=>r.RegionName===e.ResourceProperties.Region),p=l?.ReplicaStatus==="ACTIVE",i=e.ResourceProperties.SkipReplicationCompletedWait==="true";switch(e.RequestType){case"Create":case"Update":return{IsComplete:o&&(p||i)};case"Delete":return{IsComplete:o&&l===void 0}}}0&&(module.exports={isCompleteHandler,onEventHandler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts new file mode 100644 index 0000000000000..8fe83665c0408 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts @@ -0,0 +1,3 @@ +import type { IsCompleteRequest, IsCompleteResponse, OnEventRequest, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; +export declare function onEventHandler(event: OnEventRequest): Promise; +export declare function isCompleteHandler(event: IsCompleteRequest): Promise; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js new file mode 100644 index 0000000000000..365490cccc06c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCompleteHandler = exports.onEventHandler = void 0; +/* eslint-disable no-console */ +const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); // eslint-disable-line import/no-extraneous-dependencies +async function onEventHandler(event) { + console.log('Event: %j', { ...event, ResponseURL: '...' }); + const dynamodb = new client_dynamodb_1.DynamoDB({}); + const tableName = event.ResourceProperties.TableName; + const region = event.ResourceProperties.Region; + let updateTableAction; + if (event.RequestType === 'Create' || event.RequestType === 'Delete') { + updateTableAction = event.RequestType; + } + else { // Update + // There are two cases where an Update can happen: + // 1. A table replacement. In that case, we need to create the replica in the new Table + // (the replica for the "old" Table will be deleted when CFN issues a Delete event on the old physical resource id). + // 2. A customer has changed one of the properties of the Custom Resource, + // like 'waitForReplicationToFinish'. In that case, we don't have to do anything. + // To differentiate the two cases, we make an API call to DynamoDB to check whether a replica already exists. + const describeTableResult = await dynamodb.describeTable({ + TableName: tableName, + }); + console.log('Describe table: %j', describeTableResult); + const replicaExists = describeTableResult.Table?.Replicas?.some(replica => replica.RegionName === region); + updateTableAction = replicaExists ? undefined : 'Create'; + } + if (updateTableAction) { + const data = await dynamodb.updateTable({ + TableName: tableName, + ReplicaUpdates: [ + { + [updateTableAction]: { + RegionName: region, + }, + }, + ], + }); + console.log('Update table: %j', data); + } + else { + console.log("Skipping updating Table, as a replica in '%s' already exists", region); + } + return event.RequestType === 'Create' || event.RequestType === 'Update' + ? { PhysicalResourceId: `${tableName}-${region}` } + : {}; +} +exports.onEventHandler = onEventHandler; +async function isCompleteHandler(event) { + console.log('Event: %j', { ...event, ResponseURL: '...' }); + const dynamodb = new client_dynamodb_1.DynamoDB({}); + const data = await dynamodb.describeTable({ + TableName: event.ResourceProperties.TableName, + }); + console.log('Describe table: %j', data); + const tableActive = data.Table?.TableStatus === 'ACTIVE'; + const replicas = data.Table?.Replicas ?? []; + const regionReplica = replicas.find(r => r.RegionName === event.ResourceProperties.Region); + const replicaActive = regionReplica?.ReplicaStatus === 'ACTIVE'; + const skipReplicationCompletedWait = event.ResourceProperties.SkipReplicationCompletedWait === 'true'; + switch (event.RequestType) { + case 'Create': + case 'Update': + // Complete when replica is reported as ACTIVE + return { IsComplete: tableActive && (replicaActive || skipReplicationCompletedWait) }; + case 'Delete': + // Complete when replica is gone + return { IsComplete: tableActive && regionReplica === undefined }; + } +} +exports.isCompleteHandler = isCompleteHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsOERBQW9ELENBQUMsd0RBQXdEO0FBR3RHLEtBQUssVUFBVSxjQUFjLENBQUMsS0FBcUI7SUFDeEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLEVBQUUsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztJQUUzRCxNQUFNLFFBQVEsR0FBRyxJQUFJLDBCQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7SUFFbEMsTUFBTSxTQUFTLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQztJQUNyRCxNQUFNLE1BQU0sR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDO0lBRS9DLElBQUksaUJBQTZELENBQUM7SUFDbEUsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNwRSxpQkFBaUIsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDO0tBQ3ZDO1NBQU0sRUFBRSxTQUFTO1FBQ2hCLGtEQUFrRDtRQUNsRCx1RkFBdUY7UUFDdkYsb0hBQW9IO1FBQ3BILDBFQUEwRTtRQUMxRSxpRkFBaUY7UUFDakYsNkdBQTZHO1FBQzdHLE1BQU0sbUJBQW1CLEdBQUcsTUFBTSxRQUFRLENBQUMsYUFBYSxDQUFDO1lBQ3ZELFNBQVMsRUFBRSxTQUFTO1NBQ3JCLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsbUJBQW1CLENBQUMsQ0FBQztRQUN2RCxNQUFNLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLE9BQU8sQ0FBQyxVQUFVLEtBQUssTUFBTSxDQUFDLENBQUM7UUFDMUcsaUJBQWlCLEdBQUcsYUFBYSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztLQUMxRDtJQUVELElBQUksaUJBQWlCLEVBQUU7UUFDckIsTUFBTSxJQUFJLEdBQUcsTUFBTSxRQUFRLENBQUMsV0FBVyxDQUFDO1lBQ3RDLFNBQVMsRUFBRSxTQUFTO1lBQ3BCLGNBQWMsRUFBRTtnQkFDZDtvQkFDRSxDQUFDLGlCQUFpQixDQUFDLEVBQUU7d0JBQ25CLFVBQVUsRUFBRSxNQUFNO3FCQUNuQjtpQkFDRjthQUNGO1NBQ0YsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUN2QztTQUFNO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyw4REFBOEQsRUFBRSxNQUFNLENBQUMsQ0FBQztLQUNyRjtJQUVELE9BQU8sS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLElBQUksS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRO1FBQ3JFLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLEdBQUcsU0FBUyxJQUFJLE1BQU0sRUFBRSxFQUFFO1FBQ2xELENBQUMsQ0FBQyxFQUFFLENBQUM7QUFDVCxDQUFDO0FBN0NELHdDQTZDQztBQUVNLEtBQUssVUFBVSxpQkFBaUIsQ0FBQyxLQUF3QjtJQUM5RCxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsS0FBSyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBRTNELE1BQU0sUUFBUSxHQUFHLElBQUksMEJBQVEsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUVsQyxNQUFNLElBQUksR0FBRyxNQUFNLFFBQVEsQ0FBQyxhQUFhLENBQUM7UUFDeEMsU0FBUyxFQUFFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxTQUFTO0tBQzlDLENBQUMsQ0FBQztJQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFFeEMsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFBRSxXQUFXLEtBQUssUUFBUSxDQUFDO0lBQ3pELE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQUUsUUFBUSxJQUFJLEVBQUUsQ0FBQztJQUM1QyxNQUFNLGFBQWEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsS0FBSyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDM0YsTUFBTSxhQUFhLEdBQUcsYUFBYSxFQUFFLGFBQWEsS0FBSyxRQUFRLENBQUM7SUFDaEUsTUFBTSw0QkFBNEIsR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsNEJBQTRCLEtBQUssTUFBTSxDQUFDO0lBRXRHLFFBQVEsS0FBSyxDQUFDLFdBQVcsRUFBRTtRQUN6QixLQUFLLFFBQVEsQ0FBQztRQUNkLEtBQUssUUFBUTtZQUNYLDhDQUE4QztZQUM5QyxPQUFPLEVBQUUsVUFBVSxFQUFFLFdBQVcsSUFBSSxDQUFDLGFBQWEsSUFBSSw0QkFBNEIsQ0FBQyxFQUFFLENBQUM7UUFDeEYsS0FBSyxRQUFRO1lBQ1gsZ0NBQWdDO1lBQ2hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsV0FBVyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUUsQ0FBQztLQUNyRTtBQUNILENBQUM7QUF6QkQsOENBeUJDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuaW1wb3J0IHsgRHluYW1vREIgfSBmcm9tICdAYXdzLXNkay9jbGllbnQtZHluYW1vZGInOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0IHR5cGUgeyBJc0NvbXBsZXRlUmVxdWVzdCwgSXNDb21wbGV0ZVJlc3BvbnNlLCBPbkV2ZW50UmVxdWVzdCwgT25FdmVudFJlc3BvbnNlIH0gZnJvbSAnLi4vLi4vLi4vY3VzdG9tLXJlc291cmNlcy9saWIvcHJvdmlkZXItZnJhbWV3b3JrL3R5cGVzJztcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIG9uRXZlbnRIYW5kbGVyKGV2ZW50OiBPbkV2ZW50UmVxdWVzdCk6IFByb21pc2U8T25FdmVudFJlc3BvbnNlPiB7XG4gIGNvbnNvbGUubG9nKCdFdmVudDogJWonLCB7IC4uLmV2ZW50LCBSZXNwb25zZVVSTDogJy4uLicgfSk7XG5cbiAgY29uc3QgZHluYW1vZGIgPSBuZXcgRHluYW1vREIoe30pO1xuXG4gIGNvbnN0IHRhYmxlTmFtZSA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5UYWJsZU5hbWU7XG4gIGNvbnN0IHJlZ2lvbiA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5SZWdpb247XG5cbiAgbGV0IHVwZGF0ZVRhYmxlQWN0aW9uOiAnQ3JlYXRlJyB8ICdVcGRhdGUnIHwgJ0RlbGV0ZScgfCB1bmRlZmluZWQ7XG4gIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0NyZWF0ZScgfHwgZXZlbnQuUmVxdWVzdFR5cGUgPT09ICdEZWxldGUnKSB7XG4gICAgdXBkYXRlVGFibGVBY3Rpb24gPSBldmVudC5SZXF1ZXN0VHlwZTtcbiAgfSBlbHNlIHsgLy8gVXBkYXRlXG4gICAgLy8gVGhlcmUgYXJlIHR3byBjYXNlcyB3aGVyZSBhbiBVcGRhdGUgY2FuIGhhcHBlbjpcbiAgICAvLyAxLiBBIHRhYmxlIHJlcGxhY2VtZW50LiBJbiB0aGF0IGNhc2UsIHdlIG5lZWQgdG8gY3JlYXRlIHRoZSByZXBsaWNhIGluIHRoZSBuZXcgVGFibGVcbiAgICAvLyAodGhlIHJlcGxpY2EgZm9yIHRoZSBcIm9sZFwiIFRhYmxlIHdpbGwgYmUgZGVsZXRlZCB3aGVuIENGTiBpc3N1ZXMgYSBEZWxldGUgZXZlbnQgb24gdGhlIG9sZCBwaHlzaWNhbCByZXNvdXJjZSBpZCkuXG4gICAgLy8gMi4gQSBjdXN0b21lciBoYXMgY2hhbmdlZCBvbmUgb2YgdGhlIHByb3BlcnRpZXMgb2YgdGhlIEN1c3RvbSBSZXNvdXJjZSxcbiAgICAvLyBsaWtlICd3YWl0Rm9yUmVwbGljYXRpb25Ub0ZpbmlzaCcuIEluIHRoYXQgY2FzZSwgd2UgZG9uJ3QgaGF2ZSB0byBkbyBhbnl0aGluZy5cbiAgICAvLyBUbyBkaWZmZXJlbnRpYXRlIHRoZSB0d28gY2FzZXMsIHdlIG1ha2UgYW4gQVBJIGNhbGwgdG8gRHluYW1vREIgdG8gY2hlY2sgd2hldGhlciBhIHJlcGxpY2EgYWxyZWFkeSBleGlzdHMuXG4gICAgY29uc3QgZGVzY3JpYmVUYWJsZVJlc3VsdCA9IGF3YWl0IGR5bmFtb2RiLmRlc2NyaWJlVGFibGUoe1xuICAgICAgVGFibGVOYW1lOiB0YWJsZU5hbWUsXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRlc2NyaWJlVGFibGVSZXN1bHQpO1xuICAgIGNvbnN0IHJlcGxpY2FFeGlzdHMgPSBkZXNjcmliZVRhYmxlUmVzdWx0LlRhYmxlPy5SZXBsaWNhcz8uc29tZShyZXBsaWNhID0+IHJlcGxpY2EuUmVnaW9uTmFtZSA9PT0gcmVnaW9uKTtcbiAgICB1cGRhdGVUYWJsZUFjdGlvbiA9IHJlcGxpY2FFeGlzdHMgPyB1bmRlZmluZWQgOiAnQ3JlYXRlJztcbiAgfVxuXG4gIGlmICh1cGRhdGVUYWJsZUFjdGlvbikge1xuICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBkeW5hbW9kYi51cGRhdGVUYWJsZSh7XG4gICAgICBUYWJsZU5hbWU6IHRhYmxlTmFtZSxcbiAgICAgIFJlcGxpY2FVcGRhdGVzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBbdXBkYXRlVGFibGVBY3Rpb25dOiB7XG4gICAgICAgICAgICBSZWdpb25OYW1lOiByZWdpb24sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ1VwZGF0ZSB0YWJsZTogJWonLCBkYXRhKTtcbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmxvZyhcIlNraXBwaW5nIHVwZGF0aW5nIFRhYmxlLCBhcyBhIHJlcGxpY2EgaW4gJyVzJyBhbHJlYWR5IGV4aXN0c1wiLCByZWdpb24pO1xuICB9XG5cbiAgcmV0dXJuIGV2ZW50LlJlcXVlc3RUeXBlID09PSAnQ3JlYXRlJyB8fCBldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ1VwZGF0ZSdcbiAgICA/IHsgUGh5c2ljYWxSZXNvdXJjZUlkOiBgJHt0YWJsZU5hbWV9LSR7cmVnaW9ufWAgfVxuICAgIDoge307XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpc0NvbXBsZXRlSGFuZGxlcihldmVudDogSXNDb21wbGV0ZVJlcXVlc3QpOiBQcm9taXNlPElzQ29tcGxldGVSZXNwb25zZT4ge1xuICBjb25zb2xlLmxvZygnRXZlbnQ6ICVqJywgeyAuLi5ldmVudCwgUmVzcG9uc2VVUkw6ICcuLi4nIH0pO1xuXG4gIGNvbnN0IGR5bmFtb2RiID0gbmV3IER5bmFtb0RCKHt9KTtcblxuICBjb25zdCBkYXRhID0gYXdhaXQgZHluYW1vZGIuZGVzY3JpYmVUYWJsZSh7XG4gICAgVGFibGVOYW1lOiBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVGFibGVOYW1lLFxuICB9KTtcbiAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRhdGEpO1xuXG4gIGNvbnN0IHRhYmxlQWN0aXZlID0gZGF0YS5UYWJsZT8uVGFibGVTdGF0dXMgPT09ICdBQ1RJVkUnO1xuICBjb25zdCByZXBsaWNhcyA9IGRhdGEuVGFibGU/LlJlcGxpY2FzID8/IFtdO1xuICBjb25zdCByZWdpb25SZXBsaWNhID0gcmVwbGljYXMuZmluZChyID0+IHIuUmVnaW9uTmFtZSA9PT0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlJlZ2lvbik7XG4gIGNvbnN0IHJlcGxpY2FBY3RpdmUgPSByZWdpb25SZXBsaWNhPy5SZXBsaWNhU3RhdHVzID09PSAnQUNUSVZFJztcbiAgY29uc3Qgc2tpcFJlcGxpY2F0aW9uQ29tcGxldGVkV2FpdCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5Ta2lwUmVwbGljYXRpb25Db21wbGV0ZWRXYWl0ID09PSAndHJ1ZSc7XG5cbiAgc3dpdGNoIChldmVudC5SZXF1ZXN0VHlwZSkge1xuICAgIGNhc2UgJ0NyZWF0ZSc6XG4gICAgY2FzZSAnVXBkYXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyByZXBvcnRlZCBhcyBBQ1RJVkVcbiAgICAgIHJldHVybiB7IElzQ29tcGxldGU6IHRhYmxlQWN0aXZlICYmIChyZXBsaWNhQWN0aXZlIHx8IHNraXBSZXBsaWNhdGlvbkNvbXBsZXRlZFdhaXQpIH07XG4gICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyBnb25lXG4gICAgICByZXR1cm4geyBJc0NvbXBsZXRlOiB0YWJsZUFjdGl2ZSAmJiByZWdpb25SZXBsaWNhID09PSB1bmRlZmluZWQgfTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json similarity index 69% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json index fe1b258110166..034a1641946db 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json @@ -1,15 +1,15 @@ { "version": "35.0.0", "files": { - "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4": { + "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4": { "source": { - "path": "asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4", + "path": "asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip", + "objectKey": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -27,28 +27,28 @@ } } }, - "7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe": { + "8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556": { "source": { - "path": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json", + "path": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json", + "objectKey": "8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6": { + "859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d": { "source": { - "path": "dynamodb-global-replicas-provisioned.template.json", + "path": "aws-cdkdynamodb-global-replicas-provisioned.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6.json", + "objectKey": "859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json similarity index 81% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json index ab6512c372206..45c27553634e7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodb-global-replicas-provisioned.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json @@ -26,7 +26,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16": { + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -103,13 +103,13 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" ] } ] } }, - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621": { + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" ] } ] @@ -160,7 +160,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" ] }, "TableName": { @@ -169,8 +169,8 @@ "Region": "us-east-2" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621", - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -184,7 +184,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" ] }, "TableName": { @@ -193,8 +193,8 @@ "Region": "eu-west-3" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621", - "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -254,7 +254,7 @@ "TableWriteScalingTargetTrackingD78DCCD8": { "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", "Properties": { - "PolicyName": "dynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking682B78E1", + "PolicyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking757FA9B6", "PolicyType": "TargetTrackingScaling", "ScalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -271,7 +271,7 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { "Ref": "TableCD117FA1" } }, @@ -291,7 +291,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json" + "/8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json similarity index 93% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json index c6913e737c5da..ab188ed6ba84f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider246E3869.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json @@ -82,7 +82,7 @@ }, ":table/", { - "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" } ] ] @@ -101,7 +101,7 @@ }, ":table/", { - "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" } ] ] @@ -126,7 +126,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "Handler": "index.onEventHandler", "Role": { @@ -181,7 +181,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "Handler": "index.isCompleteHandler", "Role": { @@ -306,7 +306,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -443,7 +443,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -577,7 +577,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -727,17 +727,17 @@ } }, "Outputs": { - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": { "Value": { "Ref": "OnEventHandlerServiceRole15A26729" } }, - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": { "Value": { "Ref": "IsCompleteHandlerServiceRole5810CC58" } }, - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -747,7 +747,7 @@ } }, "Parameters": { - "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json similarity index 84% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json index 533422b936105..d6eca1a978d83 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json @@ -3,7 +3,7 @@ "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json", + "path": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json index 9bf034aa1e140..b23a47a0e6f43 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json @@ -1,13 +1,13 @@ { "version": "35.0.0", "testCases": { - "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest": { + "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest": { "stacks": [ - "dynamodb-global-replicas-provisioned" + "aws-cdkdynamodb-global-replicas-provisioned" ], "diffAssets": true, - "assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert", - "assertionStackName": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D" + "assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json index e37dd97b75952..a7883d452a0dc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { "version": "35.0.0", "artifacts": { - "dynamodb-global-replicas-provisioned.assets": { + "aws-cdkdynamodb-global-replicas-provisioned.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "dynamodb-global-replicas-provisioned.assets.json", + "file": "aws-cdkdynamodb-global-replicas-provisioned.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "dynamodb-global-replicas-provisioned": { + "aws-cdkdynamodb-global-replicas-provisioned": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "dynamodb-global-replicas-provisioned.template.json", + "templateFile": "aws-cdkdynamodb-global-replicas-provisioned.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9707af873d173a5cf7b1ee3a394ee314a4d2f11bcc53f9e39a37d732ba3a51d6.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "dynamodb-global-replicas-provisioned.assets" + "aws-cdkdynamodb-global-replicas-provisioned.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,223 +31,223 @@ } }, "dependencies": [ - "dynamodb-global-replicas-provisioned.assets" + "aws-cdkdynamodb-global-replicas-provisioned.assets" ], "metadata": { - "/dynamodb-global-replicas-provisioned/Table/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableCD117FA1" } ], - "/dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D9C475F16" + "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5" } ], - "/dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicydynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD9869B95621" + "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53" } ], - "/dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicauseast28A15C236" } ], - "/dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualsuseast2D20A1E77" } ], - "/dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeuwest314C3E552" } ], - "/dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualseuwest302B3591C" } ], - "/dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetE5669214" } ], - "/dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetTrackingD78DCCD8" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRoleDefaultPolicyC57085D4" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": [ { "type": "aws:cdk:logicalId", - "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": [ { "type": "aws:cdk:logicalId", - "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": [ { "type": "aws:cdk:logicalId", - "data": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" + "data": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" } ], - "/dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ + "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D" } ], - "/dynamodb-global-replicas-provisioned/BootstrapVersion": [ + "/aws-cdkdynamodb-global-replicas-provisioned/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/dynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ + "/aws-cdkdynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "dynamodb-global-replicas-provisioned" + "displayName": "aws-cdkdynamodb-global-replicas-provisioned" }, - "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets": { + "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets.json", + "file": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D": { + "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.template.json", + "templateFile": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -256,7 +256,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets" + "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -265,23 +265,23 @@ } }, "dependencies": [ - "awscdkdynamodbglobalreplicasprovisionedintegDefaultTestDeployAssertEF84B38D.assets" + "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets" ], "metadata": { - "/aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert" + "displayName": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json index 8c7894199ce30..e0c0cd34bd2fc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "dynamodb-global-replicas-provisioned": { - "id": "dynamodb-global-replicas-provisioned", - "path": "dynamodb-global-replicas-provisioned", + "aws-cdkdynamodb-global-replicas-provisioned": { + "id": "aws-cdkdynamodb-global-replicas-provisioned", + "path": "aws-cdkdynamodb-global-replicas-provisioned", "children": { "Table": { "id": "Table", - "path": "dynamodb-global-replicas-provisioned/Table", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -46,23 +46,23 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "dynamodb-global-replicas-provisioned/Table/ScalingRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, - "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D": { - "id": "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D", + "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A": { + "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/ImportedResource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -70,7 +70,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleDA9F503D/Resource/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" ] } ] @@ -171,17 +171,17 @@ "version": "10.3.0" } }, - "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98": { - "id": "SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98", + "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540": { + "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/ImportedResource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -189,7 +189,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole82B5DD98/Resource/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -229,7 +229,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" ] } ] @@ -254,11 +254,11 @@ }, "Replicaus-east-2": { "id": "Replicaus-east-2", - "path": "dynamodb-global-replicas-provisioned/Table/Replicaus-east-2", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2", "children": { "Default": { "id": "Default", - "path": "dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -272,7 +272,7 @@ }, "StackRegionNotEqualsus-east-2": { "id": "StackRegionNotEqualsus-east-2", - "path": "dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -280,11 +280,11 @@ }, "Replicaeu-west-3": { "id": "Replicaeu-west-3", - "path": "dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", "children": { "Default": { "id": "Default", - "path": "dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -298,7 +298,7 @@ }, "StackRegionNotEqualseu-west-3": { "id": "StackRegionNotEqualseu-west-3", - "path": "dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -306,15 +306,15 @@ }, "WriteScaling": { "id": "WriteScaling", - "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling", "children": { "Target": { "id": "Target", - "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", "aws:cdk:cloudformation:props": { @@ -358,15 +358,15 @@ }, "Tracking": { "id": "Tracking", - "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", "aws:cdk:cloudformation:props": { - "policyName": "dynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking682B78E1", + "policyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking757FA9B6", "policyType": "TargetTrackingScaling", "scalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -410,19 +410,35 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { + "OnEvent": { + "id": "OnEvent", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEvent", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "OnComplete": { + "id": "OnComplete", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnComplete", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, "OnEventHandler": { "id": "OnEventHandler", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -430,7 +446,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -469,11 +485,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -525,7 +541,7 @@ }, ":table/", { - "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" } ] ] @@ -544,7 +560,7 @@ }, ":table/", { - "Ref": "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" } ] ] @@ -581,11 +597,11 @@ }, "Code": { "id": "Code", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -593,7 +609,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -607,7 +623,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -615,7 +631,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "handler": "index.onEventHandler", "role": { @@ -641,15 +657,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -657,7 +673,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -702,11 +718,11 @@ }, "Code": { "id": "Code", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -714,7 +730,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -728,7 +744,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -736,7 +752,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "handler": "index.isCompleteHandler", "role": { @@ -762,19 +778,19 @@ }, "Provider": { "id": "Provider", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -782,7 +798,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -821,11 +837,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -914,11 +930,11 @@ }, "Code": { "id": "Code", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -926,7 +942,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -940,7 +956,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -950,7 +966,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onEvent (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -994,15 +1010,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1010,7 +1026,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1049,11 +1065,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1135,11 +1151,11 @@ }, "Code": { "id": "Code", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1147,7 +1163,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1161,7 +1177,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1171,7 +1187,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - isComplete (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1212,15 +1228,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1228,7 +1244,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1267,11 +1283,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1353,11 +1369,11 @@ }, "Code": { "id": "Code", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1365,7 +1381,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1379,7 +1395,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1389,7 +1405,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1430,15 +1446,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1446,7 +1462,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1471,11 +1487,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1557,7 +1573,7 @@ }, "Resource": { "id": "Resource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1575,33 +1591,33 @@ "version": "0.0.0" } }, - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref": { - "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD0261788Ref", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref": { - "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleDB297932Ref", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn": { - "id": "dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/dynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEvent26039801Arn", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef": { - "id": "reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-dynamodbglobalreplicasprovisionedTable9DA4055ARef", + "reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { + "id": "reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1615,16 +1631,16 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", "children": { "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", - "path": "dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", + "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetodynamodbglobalreplicasprovisionedTable9DA4055ARef": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { "Ref": "TableCD117FA1" } }, @@ -1644,7 +1660,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/7a7a2d86b7169f9048cc5d44abd020f16bef82b092d0199d9601115c5df80abe.json" + "/8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json" ] ] } @@ -1663,7 +1679,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "dynamodb-global-replicas-provisioned/BootstrapVersion", + "path": "aws-cdkdynamodb-global-replicas-provisioned/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1671,7 +1687,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "dynamodb-global-replicas-provisioned/CheckBootstrapVersion", + "path": "aws-cdkdynamodb-global-replicas-provisioned/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1683,17 +1699,17 @@ "version": "0.0.0" } }, - "aws-cdk-dynamodb-global-replicas-provisioned-integ": { - "id": "aws-cdk-dynamodb-global-replicas-provisioned-integ", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ", + "aws-cdk-dynamodb-global-replicas-provisioned-test": { + "id": "aws-cdk-dynamodb-global-replicas-provisioned-test", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/Default", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.3.0" @@ -1701,11 +1717,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1713,7 +1729,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdk-dynamodb-global-replicas-provisioned-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" From 4be3621781f096e3019dfd107a3f6952da30f10e Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 15:51:29 -0800 Subject: [PATCH 59/74] global snapsw Signed-off-by: Francis --- .../index.js | 1 - .../index.d.ts | 3 + .../index.js | 73 ++++++ ... cdk-dynamodb-global-20191121.assets.json} | 18 +- ...dk-dynamodb-global-20191121.template.json} | 24 +- ...licaProviderB281C954.nested.template.json} | 22 +- ...faultTestDeployAssert97799095.assets.json} | 2 +- ...ultTestDeployAssert97799095.template.json} | 0 .../test/integ.global.js.snapshot/integ.json | 8 +- .../integ.global.js.snapshot/manifest.json | 104 ++++---- .../test/integ.global.js.snapshot/tree.json | 244 ++++++++++-------- 11 files changed, 295 insertions(+), 204 deletions(-) delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdk-dynamodb-global.assets.json => cdk-dynamodb-global-20191121.assets.json} (71%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdk-dynamodb-global.template.json => cdk-dynamodb-global-20191121.template.json} (79%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json => cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json} (94%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json => cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json} (86%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json => cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js deleted file mode 100644 index d991c8c6a6e37..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var m=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:!0})},b=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of d(s))!u.call(e,a)&&a!==t&&n(e,a,{get:()=>s[a],enumerable:!(o=R(s,a))||o.enumerable});return e};var T=e=>b(n({},"__esModule",{value:!0}),e);var y={};m(y,{isCompleteHandler:()=>g,onEventHandler:()=>C});module.exports=T(y);var c=require("@aws-sdk/client-dynamodb");async function C(e){console.log("Event: %j",{...e,ResponseURL:"..."});let s=new c.DynamoDB({}),t=e.ResourceProperties.TableName,o=e.ResourceProperties.Region,a;if(e.RequestType==="Create"||e.RequestType==="Delete")a=e.RequestType;else{let l=await s.describeTable({TableName:t});console.log("Describe table: %j",l),a=l.Table?.Replicas?.some(i=>i.RegionName===o)?void 0:"Create"}if(a){let l=await s.updateTable({TableName:t,ReplicaUpdates:[{[a]:{RegionName:o}}]});console.log("Update table: %j",l)}else console.log("Skipping updating Table, as a replica in '%s' already exists",o);return e.RequestType==="Create"||e.RequestType==="Update"?{PhysicalResourceId:`${t}-${o}`}:{}}async function g(e){console.log("Event: %j",{...e,ResponseURL:"..."});let t=await new c.DynamoDB({}).describeTable({TableName:e.ResourceProperties.TableName});console.log("Describe table: %j",t);let o=t.Table?.TableStatus==="ACTIVE",l=(t.Table?.Replicas??[]).find(r=>r.RegionName===e.ResourceProperties.Region),p=l?.ReplicaStatus==="ACTIVE",i=e.ResourceProperties.SkipReplicationCompletedWait==="true";switch(e.RequestType){case"Create":case"Update":return{IsComplete:o&&(p||i)};case"Delete":return{IsComplete:o&&l===void 0}}}0&&(module.exports={isCompleteHandler,onEventHandler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts new file mode 100644 index 0000000000000..8fe83665c0408 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts @@ -0,0 +1,3 @@ +import type { IsCompleteRequest, IsCompleteResponse, OnEventRequest, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; +export declare function onEventHandler(event: OnEventRequest): Promise; +export declare function isCompleteHandler(event: IsCompleteRequest): Promise; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js new file mode 100644 index 0000000000000..365490cccc06c --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCompleteHandler = exports.onEventHandler = void 0; +/* eslint-disable no-console */ +const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); // eslint-disable-line import/no-extraneous-dependencies +async function onEventHandler(event) { + console.log('Event: %j', { ...event, ResponseURL: '...' }); + const dynamodb = new client_dynamodb_1.DynamoDB({}); + const tableName = event.ResourceProperties.TableName; + const region = event.ResourceProperties.Region; + let updateTableAction; + if (event.RequestType === 'Create' || event.RequestType === 'Delete') { + updateTableAction = event.RequestType; + } + else { // Update + // There are two cases where an Update can happen: + // 1. A table replacement. In that case, we need to create the replica in the new Table + // (the replica for the "old" Table will be deleted when CFN issues a Delete event on the old physical resource id). + // 2. A customer has changed one of the properties of the Custom Resource, + // like 'waitForReplicationToFinish'. In that case, we don't have to do anything. + // To differentiate the two cases, we make an API call to DynamoDB to check whether a replica already exists. + const describeTableResult = await dynamodb.describeTable({ + TableName: tableName, + }); + console.log('Describe table: %j', describeTableResult); + const replicaExists = describeTableResult.Table?.Replicas?.some(replica => replica.RegionName === region); + updateTableAction = replicaExists ? undefined : 'Create'; + } + if (updateTableAction) { + const data = await dynamodb.updateTable({ + TableName: tableName, + ReplicaUpdates: [ + { + [updateTableAction]: { + RegionName: region, + }, + }, + ], + }); + console.log('Update table: %j', data); + } + else { + console.log("Skipping updating Table, as a replica in '%s' already exists", region); + } + return event.RequestType === 'Create' || event.RequestType === 'Update' + ? { PhysicalResourceId: `${tableName}-${region}` } + : {}; +} +exports.onEventHandler = onEventHandler; +async function isCompleteHandler(event) { + console.log('Event: %j', { ...event, ResponseURL: '...' }); + const dynamodb = new client_dynamodb_1.DynamoDB({}); + const data = await dynamodb.describeTable({ + TableName: event.ResourceProperties.TableName, + }); + console.log('Describe table: %j', data); + const tableActive = data.Table?.TableStatus === 'ACTIVE'; + const replicas = data.Table?.Replicas ?? []; + const regionReplica = replicas.find(r => r.RegionName === event.ResourceProperties.Region); + const replicaActive = regionReplica?.ReplicaStatus === 'ACTIVE'; + const skipReplicationCompletedWait = event.ResourceProperties.SkipReplicationCompletedWait === 'true'; + switch (event.RequestType) { + case 'Create': + case 'Update': + // Complete when replica is reported as ACTIVE + return { IsComplete: tableActive && (replicaActive || skipReplicationCompletedWait) }; + case 'Delete': + // Complete when replica is gone + return { IsComplete: tableActive && regionReplica === undefined }; + } +} +exports.isCompleteHandler = isCompleteHandler; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsOERBQW9ELENBQUMsd0RBQXdEO0FBR3RHLEtBQUssVUFBVSxjQUFjLENBQUMsS0FBcUI7SUFDeEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLEVBQUUsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztJQUUzRCxNQUFNLFFBQVEsR0FBRyxJQUFJLDBCQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7SUFFbEMsTUFBTSxTQUFTLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQztJQUNyRCxNQUFNLE1BQU0sR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDO0lBRS9DLElBQUksaUJBQTZELENBQUM7SUFDbEUsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNwRSxpQkFBaUIsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDO0tBQ3ZDO1NBQU0sRUFBRSxTQUFTO1FBQ2hCLGtEQUFrRDtRQUNsRCx1RkFBdUY7UUFDdkYsb0hBQW9IO1FBQ3BILDBFQUEwRTtRQUMxRSxpRkFBaUY7UUFDakYsNkdBQTZHO1FBQzdHLE1BQU0sbUJBQW1CLEdBQUcsTUFBTSxRQUFRLENBQUMsYUFBYSxDQUFDO1lBQ3ZELFNBQVMsRUFBRSxTQUFTO1NBQ3JCLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsbUJBQW1CLENBQUMsQ0FBQztRQUN2RCxNQUFNLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLE9BQU8sQ0FBQyxVQUFVLEtBQUssTUFBTSxDQUFDLENBQUM7UUFDMUcsaUJBQWlCLEdBQUcsYUFBYSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztLQUMxRDtJQUVELElBQUksaUJBQWlCLEVBQUU7UUFDckIsTUFBTSxJQUFJLEdBQUcsTUFBTSxRQUFRLENBQUMsV0FBVyxDQUFDO1lBQ3RDLFNBQVMsRUFBRSxTQUFTO1lBQ3BCLGNBQWMsRUFBRTtnQkFDZDtvQkFDRSxDQUFDLGlCQUFpQixDQUFDLEVBQUU7d0JBQ25CLFVBQVUsRUFBRSxNQUFNO3FCQUNuQjtpQkFDRjthQUNGO1NBQ0YsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUN2QztTQUFNO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyw4REFBOEQsRUFBRSxNQUFNLENBQUMsQ0FBQztLQUNyRjtJQUVELE9BQU8sS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLElBQUksS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRO1FBQ3JFLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLEdBQUcsU0FBUyxJQUFJLE1BQU0sRUFBRSxFQUFFO1FBQ2xELENBQUMsQ0FBQyxFQUFFLENBQUM7QUFDVCxDQUFDO0FBN0NELHdDQTZDQztBQUVNLEtBQUssVUFBVSxpQkFBaUIsQ0FBQyxLQUF3QjtJQUM5RCxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsS0FBSyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBRTNELE1BQU0sUUFBUSxHQUFHLElBQUksMEJBQVEsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUVsQyxNQUFNLElBQUksR0FBRyxNQUFNLFFBQVEsQ0FBQyxhQUFhLENBQUM7UUFDeEMsU0FBUyxFQUFFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxTQUFTO0tBQzlDLENBQUMsQ0FBQztJQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFFeEMsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFBRSxXQUFXLEtBQUssUUFBUSxDQUFDO0lBQ3pELE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQUUsUUFBUSxJQUFJLEVBQUUsQ0FBQztJQUM1QyxNQUFNLGFBQWEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsS0FBSyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDM0YsTUFBTSxhQUFhLEdBQUcsYUFBYSxFQUFFLGFBQWEsS0FBSyxRQUFRLENBQUM7SUFDaEUsTUFBTSw0QkFBNEIsR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsNEJBQTRCLEtBQUssTUFBTSxDQUFDO0lBRXRHLFFBQVEsS0FBSyxDQUFDLFdBQVcsRUFBRTtRQUN6QixLQUFLLFFBQVEsQ0FBQztRQUNkLEtBQUssUUFBUTtZQUNYLDhDQUE4QztZQUM5QyxPQUFPLEVBQUUsVUFBVSxFQUFFLFdBQVcsSUFBSSxDQUFDLGFBQWEsSUFBSSw0QkFBNEIsQ0FBQyxFQUFFLENBQUM7UUFDeEYsS0FBSyxRQUFRO1lBQ1gsZ0NBQWdDO1lBQ2hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsV0FBVyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUUsQ0FBQztLQUNyRTtBQUNILENBQUM7QUF6QkQsOENBeUJDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuaW1wb3J0IHsgRHluYW1vREIgfSBmcm9tICdAYXdzLXNkay9jbGllbnQtZHluYW1vZGInOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0IHR5cGUgeyBJc0NvbXBsZXRlUmVxdWVzdCwgSXNDb21wbGV0ZVJlc3BvbnNlLCBPbkV2ZW50UmVxdWVzdCwgT25FdmVudFJlc3BvbnNlIH0gZnJvbSAnLi4vLi4vLi4vY3VzdG9tLXJlc291cmNlcy9saWIvcHJvdmlkZXItZnJhbWV3b3JrL3R5cGVzJztcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIG9uRXZlbnRIYW5kbGVyKGV2ZW50OiBPbkV2ZW50UmVxdWVzdCk6IFByb21pc2U8T25FdmVudFJlc3BvbnNlPiB7XG4gIGNvbnNvbGUubG9nKCdFdmVudDogJWonLCB7IC4uLmV2ZW50LCBSZXNwb25zZVVSTDogJy4uLicgfSk7XG5cbiAgY29uc3QgZHluYW1vZGIgPSBuZXcgRHluYW1vREIoe30pO1xuXG4gIGNvbnN0IHRhYmxlTmFtZSA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5UYWJsZU5hbWU7XG4gIGNvbnN0IHJlZ2lvbiA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5SZWdpb247XG5cbiAgbGV0IHVwZGF0ZVRhYmxlQWN0aW9uOiAnQ3JlYXRlJyB8ICdVcGRhdGUnIHwgJ0RlbGV0ZScgfCB1bmRlZmluZWQ7XG4gIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0NyZWF0ZScgfHwgZXZlbnQuUmVxdWVzdFR5cGUgPT09ICdEZWxldGUnKSB7XG4gICAgdXBkYXRlVGFibGVBY3Rpb24gPSBldmVudC5SZXF1ZXN0VHlwZTtcbiAgfSBlbHNlIHsgLy8gVXBkYXRlXG4gICAgLy8gVGhlcmUgYXJlIHR3byBjYXNlcyB3aGVyZSBhbiBVcGRhdGUgY2FuIGhhcHBlbjpcbiAgICAvLyAxLiBBIHRhYmxlIHJlcGxhY2VtZW50LiBJbiB0aGF0IGNhc2UsIHdlIG5lZWQgdG8gY3JlYXRlIHRoZSByZXBsaWNhIGluIHRoZSBuZXcgVGFibGVcbiAgICAvLyAodGhlIHJlcGxpY2EgZm9yIHRoZSBcIm9sZFwiIFRhYmxlIHdpbGwgYmUgZGVsZXRlZCB3aGVuIENGTiBpc3N1ZXMgYSBEZWxldGUgZXZlbnQgb24gdGhlIG9sZCBwaHlzaWNhbCByZXNvdXJjZSBpZCkuXG4gICAgLy8gMi4gQSBjdXN0b21lciBoYXMgY2hhbmdlZCBvbmUgb2YgdGhlIHByb3BlcnRpZXMgb2YgdGhlIEN1c3RvbSBSZXNvdXJjZSxcbiAgICAvLyBsaWtlICd3YWl0Rm9yUmVwbGljYXRpb25Ub0ZpbmlzaCcuIEluIHRoYXQgY2FzZSwgd2UgZG9uJ3QgaGF2ZSB0byBkbyBhbnl0aGluZy5cbiAgICAvLyBUbyBkaWZmZXJlbnRpYXRlIHRoZSB0d28gY2FzZXMsIHdlIG1ha2UgYW4gQVBJIGNhbGwgdG8gRHluYW1vREIgdG8gY2hlY2sgd2hldGhlciBhIHJlcGxpY2EgYWxyZWFkeSBleGlzdHMuXG4gICAgY29uc3QgZGVzY3JpYmVUYWJsZVJlc3VsdCA9IGF3YWl0IGR5bmFtb2RiLmRlc2NyaWJlVGFibGUoe1xuICAgICAgVGFibGVOYW1lOiB0YWJsZU5hbWUsXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRlc2NyaWJlVGFibGVSZXN1bHQpO1xuICAgIGNvbnN0IHJlcGxpY2FFeGlzdHMgPSBkZXNjcmliZVRhYmxlUmVzdWx0LlRhYmxlPy5SZXBsaWNhcz8uc29tZShyZXBsaWNhID0+IHJlcGxpY2EuUmVnaW9uTmFtZSA9PT0gcmVnaW9uKTtcbiAgICB1cGRhdGVUYWJsZUFjdGlvbiA9IHJlcGxpY2FFeGlzdHMgPyB1bmRlZmluZWQgOiAnQ3JlYXRlJztcbiAgfVxuXG4gIGlmICh1cGRhdGVUYWJsZUFjdGlvbikge1xuICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBkeW5hbW9kYi51cGRhdGVUYWJsZSh7XG4gICAgICBUYWJsZU5hbWU6IHRhYmxlTmFtZSxcbiAgICAgIFJlcGxpY2FVcGRhdGVzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBbdXBkYXRlVGFibGVBY3Rpb25dOiB7XG4gICAgICAgICAgICBSZWdpb25OYW1lOiByZWdpb24sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ1VwZGF0ZSB0YWJsZTogJWonLCBkYXRhKTtcbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmxvZyhcIlNraXBwaW5nIHVwZGF0aW5nIFRhYmxlLCBhcyBhIHJlcGxpY2EgaW4gJyVzJyBhbHJlYWR5IGV4aXN0c1wiLCByZWdpb24pO1xuICB9XG5cbiAgcmV0dXJuIGV2ZW50LlJlcXVlc3RUeXBlID09PSAnQ3JlYXRlJyB8fCBldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ1VwZGF0ZSdcbiAgICA/IHsgUGh5c2ljYWxSZXNvdXJjZUlkOiBgJHt0YWJsZU5hbWV9LSR7cmVnaW9ufWAgfVxuICAgIDoge307XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpc0NvbXBsZXRlSGFuZGxlcihldmVudDogSXNDb21wbGV0ZVJlcXVlc3QpOiBQcm9taXNlPElzQ29tcGxldGVSZXNwb25zZT4ge1xuICBjb25zb2xlLmxvZygnRXZlbnQ6ICVqJywgeyAuLi5ldmVudCwgUmVzcG9uc2VVUkw6ICcuLi4nIH0pO1xuXG4gIGNvbnN0IGR5bmFtb2RiID0gbmV3IER5bmFtb0RCKHt9KTtcblxuICBjb25zdCBkYXRhID0gYXdhaXQgZHluYW1vZGIuZGVzY3JpYmVUYWJsZSh7XG4gICAgVGFibGVOYW1lOiBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVGFibGVOYW1lLFxuICB9KTtcbiAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRhdGEpO1xuXG4gIGNvbnN0IHRhYmxlQWN0aXZlID0gZGF0YS5UYWJsZT8uVGFibGVTdGF0dXMgPT09ICdBQ1RJVkUnO1xuICBjb25zdCByZXBsaWNhcyA9IGRhdGEuVGFibGU/LlJlcGxpY2FzID8/IFtdO1xuICBjb25zdCByZWdpb25SZXBsaWNhID0gcmVwbGljYXMuZmluZChyID0+IHIuUmVnaW9uTmFtZSA9PT0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlJlZ2lvbik7XG4gIGNvbnN0IHJlcGxpY2FBY3RpdmUgPSByZWdpb25SZXBsaWNhPy5SZXBsaWNhU3RhdHVzID09PSAnQUNUSVZFJztcbiAgY29uc3Qgc2tpcFJlcGxpY2F0aW9uQ29tcGxldGVkV2FpdCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5Ta2lwUmVwbGljYXRpb25Db21wbGV0ZWRXYWl0ID09PSAndHJ1ZSc7XG5cbiAgc3dpdGNoIChldmVudC5SZXF1ZXN0VHlwZSkge1xuICAgIGNhc2UgJ0NyZWF0ZSc6XG4gICAgY2FzZSAnVXBkYXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyByZXBvcnRlZCBhcyBBQ1RJVkVcbiAgICAgIHJldHVybiB7IElzQ29tcGxldGU6IHRhYmxlQWN0aXZlICYmIChyZXBsaWNhQWN0aXZlIHx8IHNraXBSZXBsaWNhdGlvbkNvbXBsZXRlZFdhaXQpIH07XG4gICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyBnb25lXG4gICAgICByZXR1cm4geyBJc0NvbXBsZXRlOiB0YWJsZUFjdGl2ZSAmJiByZWdpb25SZXBsaWNhID09PSB1bmRlZmluZWQgfTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json similarity index 71% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json index 1266e0d0328bf..7fe4fc76e7562 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json @@ -1,15 +1,15 @@ { "version": "35.0.0", "files": { - "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4": { + "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4": { "source": { - "path": "asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4", + "path": "asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4", "packaging": "zip" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip", + "objectKey": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } @@ -29,29 +29,29 @@ } } }, - "3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc": { + "f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192": { "source": { - "path": "cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json", + "path": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json", "packaging": "file" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json", + "objectKey": "f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } } }, - "4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59": { + "3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527": { "source": { - "path": "cdk-dynamodb-global.template.json", + "path": "cdk-dynamodb-global-20191121.template.json", "packaging": "file" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59.json", + "objectKey": "3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json similarity index 79% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json index 90ff9547cf7bb..9c253ad1fd50e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json @@ -41,7 +41,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167": { + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -121,13 +121,13 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" ] } ] } }, - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D": { + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -177,7 +177,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" ] } ] @@ -189,7 +189,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" ] }, "TableName": { @@ -198,8 +198,8 @@ "Region": "eu-west-2" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880", + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -210,7 +210,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" ] }, "TableName": { @@ -220,8 +220,8 @@ }, "DependsOn": [ "TableReplicaeuwest290D3CD3A", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D", - "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880", + "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -230,7 +230,7 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetocdkdynamodbglobalTableF3B61EA4Ref": { + "referencetocdkdynamodbglobal20191121TableB640876BRef": { "Ref": "TableCD117FA1" } }, @@ -246,7 +246,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json" + "/f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json similarity index 94% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json index d2ae53cf1da76..db87d67192434 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalawscdkawsdynamodbReplicaProvider9479F505.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json @@ -78,7 +78,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" + "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" } ] ] @@ -97,7 +97,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" + "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" } ] ] @@ -122,7 +122,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "Handler": "index.onEventHandler", "Role": { @@ -177,7 +177,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "Handler": "index.isCompleteHandler", "Role": { @@ -302,7 +302,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -439,7 +439,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -573,7 +573,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -723,17 +723,17 @@ } }, "Outputs": { - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": { + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": { "Value": { "Ref": "OnEventHandlerServiceRole15A26729" } }, - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": { + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": { "Value": { "Ref": "IsCompleteHandlerServiceRole5810CC58" } }, - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": { + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -743,7 +743,7 @@ } }, "Parameters": { - "referencetocdkdynamodbglobalTableF3B61EA4Ref": { + "referencetocdkdynamodbglobal20191121TableB640876BRef": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json similarity index 86% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json index 3cfc6420547a9..37640dd523403 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json @@ -3,7 +3,7 @@ "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json", + "path": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json index 0086428143d1a..974a1052ddaaf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json @@ -1,13 +1,13 @@ { "version": "35.0.0", "testCases": { - "cdk-dynamodb-global-integ/DefaultTest": { + "cdk-dynamodb-global-integ-20191121-test/DefaultTest": { "stacks": [ - "cdk-dynamodb-global" + "cdk-dynamodb-global-20191121" ], "diffAssets": true, - "assertionStack": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert", - "assertionStackName": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3" + "assertionStack": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert", + "assertionStackName": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json index 03392e3e27290..a88bfda80a5c6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { "version": "35.0.0", "artifacts": { - "cdk-dynamodb-global.assets": { + "cdk-dynamodb-global-20191121.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdk-dynamodb-global.assets.json", + "file": "cdk-dynamodb-global-20191121.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdk-dynamodb-global": { + "cdk-dynamodb-global-20191121": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/eu-west-1", "properties": { - "templateFile": "cdk-dynamodb-global.template.json", + "templateFile": "cdk-dynamodb-global-20191121.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-eu-west-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-eu-west-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/4470154548bebc1f2c6c9f5dc2be832d4fea32a9cae2571831bfc85addf53b59.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdk-dynamodb-global.assets" + "cdk-dynamodb-global-20191121.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-eu-west-1", @@ -31,199 +31,199 @@ } }, "dependencies": [ - "cdk-dynamodb-global.assets" + "cdk-dynamodb-global-20191121.assets" ], "metadata": { - "/cdk-dynamodb-global/Table/Resource": [ + "/cdk-dynamodb-global-20191121/Table/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableCD117FA1" } ], - "/cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/Resource": [ + "/cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F92C5A167" + "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A23250B4C" } ], - "/cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/Resource": [ + "/cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B348DC1641D" + "data": "TableSourceTableAttachedManagedPolicycdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole3971612857304880" } ], - "/cdk-dynamodb-global/Table/Replicaeu-west-2/Default": [ + "/cdk-dynamodb-global-20191121/Table/Replicaeu-west-2/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeuwest290D3CD3A" } ], - "/cdk-dynamodb-global/Table/Replicaeu-central-1/Default": [ + "/cdk-dynamodb-global-20191121/Table/Replicaeu-central-1/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeucentral100A6A6E0" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRoleDefaultPolicyC57085D4" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" + "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" + "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": [ { "type": "aws:cdk:logicalId", - "data": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn" + "data": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobalTableF3B61EA4Ref": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobal20191121TableB640876BRef": [ { "type": "aws:cdk:logicalId", - "data": "referencetocdkdynamodbglobalTableF3B61EA4Ref" + "data": "referencetocdkdynamodbglobal20191121TableB640876BRef" } ], - "/cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ + "/cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D" } ], - "/cdk-dynamodb-global/BootstrapVersion": [ + "/cdk-dynamodb-global-20191121/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-dynamodb-global/CheckBootstrapVersion": [ + "/cdk-dynamodb-global-20191121/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-dynamodb-global" + "displayName": "cdk-dynamodb-global-20191121" }, - "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets": { + "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets.json", + "file": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3": { + "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.template.json", + "templateFile": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -232,7 +232,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets" + "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -241,23 +241,23 @@ } }, "dependencies": [ - "cdkdynamodbglobalintegDefaultTestDeployAssert31B551A3.assets" + "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets" ], "metadata": { - "/cdk-dynamodb-global-integ/DefaultTest/DeployAssert/BootstrapVersion": [ + "/cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-dynamodb-global-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert" + "displayName": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json index 24a956c1acc9c..990825c782a01 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "cdk-dynamodb-global": { - "id": "cdk-dynamodb-global", - "path": "cdk-dynamodb-global", + "cdk-dynamodb-global-20191121": { + "id": "cdk-dynamodb-global-20191121", + "path": "cdk-dynamodb-global-20191121", "children": { "Table": { "id": "Table", - "path": "cdk-dynamodb-global/Table", + "path": "cdk-dynamodb-global-20191121/Table", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/Table/Resource", + "path": "cdk-dynamodb-global-20191121/Table/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -61,23 +61,23 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "cdk-dynamodb-global/Table/ScalingRole", + "path": "cdk-dynamodb-global-20191121/Table/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, - "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F": { - "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F", + "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A": { + "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/ImportedResource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -85,7 +85,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleFA284B4F/Resource/Resource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole6F43DF4A/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -166,7 +166,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref" ] } ] @@ -189,17 +189,17 @@ "version": "10.3.0" } }, - "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34": { - "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34", + "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128": { + "id": "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/ImportedResource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -207,7 +207,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleA6271B34/Resource/Resource", + "path": "cdk-dynamodb-global-20191121/Table/SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -258,7 +258,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref" + "Outputs.cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref" ] } ] @@ -283,11 +283,11 @@ }, "Replicaeu-west-2": { "id": "Replicaeu-west-2", - "path": "cdk-dynamodb-global/Table/Replicaeu-west-2", + "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-west-2", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global/Table/Replicaeu-west-2/Default", + "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-west-2/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -301,11 +301,11 @@ }, "Replicaeu-central-1": { "id": "Replicaeu-central-1", - "path": "cdk-dynamodb-global/Table/Replicaeu-central-1", + "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-central-1", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global/Table/Replicaeu-central-1/Default", + "path": "cdk-dynamodb-global-20191121/Table/Replicaeu-central-1/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -325,19 +325,35 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { + "OnEvent": { + "id": "OnEvent", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEvent", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "OnComplete": { + "id": "OnComplete", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnComplete", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, "OnEventHandler": { "id": "OnEventHandler", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -345,7 +361,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -384,11 +400,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -436,7 +452,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" + "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" } ] ] @@ -455,7 +471,7 @@ }, ":table/", { - "Ref": "referencetocdkdynamodbglobalTableF3B61EA4Ref" + "Ref": "referencetocdkdynamodbglobal20191121TableB640876BRef" } ] ] @@ -492,11 +508,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -504,7 +520,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -518,7 +534,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -526,7 +542,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "handler": "index.onEventHandler", "role": { @@ -552,15 +568,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -568,7 +584,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -613,11 +629,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -625,7 +641,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -639,7 +655,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -647,7 +663,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" + "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" }, "handler": "index.isCompleteHandler", "role": { @@ -673,19 +689,19 @@ }, "Provider": { "id": "Provider", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -693,7 +709,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -732,11 +748,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -825,11 +841,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -837,7 +853,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -851,7 +867,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -861,7 +877,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -905,15 +921,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -921,7 +937,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -960,11 +976,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1046,11 +1062,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1058,7 +1074,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1072,7 +1088,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1082,7 +1098,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1123,15 +1139,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1139,7 +1155,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1178,11 +1194,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1264,11 +1280,11 @@ }, "Code": { "id": "Code", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1276,7 +1292,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1290,7 +1306,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1300,7 +1316,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1341,15 +1357,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1357,7 +1373,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1382,11 +1398,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1468,7 +1484,7 @@ }, "Resource": { "id": "Resource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1486,33 +1502,33 @@ "version": "0.0.0" } }, - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef": { - "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole5E3708DERef", + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref": { + "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole3E8625F3Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref": { - "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2EE22431Ref", + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref": { + "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole2F936EC4Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn": { - "id": "cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobalawscdkawsdynamodbReplicaProviderframeworkonEvent28092A46Arn", + "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn": { + "id": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderframeworkonEventCFDD0BA0Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-cdkdynamodbglobalTableF3B61EA4Ref": { - "id": "reference-to-cdkdynamodbglobalTableF3B61EA4Ref", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobalTableF3B61EA4Ref", + "reference-to-cdkdynamodbglobal20191121TableB640876BRef": { + "id": "reference-to-cdkdynamodbglobal20191121TableB640876BRef", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-cdkdynamodbglobal20191121TableB640876BRef", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1526,16 +1542,16 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", "children": { "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", - "path": "cdk-dynamodb-global/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", + "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetocdkdynamodbglobalTableF3B61EA4Ref": { + "referencetocdkdynamodbglobal20191121TableB640876BRef": { "Ref": "TableCD117FA1" } }, @@ -1551,7 +1567,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/3f2f4a04bcc13d7e3154cb2b34655661309e4af39496b52a2199412cb3784efc.json" + "/f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json" ] ] } @@ -1570,7 +1586,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-dynamodb-global/BootstrapVersion", + "path": "cdk-dynamodb-global-20191121/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1578,7 +1594,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-dynamodb-global/CheckBootstrapVersion", + "path": "cdk-dynamodb-global-20191121/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1590,17 +1606,17 @@ "version": "0.0.0" } }, - "cdk-dynamodb-global-integ": { - "id": "cdk-dynamodb-global-integ", - "path": "cdk-dynamodb-global-integ", + "cdk-dynamodb-global-integ-20191121-test": { + "id": "cdk-dynamodb-global-integ-20191121-test", + "path": "cdk-dynamodb-global-integ-20191121-test", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "cdk-dynamodb-global-integ/DefaultTest", + "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global-integ/DefaultTest/Default", + "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.3.0" @@ -1608,11 +1624,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert", + "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert/BootstrapVersion", + "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1620,7 +1636,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-dynamodb-global-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" From 428ae6ef36d54c9fcbe91f63f8ec56c513b4a638 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 17:06:57 -0800 Subject: [PATCH 60/74] snaps Signed-off-by: Francis --- .../index.js | 1 + .../index.d.ts | 3 - .../index.js | 73 ----- ...b-global-replicas-provisioned.assets.json} | 20 +- ...global-replicas-provisioned.template.json} | 26 +- ...licaProviderEA32CB30.nested.template.json} | 22 +- ...efaultTestDeployAssertE7F91F54.assets.json | 2 +- .../cdk.out | 2 +- .../integ.json | 4 +- .../manifest.json | 96 +++--- .../tree.json | 276 ++++++++---------- .../test/integ.global-replicas-provisioned.ts | 2 +- .../index.js | 1 + .../index.d.ts | 3 - .../index.js | 73 ----- .../cdk-dynamodb-global-20191121.assets.json | 16 +- ...cdk-dynamodb-global-20191121.template.json | 2 +- .../test/integ.global.js.snapshot/cdk.out | 2 +- ...plicaProviderB281C954.nested.template.json | 4 +- ...faultTestDeployAssert469C3611.assets.json} | 4 +- ...ultTestDeployAssert469C3611.template.json} | 0 .../test/integ.global.js.snapshot/integ.json | 8 +- .../integ.global.js.snapshot/manifest.json | 22 +- .../test/integ.global.js.snapshot/tree.json | 76 ++--- .../test/aws-dynamodb/test/integ.global.ts | 2 +- ...s.json => aws-cdk-ses-receipt.assets.json} | 4 +- ...json => aws-cdk-ses-receipt.template.json} | 0 .../test/integ.receipt.js.snapshot/cdk.out | 2 +- ...faultTestDeployAssertA2776C75.assets.json} | 4 +- ...ultTestDeployAssertA2776C75.template.json} | 0 .../test/integ.receipt.js.snapshot/integ.json | 10 +- .../integ.receipt.js.snapshot/manifest.json | 56 ++-- .../test/integ.receipt.js.snapshot/tree.json | 78 ++--- 33 files changed, 330 insertions(+), 564 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{aws-cdkdynamodb-global-replicas-provisioned.assets.json => aws-cdk-dynamodb-global-replicas-provisioned.assets.json} (71%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{aws-cdkdynamodb-global-replicas-provisioned.template.json => aws-cdk-dynamodb-global-replicas-provisioned.template.json} (93%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/{awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json => awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json} (95%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json => cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json} (82%) rename packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/{cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json => cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{AwsCdkSesReceipt.assets.json => aws-cdk-ses-receipt.assets.json} (94%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{AwsCdkSesReceipt.template.json => aws-cdk-ses-receipt.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json => cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json} (84%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/{CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json => cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json} (100%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js new file mode 100644 index 0000000000000..d991c8c6a6e37 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js @@ -0,0 +1 @@ +"use strict";var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var m=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:!0})},b=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of d(s))!u.call(e,a)&&a!==t&&n(e,a,{get:()=>s[a],enumerable:!(o=R(s,a))||o.enumerable});return e};var T=e=>b(n({},"__esModule",{value:!0}),e);var y={};m(y,{isCompleteHandler:()=>g,onEventHandler:()=>C});module.exports=T(y);var c=require("@aws-sdk/client-dynamodb");async function C(e){console.log("Event: %j",{...e,ResponseURL:"..."});let s=new c.DynamoDB({}),t=e.ResourceProperties.TableName,o=e.ResourceProperties.Region,a;if(e.RequestType==="Create"||e.RequestType==="Delete")a=e.RequestType;else{let l=await s.describeTable({TableName:t});console.log("Describe table: %j",l),a=l.Table?.Replicas?.some(i=>i.RegionName===o)?void 0:"Create"}if(a){let l=await s.updateTable({TableName:t,ReplicaUpdates:[{[a]:{RegionName:o}}]});console.log("Update table: %j",l)}else console.log("Skipping updating Table, as a replica in '%s' already exists",o);return e.RequestType==="Create"||e.RequestType==="Update"?{PhysicalResourceId:`${t}-${o}`}:{}}async function g(e){console.log("Event: %j",{...e,ResponseURL:"..."});let t=await new c.DynamoDB({}).describeTable({TableName:e.ResourceProperties.TableName});console.log("Describe table: %j",t);let o=t.Table?.TableStatus==="ACTIVE",l=(t.Table?.Replicas??[]).find(r=>r.RegionName===e.ResourceProperties.Region),p=l?.ReplicaStatus==="ACTIVE",i=e.ResourceProperties.SkipReplicationCompletedWait==="true";switch(e.RequestType){case"Create":case"Update":return{IsComplete:o&&(p||i)};case"Delete":return{IsComplete:o&&l===void 0}}}0&&(module.exports={isCompleteHandler,onEventHandler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts deleted file mode 100644 index 8fe83665c0408..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IsCompleteRequest, IsCompleteResponse, OnEventRequest, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; -export declare function onEventHandler(event: OnEventRequest): Promise; -export declare function isCompleteHandler(event: IsCompleteRequest): Promise; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js deleted file mode 100644 index 365490cccc06c..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isCompleteHandler = exports.onEventHandler = void 0; -/* eslint-disable no-console */ -const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); // eslint-disable-line import/no-extraneous-dependencies -async function onEventHandler(event) { - console.log('Event: %j', { ...event, ResponseURL: '...' }); - const dynamodb = new client_dynamodb_1.DynamoDB({}); - const tableName = event.ResourceProperties.TableName; - const region = event.ResourceProperties.Region; - let updateTableAction; - if (event.RequestType === 'Create' || event.RequestType === 'Delete') { - updateTableAction = event.RequestType; - } - else { // Update - // There are two cases where an Update can happen: - // 1. A table replacement. In that case, we need to create the replica in the new Table - // (the replica for the "old" Table will be deleted when CFN issues a Delete event on the old physical resource id). - // 2. A customer has changed one of the properties of the Custom Resource, - // like 'waitForReplicationToFinish'. In that case, we don't have to do anything. - // To differentiate the two cases, we make an API call to DynamoDB to check whether a replica already exists. - const describeTableResult = await dynamodb.describeTable({ - TableName: tableName, - }); - console.log('Describe table: %j', describeTableResult); - const replicaExists = describeTableResult.Table?.Replicas?.some(replica => replica.RegionName === region); - updateTableAction = replicaExists ? undefined : 'Create'; - } - if (updateTableAction) { - const data = await dynamodb.updateTable({ - TableName: tableName, - ReplicaUpdates: [ - { - [updateTableAction]: { - RegionName: region, - }, - }, - ], - }); - console.log('Update table: %j', data); - } - else { - console.log("Skipping updating Table, as a replica in '%s' already exists", region); - } - return event.RequestType === 'Create' || event.RequestType === 'Update' - ? { PhysicalResourceId: `${tableName}-${region}` } - : {}; -} -exports.onEventHandler = onEventHandler; -async function isCompleteHandler(event) { - console.log('Event: %j', { ...event, ResponseURL: '...' }); - const dynamodb = new client_dynamodb_1.DynamoDB({}); - const data = await dynamodb.describeTable({ - TableName: event.ResourceProperties.TableName, - }); - console.log('Describe table: %j', data); - const tableActive = data.Table?.TableStatus === 'ACTIVE'; - const replicas = data.Table?.Replicas ?? []; - const regionReplica = replicas.find(r => r.RegionName === event.ResourceProperties.Region); - const replicaActive = regionReplica?.ReplicaStatus === 'ACTIVE'; - const skipReplicationCompletedWait = event.ResourceProperties.SkipReplicationCompletedWait === 'true'; - switch (event.RequestType) { - case 'Create': - case 'Update': - // Complete when replica is reported as ACTIVE - return { IsComplete: tableActive && (replicaActive || skipReplicationCompletedWait) }; - case 'Delete': - // Complete when replica is gone - return { IsComplete: tableActive && regionReplica === undefined }; - } -} -exports.isCompleteHandler = isCompleteHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsOERBQW9ELENBQUMsd0RBQXdEO0FBR3RHLEtBQUssVUFBVSxjQUFjLENBQUMsS0FBcUI7SUFDeEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLEVBQUUsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztJQUUzRCxNQUFNLFFBQVEsR0FBRyxJQUFJLDBCQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7SUFFbEMsTUFBTSxTQUFTLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQztJQUNyRCxNQUFNLE1BQU0sR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDO0lBRS9DLElBQUksaUJBQTZELENBQUM7SUFDbEUsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNwRSxpQkFBaUIsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDO0tBQ3ZDO1NBQU0sRUFBRSxTQUFTO1FBQ2hCLGtEQUFrRDtRQUNsRCx1RkFBdUY7UUFDdkYsb0hBQW9IO1FBQ3BILDBFQUEwRTtRQUMxRSxpRkFBaUY7UUFDakYsNkdBQTZHO1FBQzdHLE1BQU0sbUJBQW1CLEdBQUcsTUFBTSxRQUFRLENBQUMsYUFBYSxDQUFDO1lBQ3ZELFNBQVMsRUFBRSxTQUFTO1NBQ3JCLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsbUJBQW1CLENBQUMsQ0FBQztRQUN2RCxNQUFNLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLE9BQU8sQ0FBQyxVQUFVLEtBQUssTUFBTSxDQUFDLENBQUM7UUFDMUcsaUJBQWlCLEdBQUcsYUFBYSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztLQUMxRDtJQUVELElBQUksaUJBQWlCLEVBQUU7UUFDckIsTUFBTSxJQUFJLEdBQUcsTUFBTSxRQUFRLENBQUMsV0FBVyxDQUFDO1lBQ3RDLFNBQVMsRUFBRSxTQUFTO1lBQ3BCLGNBQWMsRUFBRTtnQkFDZDtvQkFDRSxDQUFDLGlCQUFpQixDQUFDLEVBQUU7d0JBQ25CLFVBQVUsRUFBRSxNQUFNO3FCQUNuQjtpQkFDRjthQUNGO1NBQ0YsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUN2QztTQUFNO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyw4REFBOEQsRUFBRSxNQUFNLENBQUMsQ0FBQztLQUNyRjtJQUVELE9BQU8sS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLElBQUksS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRO1FBQ3JFLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLEdBQUcsU0FBUyxJQUFJLE1BQU0sRUFBRSxFQUFFO1FBQ2xELENBQUMsQ0FBQyxFQUFFLENBQUM7QUFDVCxDQUFDO0FBN0NELHdDQTZDQztBQUVNLEtBQUssVUFBVSxpQkFBaUIsQ0FBQyxLQUF3QjtJQUM5RCxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsS0FBSyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBRTNELE1BQU0sUUFBUSxHQUFHLElBQUksMEJBQVEsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUVsQyxNQUFNLElBQUksR0FBRyxNQUFNLFFBQVEsQ0FBQyxhQUFhLENBQUM7UUFDeEMsU0FBUyxFQUFFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxTQUFTO0tBQzlDLENBQUMsQ0FBQztJQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFFeEMsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFBRSxXQUFXLEtBQUssUUFBUSxDQUFDO0lBQ3pELE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQUUsUUFBUSxJQUFJLEVBQUUsQ0FBQztJQUM1QyxNQUFNLGFBQWEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsS0FBSyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDM0YsTUFBTSxhQUFhLEdBQUcsYUFBYSxFQUFFLGFBQWEsS0FBSyxRQUFRLENBQUM7SUFDaEUsTUFBTSw0QkFBNEIsR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsNEJBQTRCLEtBQUssTUFBTSxDQUFDO0lBRXRHLFFBQVEsS0FBSyxDQUFDLFdBQVcsRUFBRTtRQUN6QixLQUFLLFFBQVEsQ0FBQztRQUNkLEtBQUssUUFBUTtZQUNYLDhDQUE4QztZQUM5QyxPQUFPLEVBQUUsVUFBVSxFQUFFLFdBQVcsSUFBSSxDQUFDLGFBQWEsSUFBSSw0QkFBNEIsQ0FBQyxFQUFFLENBQUM7UUFDeEYsS0FBSyxRQUFRO1lBQ1gsZ0NBQWdDO1lBQ2hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsV0FBVyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUUsQ0FBQztLQUNyRTtBQUNILENBQUM7QUF6QkQsOENBeUJDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuaW1wb3J0IHsgRHluYW1vREIgfSBmcm9tICdAYXdzLXNkay9jbGllbnQtZHluYW1vZGInOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0IHR5cGUgeyBJc0NvbXBsZXRlUmVxdWVzdCwgSXNDb21wbGV0ZVJlc3BvbnNlLCBPbkV2ZW50UmVxdWVzdCwgT25FdmVudFJlc3BvbnNlIH0gZnJvbSAnLi4vLi4vLi4vY3VzdG9tLXJlc291cmNlcy9saWIvcHJvdmlkZXItZnJhbWV3b3JrL3R5cGVzJztcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIG9uRXZlbnRIYW5kbGVyKGV2ZW50OiBPbkV2ZW50UmVxdWVzdCk6IFByb21pc2U8T25FdmVudFJlc3BvbnNlPiB7XG4gIGNvbnNvbGUubG9nKCdFdmVudDogJWonLCB7IC4uLmV2ZW50LCBSZXNwb25zZVVSTDogJy4uLicgfSk7XG5cbiAgY29uc3QgZHluYW1vZGIgPSBuZXcgRHluYW1vREIoe30pO1xuXG4gIGNvbnN0IHRhYmxlTmFtZSA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5UYWJsZU5hbWU7XG4gIGNvbnN0IHJlZ2lvbiA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5SZWdpb247XG5cbiAgbGV0IHVwZGF0ZVRhYmxlQWN0aW9uOiAnQ3JlYXRlJyB8ICdVcGRhdGUnIHwgJ0RlbGV0ZScgfCB1bmRlZmluZWQ7XG4gIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0NyZWF0ZScgfHwgZXZlbnQuUmVxdWVzdFR5cGUgPT09ICdEZWxldGUnKSB7XG4gICAgdXBkYXRlVGFibGVBY3Rpb24gPSBldmVudC5SZXF1ZXN0VHlwZTtcbiAgfSBlbHNlIHsgLy8gVXBkYXRlXG4gICAgLy8gVGhlcmUgYXJlIHR3byBjYXNlcyB3aGVyZSBhbiBVcGRhdGUgY2FuIGhhcHBlbjpcbiAgICAvLyAxLiBBIHRhYmxlIHJlcGxhY2VtZW50LiBJbiB0aGF0IGNhc2UsIHdlIG5lZWQgdG8gY3JlYXRlIHRoZSByZXBsaWNhIGluIHRoZSBuZXcgVGFibGVcbiAgICAvLyAodGhlIHJlcGxpY2EgZm9yIHRoZSBcIm9sZFwiIFRhYmxlIHdpbGwgYmUgZGVsZXRlZCB3aGVuIENGTiBpc3N1ZXMgYSBEZWxldGUgZXZlbnQgb24gdGhlIG9sZCBwaHlzaWNhbCByZXNvdXJjZSBpZCkuXG4gICAgLy8gMi4gQSBjdXN0b21lciBoYXMgY2hhbmdlZCBvbmUgb2YgdGhlIHByb3BlcnRpZXMgb2YgdGhlIEN1c3RvbSBSZXNvdXJjZSxcbiAgICAvLyBsaWtlICd3YWl0Rm9yUmVwbGljYXRpb25Ub0ZpbmlzaCcuIEluIHRoYXQgY2FzZSwgd2UgZG9uJ3QgaGF2ZSB0byBkbyBhbnl0aGluZy5cbiAgICAvLyBUbyBkaWZmZXJlbnRpYXRlIHRoZSB0d28gY2FzZXMsIHdlIG1ha2UgYW4gQVBJIGNhbGwgdG8gRHluYW1vREIgdG8gY2hlY2sgd2hldGhlciBhIHJlcGxpY2EgYWxyZWFkeSBleGlzdHMuXG4gICAgY29uc3QgZGVzY3JpYmVUYWJsZVJlc3VsdCA9IGF3YWl0IGR5bmFtb2RiLmRlc2NyaWJlVGFibGUoe1xuICAgICAgVGFibGVOYW1lOiB0YWJsZU5hbWUsXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRlc2NyaWJlVGFibGVSZXN1bHQpO1xuICAgIGNvbnN0IHJlcGxpY2FFeGlzdHMgPSBkZXNjcmliZVRhYmxlUmVzdWx0LlRhYmxlPy5SZXBsaWNhcz8uc29tZShyZXBsaWNhID0+IHJlcGxpY2EuUmVnaW9uTmFtZSA9PT0gcmVnaW9uKTtcbiAgICB1cGRhdGVUYWJsZUFjdGlvbiA9IHJlcGxpY2FFeGlzdHMgPyB1bmRlZmluZWQgOiAnQ3JlYXRlJztcbiAgfVxuXG4gIGlmICh1cGRhdGVUYWJsZUFjdGlvbikge1xuICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBkeW5hbW9kYi51cGRhdGVUYWJsZSh7XG4gICAgICBUYWJsZU5hbWU6IHRhYmxlTmFtZSxcbiAgICAgIFJlcGxpY2FVcGRhdGVzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBbdXBkYXRlVGFibGVBY3Rpb25dOiB7XG4gICAgICAgICAgICBSZWdpb25OYW1lOiByZWdpb24sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ1VwZGF0ZSB0YWJsZTogJWonLCBkYXRhKTtcbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmxvZyhcIlNraXBwaW5nIHVwZGF0aW5nIFRhYmxlLCBhcyBhIHJlcGxpY2EgaW4gJyVzJyBhbHJlYWR5IGV4aXN0c1wiLCByZWdpb24pO1xuICB9XG5cbiAgcmV0dXJuIGV2ZW50LlJlcXVlc3RUeXBlID09PSAnQ3JlYXRlJyB8fCBldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ1VwZGF0ZSdcbiAgICA/IHsgUGh5c2ljYWxSZXNvdXJjZUlkOiBgJHt0YWJsZU5hbWV9LSR7cmVnaW9ufWAgfVxuICAgIDoge307XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpc0NvbXBsZXRlSGFuZGxlcihldmVudDogSXNDb21wbGV0ZVJlcXVlc3QpOiBQcm9taXNlPElzQ29tcGxldGVSZXNwb25zZT4ge1xuICBjb25zb2xlLmxvZygnRXZlbnQ6ICVqJywgeyAuLi5ldmVudCwgUmVzcG9uc2VVUkw6ICcuLi4nIH0pO1xuXG4gIGNvbnN0IGR5bmFtb2RiID0gbmV3IER5bmFtb0RCKHt9KTtcblxuICBjb25zdCBkYXRhID0gYXdhaXQgZHluYW1vZGIuZGVzY3JpYmVUYWJsZSh7XG4gICAgVGFibGVOYW1lOiBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVGFibGVOYW1lLFxuICB9KTtcbiAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRhdGEpO1xuXG4gIGNvbnN0IHRhYmxlQWN0aXZlID0gZGF0YS5UYWJsZT8uVGFibGVTdGF0dXMgPT09ICdBQ1RJVkUnO1xuICBjb25zdCByZXBsaWNhcyA9IGRhdGEuVGFibGU/LlJlcGxpY2FzID8/IFtdO1xuICBjb25zdCByZWdpb25SZXBsaWNhID0gcmVwbGljYXMuZmluZChyID0+IHIuUmVnaW9uTmFtZSA9PT0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlJlZ2lvbik7XG4gIGNvbnN0IHJlcGxpY2FBY3RpdmUgPSByZWdpb25SZXBsaWNhPy5SZXBsaWNhU3RhdHVzID09PSAnQUNUSVZFJztcbiAgY29uc3Qgc2tpcFJlcGxpY2F0aW9uQ29tcGxldGVkV2FpdCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5Ta2lwUmVwbGljYXRpb25Db21wbGV0ZWRXYWl0ID09PSAndHJ1ZSc7XG5cbiAgc3dpdGNoIChldmVudC5SZXF1ZXN0VHlwZSkge1xuICAgIGNhc2UgJ0NyZWF0ZSc6XG4gICAgY2FzZSAnVXBkYXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyByZXBvcnRlZCBhcyBBQ1RJVkVcbiAgICAgIHJldHVybiB7IElzQ29tcGxldGU6IHRhYmxlQWN0aXZlICYmIChyZXBsaWNhQWN0aXZlIHx8IHNraXBSZXBsaWNhdGlvbkNvbXBsZXRlZFdhaXQpIH07XG4gICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyBnb25lXG4gICAgICByZXR1cm4geyBJc0NvbXBsZXRlOiB0YWJsZUFjdGl2ZSAmJiByZWdpb25SZXBsaWNhID09PSB1bmRlZmluZWQgfTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json similarity index 71% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json index 034a1641946db..c8872b113d78f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json @@ -1,15 +1,15 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { - "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4": { + "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4": { "source": { - "path": "asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4", + "path": "asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip", + "objectKey": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -27,28 +27,28 @@ } } }, - "8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556": { + "fac70c98815617bfec29fd3dc3b0a9295dba41bc56daf65deb4ecd6b3a35873d": { "source": { - "path": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json", + "path": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json", + "objectKey": "fac70c98815617bfec29fd3dc3b0a9295dba41bc56daf65deb4ecd6b3a35873d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d": { + "8acdd84b9ba2e657f9880baf917bc86a7e481431ad16d325511eb470ba2ad246": { "source": { - "path": "aws-cdkdynamodb-global-replicas-provisioned.template.json", + "path": "aws-cdk-dynamodb-global-replicas-provisioned.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d.json", + "objectKey": "8acdd84b9ba2e657f9880baf917bc86a7e481431ad16d325511eb470ba2ad246.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json similarity index 93% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json index 45c27553634e7..0ce16bcebdd79 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdkdynamodb-global-replicas-provisioned.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json @@ -26,7 +26,7 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5": { + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -103,13 +103,13 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" ] } ] } }, - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53": { + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2": { "Type": "AWS::IAM::ManagedPolicy", "Properties": { "Description": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" ] } ] @@ -160,7 +160,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" ] }, "TableName": { @@ -169,8 +169,8 @@ "Region": "us-east-2" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53", - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -184,7 +184,7 @@ "ServiceToken": { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" ] }, "TableName": { @@ -193,8 +193,8 @@ "Region": "eu-west-3" }, "DependsOn": [ - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53", - "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2", + "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB", "TableWriteScalingTargetE5669214", "TableWriteScalingTargetTrackingD78DCCD8" ], @@ -254,7 +254,7 @@ "TableWriteScalingTargetTrackingD78DCCD8": { "Type": "AWS::ApplicationAutoScaling::ScalingPolicy", "Properties": { - "PolicyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking757FA9B6", + "PolicyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTrackingD631E2EC", "PolicyType": "TargetTrackingScaling", "ScalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -271,7 +271,7 @@ "Type": "AWS::CloudFormation::Stack", "Properties": { "Parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { "Ref": "TableCD117FA1" } }, @@ -291,7 +291,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json" + "/fac70c98815617bfec29fd3dc3b0a9295dba41bc56daf65deb4ecd6b3a35873d.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json similarity index 95% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json index ab188ed6ba84f..182defd760ba1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProvider99CDA21E.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json @@ -82,7 +82,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" } ] ] @@ -101,7 +101,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" } ] ] @@ -126,7 +126,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "Handler": "index.onEventHandler", "Role": { @@ -181,7 +181,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "Handler": "index.isCompleteHandler", "Role": { @@ -306,7 +306,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -443,7 +443,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - isComplete (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -577,7 +577,7 @@ }, "S3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "Description": "AWS CDK resource provider framework - onTimeout (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -727,17 +727,17 @@ } }, "Outputs": { - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": { "Value": { "Ref": "OnEventHandlerServiceRole15A26729" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": { "Value": { "Ref": "IsCompleteHandlerServiceRole5810CC58" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": { + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": { "Value": { "Fn::GetAtt": [ "ProviderframeworkonEvent83C1D0A7", @@ -747,7 +747,7 @@ } }, "Parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { "Type": "String" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json index d6eca1a978d83..28aa8f93b1502 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out index c5cb2e5de6344..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"35.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json index b23a47a0e6f43..78c5680443cd1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json @@ -1,9 +1,9 @@ { - "version": "35.0.0", + "version": "34.0.0", "testCases": { "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest": { "stacks": [ - "aws-cdkdynamodb-global-replicas-provisioned" + "aws-cdk-dynamodb-global-replicas-provisioned" ], "diffAssets": true, "assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json index a7883d452a0dc..b4684196fd69f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { - "version": "35.0.0", + "version": "34.0.0", "artifacts": { - "aws-cdkdynamodb-global-replicas-provisioned.assets": { + "aws-cdk-dynamodb-global-replicas-provisioned.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-cdkdynamodb-global-replicas-provisioned.assets.json", + "file": "aws-cdk-dynamodb-global-replicas-provisioned.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-cdkdynamodb-global-replicas-provisioned": { + "aws-cdk-dynamodb-global-replicas-provisioned": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-cdkdynamodb-global-replicas-provisioned.template.json", + "templateFile": "aws-cdk-dynamodb-global-replicas-provisioned.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/859fccf46678816289072ace27336ddd21ca094d6db9618bbff571ccd119bd6d.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8acdd84b9ba2e657f9880baf917bc86a7e481431ad16d325511eb470ba2ad246.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-cdkdynamodb-global-replicas-provisioned.assets" + "aws-cdk-dynamodb-global-replicas-provisioned.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,209 +31,209 @@ } }, "dependencies": [ - "aws-cdkdynamodb-global-replicas-provisioned.assets" + "aws-cdk-dynamodb-global-replicas-provisioned.assets" ], "metadata": { - "/aws-cdkdynamodb-global-replicas-provisioned/Table/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableCD117FA1" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82ADB4D0FB5" + "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C5404E50EB53" + "data": "TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicauseast28A15C236" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualsuseast2D20A1E77" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default": [ { "type": "aws:cdk:logicalId", "data": "TableReplicaeuwest314C3E552" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3": [ { "type": "aws:cdk:logicalId", "data": "TableStackRegionNotEqualseuwest302B3591C" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetE5669214" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource": [ { "type": "aws:cdk:logicalId", "data": "TableWriteScalingTargetTrackingD78DCCD8" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRole15A26729" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandlerServiceRoleDefaultPolicyC57085D4" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "OnEventHandler42BEBAE0" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandlerServiceRole5810CC58" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource": [ { "type": "aws:cdk:logicalId", "data": "IsCompleteHandler7073F4DA" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRole9FF04296" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEventServiceRoleDefaultPolicy48CD2133" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonEvent83C1D0A7" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleB1087139" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisCompleteServiceRoleDefaultPolicy2E7140AC" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkisComplete26D7B0CB" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRole28643D26" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeoutServiceRoleDefaultPolicy2688969F" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderframeworkonTimeout0B47CA38" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRole0C7159F9" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ProviderwaiterstatemachineRoleDefaultPolicyD3C3DA1A" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource": [ { "type": "aws:cdk:logicalId", "data": "Providerwaiterstatemachine5D4A9DF0" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": [ { "type": "aws:cdk:logicalId", - "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn" + "data": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": [ { "type": "aws:cdk:logicalId", - "data": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" + "data": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": [ { "type": "aws:cdk:logicalId", "data": "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/BootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-cdkdynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ + "/aws-cdk-dynamodb-global-replicas-provisioned/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-cdkdynamodb-global-replicas-provisioned" + "displayName": "aws-cdk-dynamodb-global-replicas-provisioned" }, "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54.assets": { "type": "cdk:asset-manifest", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json index e0c0cd34bd2fc..79f6e97998e23 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-cdkdynamodb-global-replicas-provisioned": { - "id": "aws-cdkdynamodb-global-replicas-provisioned", - "path": "aws-cdkdynamodb-global-replicas-provisioned", + "aws-cdk-dynamodb-global-replicas-provisioned": { + "id": "aws-cdk-dynamodb-global-replicas-provisioned", + "path": "aws-cdk-dynamodb-global-replicas-provisioned", "children": { "Table": { "id": "Table", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", "aws:cdk:cloudformation:props": { @@ -46,23 +46,23 @@ }, "ScalingRole": { "id": "ScalingRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/ScalingRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/ScalingRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, - "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A": { - "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A", + "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77": { + "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/ImportedResource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -70,7 +70,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole822EC82A/Resource/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B77/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -148,7 +148,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef" ] } ] @@ -168,20 +168,20 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, - "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540": { - "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540", + "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A": { + "id": "SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource", "children": { "ImportedResource": { "id": "ImportedResource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/ImportedResource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/ImportedResource", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -189,7 +189,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole5D58C540/Resource/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/SourceTableAttachedManagedPolicy-awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A/Resource/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", "aws:cdk:cloudformation:props": { @@ -229,7 +229,7 @@ { "Fn::GetAtt": [ "awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D", - "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef" + "Outputs.awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref" ] } ] @@ -249,16 +249,16 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "Replicaus-east-2": { "id": "Replicaus-east-2", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2", "children": { "Default": { "id": "Default", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaus-east-2/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -272,7 +272,7 @@ }, "StackRegionNotEqualsus-east-2": { "id": "StackRegionNotEqualsus-east-2", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualsus-east-2", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -280,11 +280,11 @@ }, "Replicaeu-west-3": { "id": "Replicaeu-west-3", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3", "children": { "Default": { "id": "Default", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/Replicaeu-west-3/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -298,7 +298,7 @@ }, "StackRegionNotEqualseu-west-3": { "id": "StackRegionNotEqualseu-west-3", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/StackRegionNotEqualseu-west-3", "constructInfo": { "fqn": "aws-cdk-lib.CfnCondition", "version": "0.0.0" @@ -306,15 +306,15 @@ }, "WriteScaling": { "id": "WriteScaling", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling", "children": { "Target": { "id": "Target", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalableTarget", "aws:cdk:cloudformation:props": { @@ -358,15 +358,15 @@ }, "Tracking": { "id": "Tracking", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/Table/WriteScaling/Target/Tracking/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ApplicationAutoScaling::ScalingPolicy", "aws:cdk:cloudformation:props": { - "policyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTracking757FA9B6", + "policyName": "awscdkdynamodbglobalreplicasprovisionedTableWriteScalingTargetTrackingD631E2EC", "policyType": "TargetTrackingScaling", "scalingTargetId": { "Ref": "TableWriteScalingTargetE5669214" @@ -410,35 +410,19 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { - "OnEvent": { - "id": "OnEvent", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEvent", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, - "OnComplete": { - "id": "OnComplete", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnComplete", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, "OnEventHandler": { "id": "OnEventHandler", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -446,7 +430,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -485,11 +469,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -541,7 +525,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" } ] ] @@ -560,7 +544,7 @@ }, ":table/", { - "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref" + "Ref": "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref" } ] ] @@ -597,11 +581,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -609,7 +593,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -623,7 +607,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -631,7 +615,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "handler": "index.onEventHandler", "role": { @@ -657,15 +641,15 @@ }, "IsCompleteHandler": { "id": "IsCompleteHandler", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -673,7 +657,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -716,35 +700,9 @@ "version": "0.0.0" } }, - "Code": { - "id": "Code", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -752,7 +710,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "handler": "index.isCompleteHandler", "role": { @@ -778,19 +736,19 @@ }, "Provider": { "id": "Provider", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider", "children": { "framework-onEvent": { "id": "framework-onEvent", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -798,7 +756,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -837,11 +795,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -930,11 +888,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -942,7 +900,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -956,7 +914,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onEvent/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -966,7 +924,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1010,15 +968,15 @@ }, "framework-isComplete": { "id": "framework-isComplete", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1026,7 +984,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1065,11 +1023,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1151,11 +1109,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1163,7 +1121,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1177,7 +1135,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-isComplete/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1187,7 +1145,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - isComplete (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1228,15 +1186,15 @@ }, "framework-onTimeout": { "id": "framework-onTimeout", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1244,7 +1202,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1283,11 +1241,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1369,11 +1327,11 @@ }, "Code": { "id": "Code", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code", "children": { "Stage": { "id": "Stage", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -1381,7 +1339,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -1395,7 +1353,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/framework-onTimeout/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1405,7 +1363,7 @@ }, "s3Key": "8e06cc8057c9c50dcd656ff09f233c37bb22f550f4bef763c9f9916df0e62484.zip" }, - "description": "AWS CDK resource provider framework - onTimeout (aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", + "description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)", "environment": { "variables": { "USER_ON_EVENT_FUNCTION_ARN": { @@ -1446,15 +1404,15 @@ }, "waiter-state-machine": { "id": "waiter-state-machine", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine", "children": { "Role": { "id": "Role", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1462,7 +1420,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1487,11 +1445,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1573,7 +1531,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider/waiter-state-machine/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", "version": "0.0.0" @@ -1582,7 +1540,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } } }, @@ -1591,33 +1549,33 @@ "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole916E49C8Ref", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRole348A0C9ARef", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleB0A3AF6DRef", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole750F1EE9Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn": { - "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventC7001F92Arn", + "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn": { + "id": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderframeworkonEventACC2C387Arn", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, - "reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { - "id": "reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref", + "reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { + "id": "reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/reference-to-awscdkdynamodbglobalreplicasprovisionedTable12280A12Ref", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1631,16 +1589,16 @@ }, "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack", "children": { "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource": { "id": "@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", - "path": "aws-cdkdynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStack/@aws-cdk--aws-dynamodb.ReplicaProvider.NestedStackResource", "attributes": { "aws:cdk:cloudformation:type": "AWS::CloudFormation::Stack", "aws:cdk:cloudformation:props": { "parameters": { - "referencetoawscdkdynamodbglobalreplicasprovisionedTableAD6C1461Ref": { + "referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": { "Ref": "TableCD117FA1" } }, @@ -1660,7 +1618,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/8e7e19e8bee6e499feeefd3ffc26213965df7c6e819475f459f9531334a3a556.json" + "/fac70c98815617bfec29fd3dc3b0a9295dba41bc56daf65deb4ecd6b3a35873d.json" ] ] } @@ -1674,12 +1632,12 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-cdkdynamodb-global-replicas-provisioned/BootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1687,7 +1645,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-cdkdynamodb-global-replicas-provisioned/CheckBootstrapVersion", + "path": "aws-cdk-dynamodb-global-replicas-provisioned/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1712,7 +1670,7 @@ "path": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "DeployAssert": { @@ -1758,7 +1716,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts index 06d76719f1a60..36b7a58922832 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.ts @@ -3,7 +3,7 @@ import * as cdk from 'aws-cdk-lib'; import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-cdkdynamodb-global-replicas-provisioned'); +const stack = new cdk.Stack(app, 'aws-cdk-dynamodb-global-replicas-provisioned'); const table = new dynamodb.Table(stack, 'Table', { partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js new file mode 100644 index 0000000000000..d991c8c6a6e37 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4/index.js @@ -0,0 +1 @@ +"use strict";var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var m=(e,s)=>{for(var t in s)n(e,t,{get:s[t],enumerable:!0})},b=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of d(s))!u.call(e,a)&&a!==t&&n(e,a,{get:()=>s[a],enumerable:!(o=R(s,a))||o.enumerable});return e};var T=e=>b(n({},"__esModule",{value:!0}),e);var y={};m(y,{isCompleteHandler:()=>g,onEventHandler:()=>C});module.exports=T(y);var c=require("@aws-sdk/client-dynamodb");async function C(e){console.log("Event: %j",{...e,ResponseURL:"..."});let s=new c.DynamoDB({}),t=e.ResourceProperties.TableName,o=e.ResourceProperties.Region,a;if(e.RequestType==="Create"||e.RequestType==="Delete")a=e.RequestType;else{let l=await s.describeTable({TableName:t});console.log("Describe table: %j",l),a=l.Table?.Replicas?.some(i=>i.RegionName===o)?void 0:"Create"}if(a){let l=await s.updateTable({TableName:t,ReplicaUpdates:[{[a]:{RegionName:o}}]});console.log("Update table: %j",l)}else console.log("Skipping updating Table, as a replica in '%s' already exists",o);return e.RequestType==="Create"||e.RequestType==="Update"?{PhysicalResourceId:`${t}-${o}`}:{}}async function g(e){console.log("Event: %j",{...e,ResponseURL:"..."});let t=await new c.DynamoDB({}).describeTable({TableName:e.ResourceProperties.TableName});console.log("Describe table: %j",t);let o=t.Table?.TableStatus==="ACTIVE",l=(t.Table?.Replicas??[]).find(r=>r.RegionName===e.ResourceProperties.Region),p=l?.ReplicaStatus==="ACTIVE",i=e.ResourceProperties.SkipReplicationCompletedWait==="true";switch(e.RequestType){case"Create":case"Update":return{IsComplete:o&&(p||i)};case"Delete":return{IsComplete:o&&l===void 0}}}0&&(module.exports={isCompleteHandler,onEventHandler}); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts deleted file mode 100644 index 8fe83665c0408..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IsCompleteRequest, IsCompleteResponse, OnEventRequest, OnEventResponse } from '../../../custom-resources/lib/provider-framework/types'; -export declare function onEventHandler(event: OnEventRequest): Promise; -export declare function isCompleteHandler(event: IsCompleteRequest): Promise; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js deleted file mode 100644 index 365490cccc06c..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4/index.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isCompleteHandler = exports.onEventHandler = void 0; -/* eslint-disable no-console */ -const client_dynamodb_1 = require("@aws-sdk/client-dynamodb"); // eslint-disable-line import/no-extraneous-dependencies -async function onEventHandler(event) { - console.log('Event: %j', { ...event, ResponseURL: '...' }); - const dynamodb = new client_dynamodb_1.DynamoDB({}); - const tableName = event.ResourceProperties.TableName; - const region = event.ResourceProperties.Region; - let updateTableAction; - if (event.RequestType === 'Create' || event.RequestType === 'Delete') { - updateTableAction = event.RequestType; - } - else { // Update - // There are two cases where an Update can happen: - // 1. A table replacement. In that case, we need to create the replica in the new Table - // (the replica for the "old" Table will be deleted when CFN issues a Delete event on the old physical resource id). - // 2. A customer has changed one of the properties of the Custom Resource, - // like 'waitForReplicationToFinish'. In that case, we don't have to do anything. - // To differentiate the two cases, we make an API call to DynamoDB to check whether a replica already exists. - const describeTableResult = await dynamodb.describeTable({ - TableName: tableName, - }); - console.log('Describe table: %j', describeTableResult); - const replicaExists = describeTableResult.Table?.Replicas?.some(replica => replica.RegionName === region); - updateTableAction = replicaExists ? undefined : 'Create'; - } - if (updateTableAction) { - const data = await dynamodb.updateTable({ - TableName: tableName, - ReplicaUpdates: [ - { - [updateTableAction]: { - RegionName: region, - }, - }, - ], - }); - console.log('Update table: %j', data); - } - else { - console.log("Skipping updating Table, as a replica in '%s' already exists", region); - } - return event.RequestType === 'Create' || event.RequestType === 'Update' - ? { PhysicalResourceId: `${tableName}-${region}` } - : {}; -} -exports.onEventHandler = onEventHandler; -async function isCompleteHandler(event) { - console.log('Event: %j', { ...event, ResponseURL: '...' }); - const dynamodb = new client_dynamodb_1.DynamoDB({}); - const data = await dynamodb.describeTable({ - TableName: event.ResourceProperties.TableName, - }); - console.log('Describe table: %j', data); - const tableActive = data.Table?.TableStatus === 'ACTIVE'; - const replicas = data.Table?.Replicas ?? []; - const regionReplica = replicas.find(r => r.RegionName === event.ResourceProperties.Region); - const replicaActive = regionReplica?.ReplicaStatus === 'ACTIVE'; - const skipReplicationCompletedWait = event.ResourceProperties.SkipReplicationCompletedWait === 'true'; - switch (event.RequestType) { - case 'Create': - case 'Update': - // Complete when replica is reported as ACTIVE - return { IsComplete: tableActive && (replicaActive || skipReplicationCompletedWait) }; - case 'Delete': - // Complete when replica is gone - return { IsComplete: tableActive && regionReplica === undefined }; - } -} -exports.isCompleteHandler = isCompleteHandler; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrQkFBK0I7QUFDL0IsOERBQW9ELENBQUMsd0RBQXdEO0FBR3RHLEtBQUssVUFBVSxjQUFjLENBQUMsS0FBcUI7SUFDeEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxXQUFXLEVBQUUsRUFBRSxHQUFHLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQztJQUUzRCxNQUFNLFFBQVEsR0FBRyxJQUFJLDBCQUFRLENBQUMsRUFBRSxDQUFDLENBQUM7SUFFbEMsTUFBTSxTQUFTLEdBQUcsS0FBSyxDQUFDLGtCQUFrQixDQUFDLFNBQVMsQ0FBQztJQUNyRCxNQUFNLE1BQU0sR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDO0lBRS9DLElBQUksaUJBQTZELENBQUM7SUFDbEUsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNwRSxpQkFBaUIsR0FBRyxLQUFLLENBQUMsV0FBVyxDQUFDO0tBQ3ZDO1NBQU0sRUFBRSxTQUFTO1FBQ2hCLGtEQUFrRDtRQUNsRCx1RkFBdUY7UUFDdkYsb0hBQW9IO1FBQ3BILDBFQUEwRTtRQUMxRSxpRkFBaUY7UUFDakYsNkdBQTZHO1FBQzdHLE1BQU0sbUJBQW1CLEdBQUcsTUFBTSxRQUFRLENBQUMsYUFBYSxDQUFDO1lBQ3ZELFNBQVMsRUFBRSxTQUFTO1NBQ3JCLENBQUMsQ0FBQztRQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsbUJBQW1CLENBQUMsQ0FBQztRQUN2RCxNQUFNLGFBQWEsR0FBRyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLE9BQU8sQ0FBQyxVQUFVLEtBQUssTUFBTSxDQUFDLENBQUM7UUFDMUcsaUJBQWlCLEdBQUcsYUFBYSxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLFFBQVEsQ0FBQztLQUMxRDtJQUVELElBQUksaUJBQWlCLEVBQUU7UUFDckIsTUFBTSxJQUFJLEdBQUcsTUFBTSxRQUFRLENBQUMsV0FBVyxDQUFDO1lBQ3RDLFNBQVMsRUFBRSxTQUFTO1lBQ3BCLGNBQWMsRUFBRTtnQkFDZDtvQkFDRSxDQUFDLGlCQUFpQixDQUFDLEVBQUU7d0JBQ25CLFVBQVUsRUFBRSxNQUFNO3FCQUNuQjtpQkFDRjthQUNGO1NBQ0YsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrQkFBa0IsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUN2QztTQUFNO1FBQ0wsT0FBTyxDQUFDLEdBQUcsQ0FBQyw4REFBOEQsRUFBRSxNQUFNLENBQUMsQ0FBQztLQUNyRjtJQUVELE9BQU8sS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRLElBQUksS0FBSyxDQUFDLFdBQVcsS0FBSyxRQUFRO1FBQ3JFLENBQUMsQ0FBQyxFQUFFLGtCQUFrQixFQUFFLEdBQUcsU0FBUyxJQUFJLE1BQU0sRUFBRSxFQUFFO1FBQ2xELENBQUMsQ0FBQyxFQUFFLENBQUM7QUFDVCxDQUFDO0FBN0NELHdDQTZDQztBQUVNLEtBQUssVUFBVSxpQkFBaUIsQ0FBQyxLQUF3QjtJQUM5RCxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsS0FBSyxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFDO0lBRTNELE1BQU0sUUFBUSxHQUFHLElBQUksMEJBQVEsQ0FBQyxFQUFFLENBQUMsQ0FBQztJQUVsQyxNQUFNLElBQUksR0FBRyxNQUFNLFFBQVEsQ0FBQyxhQUFhLENBQUM7UUFDeEMsU0FBUyxFQUFFLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxTQUFTO0tBQzlDLENBQUMsQ0FBQztJQUNILE9BQU8sQ0FBQyxHQUFHLENBQUMsb0JBQW9CLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFFeEMsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLEtBQUssRUFBRSxXQUFXLEtBQUssUUFBUSxDQUFDO0lBQ3pELE1BQU0sUUFBUSxHQUFHLElBQUksQ0FBQyxLQUFLLEVBQUUsUUFBUSxJQUFJLEVBQUUsQ0FBQztJQUM1QyxNQUFNLGFBQWEsR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsS0FBSyxLQUFLLENBQUMsa0JBQWtCLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDM0YsTUFBTSxhQUFhLEdBQUcsYUFBYSxFQUFFLGFBQWEsS0FBSyxRQUFRLENBQUM7SUFDaEUsTUFBTSw0QkFBNEIsR0FBRyxLQUFLLENBQUMsa0JBQWtCLENBQUMsNEJBQTRCLEtBQUssTUFBTSxDQUFDO0lBRXRHLFFBQVEsS0FBSyxDQUFDLFdBQVcsRUFBRTtRQUN6QixLQUFLLFFBQVEsQ0FBQztRQUNkLEtBQUssUUFBUTtZQUNYLDhDQUE4QztZQUM5QyxPQUFPLEVBQUUsVUFBVSxFQUFFLFdBQVcsSUFBSSxDQUFDLGFBQWEsSUFBSSw0QkFBNEIsQ0FBQyxFQUFFLENBQUM7UUFDeEYsS0FBSyxRQUFRO1lBQ1gsZ0NBQWdDO1lBQ2hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsV0FBVyxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUUsQ0FBQztLQUNyRTtBQUNILENBQUM7QUF6QkQsOENBeUJDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tY29uc29sZSAqL1xuaW1wb3J0IHsgRHluYW1vREIgfSBmcm9tICdAYXdzLXNkay9jbGllbnQtZHluYW1vZGInOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIGltcG9ydC9uby1leHRyYW5lb3VzLWRlcGVuZGVuY2llc1xuaW1wb3J0IHR5cGUgeyBJc0NvbXBsZXRlUmVxdWVzdCwgSXNDb21wbGV0ZVJlc3BvbnNlLCBPbkV2ZW50UmVxdWVzdCwgT25FdmVudFJlc3BvbnNlIH0gZnJvbSAnLi4vLi4vLi4vY3VzdG9tLXJlc291cmNlcy9saWIvcHJvdmlkZXItZnJhbWV3b3JrL3R5cGVzJztcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIG9uRXZlbnRIYW5kbGVyKGV2ZW50OiBPbkV2ZW50UmVxdWVzdCk6IFByb21pc2U8T25FdmVudFJlc3BvbnNlPiB7XG4gIGNvbnNvbGUubG9nKCdFdmVudDogJWonLCB7IC4uLmV2ZW50LCBSZXNwb25zZVVSTDogJy4uLicgfSk7XG5cbiAgY29uc3QgZHluYW1vZGIgPSBuZXcgRHluYW1vREIoe30pO1xuXG4gIGNvbnN0IHRhYmxlTmFtZSA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5UYWJsZU5hbWU7XG4gIGNvbnN0IHJlZ2lvbiA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5SZWdpb247XG5cbiAgbGV0IHVwZGF0ZVRhYmxlQWN0aW9uOiAnQ3JlYXRlJyB8ICdVcGRhdGUnIHwgJ0RlbGV0ZScgfCB1bmRlZmluZWQ7XG4gIGlmIChldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ0NyZWF0ZScgfHwgZXZlbnQuUmVxdWVzdFR5cGUgPT09ICdEZWxldGUnKSB7XG4gICAgdXBkYXRlVGFibGVBY3Rpb24gPSBldmVudC5SZXF1ZXN0VHlwZTtcbiAgfSBlbHNlIHsgLy8gVXBkYXRlXG4gICAgLy8gVGhlcmUgYXJlIHR3byBjYXNlcyB3aGVyZSBhbiBVcGRhdGUgY2FuIGhhcHBlbjpcbiAgICAvLyAxLiBBIHRhYmxlIHJlcGxhY2VtZW50LiBJbiB0aGF0IGNhc2UsIHdlIG5lZWQgdG8gY3JlYXRlIHRoZSByZXBsaWNhIGluIHRoZSBuZXcgVGFibGVcbiAgICAvLyAodGhlIHJlcGxpY2EgZm9yIHRoZSBcIm9sZFwiIFRhYmxlIHdpbGwgYmUgZGVsZXRlZCB3aGVuIENGTiBpc3N1ZXMgYSBEZWxldGUgZXZlbnQgb24gdGhlIG9sZCBwaHlzaWNhbCByZXNvdXJjZSBpZCkuXG4gICAgLy8gMi4gQSBjdXN0b21lciBoYXMgY2hhbmdlZCBvbmUgb2YgdGhlIHByb3BlcnRpZXMgb2YgdGhlIEN1c3RvbSBSZXNvdXJjZSxcbiAgICAvLyBsaWtlICd3YWl0Rm9yUmVwbGljYXRpb25Ub0ZpbmlzaCcuIEluIHRoYXQgY2FzZSwgd2UgZG9uJ3QgaGF2ZSB0byBkbyBhbnl0aGluZy5cbiAgICAvLyBUbyBkaWZmZXJlbnRpYXRlIHRoZSB0d28gY2FzZXMsIHdlIG1ha2UgYW4gQVBJIGNhbGwgdG8gRHluYW1vREIgdG8gY2hlY2sgd2hldGhlciBhIHJlcGxpY2EgYWxyZWFkeSBleGlzdHMuXG4gICAgY29uc3QgZGVzY3JpYmVUYWJsZVJlc3VsdCA9IGF3YWl0IGR5bmFtb2RiLmRlc2NyaWJlVGFibGUoe1xuICAgICAgVGFibGVOYW1lOiB0YWJsZU5hbWUsXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRlc2NyaWJlVGFibGVSZXN1bHQpO1xuICAgIGNvbnN0IHJlcGxpY2FFeGlzdHMgPSBkZXNjcmliZVRhYmxlUmVzdWx0LlRhYmxlPy5SZXBsaWNhcz8uc29tZShyZXBsaWNhID0+IHJlcGxpY2EuUmVnaW9uTmFtZSA9PT0gcmVnaW9uKTtcbiAgICB1cGRhdGVUYWJsZUFjdGlvbiA9IHJlcGxpY2FFeGlzdHMgPyB1bmRlZmluZWQgOiAnQ3JlYXRlJztcbiAgfVxuXG4gIGlmICh1cGRhdGVUYWJsZUFjdGlvbikge1xuICAgIGNvbnN0IGRhdGEgPSBhd2FpdCBkeW5hbW9kYi51cGRhdGVUYWJsZSh7XG4gICAgICBUYWJsZU5hbWU6IHRhYmxlTmFtZSxcbiAgICAgIFJlcGxpY2FVcGRhdGVzOiBbXG4gICAgICAgIHtcbiAgICAgICAgICBbdXBkYXRlVGFibGVBY3Rpb25dOiB7XG4gICAgICAgICAgICBSZWdpb25OYW1lOiByZWdpb24sXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIF0sXG4gICAgfSk7XG4gICAgY29uc29sZS5sb2coJ1VwZGF0ZSB0YWJsZTogJWonLCBkYXRhKTtcbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmxvZyhcIlNraXBwaW5nIHVwZGF0aW5nIFRhYmxlLCBhcyBhIHJlcGxpY2EgaW4gJyVzJyBhbHJlYWR5IGV4aXN0c1wiLCByZWdpb24pO1xuICB9XG5cbiAgcmV0dXJuIGV2ZW50LlJlcXVlc3RUeXBlID09PSAnQ3JlYXRlJyB8fCBldmVudC5SZXF1ZXN0VHlwZSA9PT0gJ1VwZGF0ZSdcbiAgICA/IHsgUGh5c2ljYWxSZXNvdXJjZUlkOiBgJHt0YWJsZU5hbWV9LSR7cmVnaW9ufWAgfVxuICAgIDoge307XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBpc0NvbXBsZXRlSGFuZGxlcihldmVudDogSXNDb21wbGV0ZVJlcXVlc3QpOiBQcm9taXNlPElzQ29tcGxldGVSZXNwb25zZT4ge1xuICBjb25zb2xlLmxvZygnRXZlbnQ6ICVqJywgeyAuLi5ldmVudCwgUmVzcG9uc2VVUkw6ICcuLi4nIH0pO1xuXG4gIGNvbnN0IGR5bmFtb2RiID0gbmV3IER5bmFtb0RCKHt9KTtcblxuICBjb25zdCBkYXRhID0gYXdhaXQgZHluYW1vZGIuZGVzY3JpYmVUYWJsZSh7XG4gICAgVGFibGVOYW1lOiBldmVudC5SZXNvdXJjZVByb3BlcnRpZXMuVGFibGVOYW1lLFxuICB9KTtcbiAgY29uc29sZS5sb2coJ0Rlc2NyaWJlIHRhYmxlOiAlaicsIGRhdGEpO1xuXG4gIGNvbnN0IHRhYmxlQWN0aXZlID0gZGF0YS5UYWJsZT8uVGFibGVTdGF0dXMgPT09ICdBQ1RJVkUnO1xuICBjb25zdCByZXBsaWNhcyA9IGRhdGEuVGFibGU/LlJlcGxpY2FzID8/IFtdO1xuICBjb25zdCByZWdpb25SZXBsaWNhID0gcmVwbGljYXMuZmluZChyID0+IHIuUmVnaW9uTmFtZSA9PT0gZXZlbnQuUmVzb3VyY2VQcm9wZXJ0aWVzLlJlZ2lvbik7XG4gIGNvbnN0IHJlcGxpY2FBY3RpdmUgPSByZWdpb25SZXBsaWNhPy5SZXBsaWNhU3RhdHVzID09PSAnQUNUSVZFJztcbiAgY29uc3Qgc2tpcFJlcGxpY2F0aW9uQ29tcGxldGVkV2FpdCA9IGV2ZW50LlJlc291cmNlUHJvcGVydGllcy5Ta2lwUmVwbGljYXRpb25Db21wbGV0ZWRXYWl0ID09PSAndHJ1ZSc7XG5cbiAgc3dpdGNoIChldmVudC5SZXF1ZXN0VHlwZSkge1xuICAgIGNhc2UgJ0NyZWF0ZSc6XG4gICAgY2FzZSAnVXBkYXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyByZXBvcnRlZCBhcyBBQ1RJVkVcbiAgICAgIHJldHVybiB7IElzQ29tcGxldGU6IHRhYmxlQWN0aXZlICYmIChyZXBsaWNhQWN0aXZlIHx8IHNraXBSZXBsaWNhdGlvbkNvbXBsZXRlZFdhaXQpIH07XG4gICAgY2FzZSAnRGVsZXRlJzpcbiAgICAgIC8vIENvbXBsZXRlIHdoZW4gcmVwbGljYSBpcyBnb25lXG4gICAgICByZXR1cm4geyBJc0NvbXBsZXRlOiB0YWJsZUFjdGl2ZSAmJiByZWdpb25SZXBsaWNhID09PSB1bmRlZmluZWQgfTtcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json index 7fe4fc76e7562..66d1624473f2f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.assets.json @@ -1,15 +1,15 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { - "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4": { + "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4": { "source": { - "path": "asset.a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4", + "path": "asset.654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4", "packaging": "zip" }, "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip", + "objectKey": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } @@ -29,7 +29,7 @@ } } }, - "f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192": { + "fa797e339f4708c4396c4b321b5c32d871a3392d5baced2d17a9b8ad742e5c0b": { "source": { "path": "cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json", "packaging": "file" @@ -37,13 +37,13 @@ "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json", + "objectKey": "fa797e339f4708c4396c4b321b5c32d871a3392d5baced2d17a9b8ad742e5c0b.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } } }, - "3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527": { + "9ebc85633ef1527d7c80b34da1ead09e0bcc8b1a5381dbda27965c4d617a14fa": { "source": { "path": "cdk-dynamodb-global-20191121.template.json", "packaging": "file" @@ -51,7 +51,7 @@ "destinations": { "current_account-eu-west-1": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1", - "objectKey": "3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527.json", + "objectKey": "9ebc85633ef1527d7c80b34da1ead09e0bcc8b1a5381dbda27965c4d617a14fa.json", "region": "eu-west-1", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-eu-west-1" } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json index 9c253ad1fd50e..b97917e938812 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk-dynamodb-global-20191121.template.json @@ -246,7 +246,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json" + "/fa797e339f4708c4396c4b321b5c32d871a3392d5baced2d17a9b8ad742e5c0b.json" ] ] } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out index c5cb2e5de6344..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"35.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json index db87d67192434..5b09d763240e3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderB281C954.nested.template.json @@ -122,7 +122,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "Handler": "index.onEventHandler", "Role": { @@ -177,7 +177,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "S3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "S3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "Handler": "index.isCompleteHandler", "Role": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json similarity index 82% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json index 37640dd523403..24bd5878f2f77 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json @@ -1,9 +1,9 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json", + "path": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json index 974a1052ddaaf..86c845db56291 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/integ.json @@ -1,13 +1,13 @@ { - "version": "35.0.0", + "version": "34.0.0", "testCases": { - "cdk-dynamodb-global-integ-20191121-test/DefaultTest": { + "cdk-dynamodb-global-20191121-test/DefaultTest": { "stacks": [ "cdk-dynamodb-global-20191121" ], "diffAssets": true, - "assertionStack": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert", - "assertionStackName": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095" + "assertionStack": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert", + "assertionStackName": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json index a88bfda80a5c6..693a474a855b6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "34.0.0", "artifacts": { "cdk-dynamodb-global-20191121.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-eu-west-1", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-eu-west-1", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/3b4ab68841d1b5d3c781f91198fb20ebcf94dc9e6125ce8155019524b6c8c527.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1/9ebc85633ef1527d7c80b34da1ead09e0bcc8b1a5381dbda27965c4d617a14fa.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -211,19 +211,19 @@ }, "displayName": "cdk-dynamodb-global-20191121" }, - "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets": { + "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets.json", + "file": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095": { + "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.template.json", + "templateFile": "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -232,7 +232,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets" + "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -241,23 +241,23 @@ } }, "dependencies": [ - "cdkdynamodbglobalinteg20191121testDefaultTestDeployAssert97799095.assets" + "cdkdynamodbglobal20191121testDefaultTestDeployAssert469C3611.assets" ], "metadata": { - "/cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/BootstrapVersion": [ + "/cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert" + "displayName": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json index 990825c782a01..e32dc83a675c8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.js.snapshot/tree.json @@ -186,7 +186,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "SourceTableAttachedManagedPolicy-cdkdynamodbglobal20191121awscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRole39716128": { @@ -278,7 +278,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "Replicaeu-west-2": { @@ -327,22 +327,6 @@ "id": "@aws-cdk--aws-dynamodb.ReplicaProvider", "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider", "children": { - "OnEvent": { - "id": "OnEvent", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEvent", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, - "OnComplete": { - "id": "OnComplete", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnComplete", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, "OnEventHandler": { "id": "OnEventHandler", "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/OnEventHandler", @@ -542,7 +526,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "handler": "index.onEventHandler", "role": { @@ -627,32 +611,6 @@ "version": "0.0.0" } }, - "Code": { - "id": "Code", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Code/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, "Resource": { "id": "Resource", "path": "cdk-dynamodb-global-20191121/@aws-cdk--aws-dynamodb.ReplicaProvider/IsCompleteHandler/Resource", @@ -663,7 +621,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "s3Key": "a66c13b51b3fbe914918d2aa7c27cdd149c533899a3a73517fcc70bc74e548b4.zip" + "s3Key": "654051b03fb3684cba885b9015a42237db092a98a4fd2ffc75f07919dde1aca4.zip" }, "handler": "index.isCompleteHandler", "role": { @@ -1493,7 +1451,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } } }, @@ -1567,7 +1525,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-eu-west-1" }, - "/f8cc0de8fd8b3648ee152ba43e46460b1072238e8623c323d01eac63c9d3c192.json" + "/fa797e339f4708c4396c4b321b5c32d871a3392d5baced2d17a9b8ad742e5c0b.json" ] ] } @@ -1581,7 +1539,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "BootstrapVersion": { @@ -1606,29 +1564,29 @@ "version": "0.0.0" } }, - "cdk-dynamodb-global-integ-20191121-test": { - "id": "cdk-dynamodb-global-integ-20191121-test", - "path": "cdk-dynamodb-global-integ-20191121-test", + "cdk-dynamodb-global-20191121-test": { + "id": "cdk-dynamodb-global-20191121-test", + "path": "cdk-dynamodb-global-20191121-test", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest", + "path": "cdk-dynamodb-global-20191121-test/DefaultTest", "children": { "Default": { "id": "Default", - "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/Default", + "path": "cdk-dynamodb-global-20191121-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "DeployAssert": { "id": "DeployAssert", - "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert", + "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/BootstrapVersion", + "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1636,7 +1594,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "cdk-dynamodb-global-integ-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "cdk-dynamodb-global-20191121-test/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1665,7 +1623,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts index 56e69af775a69..20ec8ffc316dd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global.ts @@ -32,7 +32,7 @@ class TestStack extends Stack { const app = new App(); const stack = new TestStack(app, 'cdk-dynamodb-global-20191121', { env: { region: 'eu-west-1' } }); -new IntegTest(app, 'cdk-dynamodb-global-integ-20191121-test', { +new IntegTest(app, 'cdk-dynamodb-global-20191121-test', { testCases: [stack], diffAssets: true, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json similarity index 94% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json index d4782e45d6caf..b106dbfbee98c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.assets.json @@ -1,5 +1,5 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { "19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec": { "source": { @@ -16,7 +16,7 @@ }, "01f1f22cef4fedb5237147fa8010b633dff484879b4c558102725a9d9494c8fe": { "source": { - "path": "AwsCdkSesReceipt.template.json", + "path": "aws-cdk-ses-receipt.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/AwsCdkSesReceipt.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/aws-cdk-ses-receipt.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out index c5cb2e5de6344..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"35.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json similarity index 84% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json index 1e0f35e80e9e6..dda93d64b6263 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json @@ -1,9 +1,9 @@ { - "version": "35.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json", + "path": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json index fb42b7842f234..56efa0063e353 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/integ.json @@ -1,13 +1,13 @@ { - "version": "35.0.0", + "version": "34.0.0", "testCases": { - "CdkSesReceiptInteg/DefaultTest": { + "cdk-ses-receipt-integ/DefaultTest": { "stacks": [ - "AwsCdkSesReceipt" + "aws-cdk-ses-receipt" ], "diffAssets": true, - "assertionStack": "CdkSesReceiptInteg/DefaultTest/DeployAssert", - "assertionStackName": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0" + "assertionStack": "cdk-ses-receipt-integ/DefaultTest/DeployAssert", + "assertionStackName": "cdksesreceiptintegDefaultTestDeployAssertA2776C75" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json index 1ab73367fb37b..cd61ccb2dddf6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/manifest.json @@ -1,19 +1,19 @@ { - "version": "35.0.0", + "version": "34.0.0", "artifacts": { - "AwsCdkSesReceipt.assets": { + "aws-cdk-ses-receipt.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "AwsCdkSesReceipt.assets.json", + "file": "aws-cdk-ses-receipt.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "AwsCdkSesReceipt": { + "aws-cdk-ses-receipt": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "AwsCdkSesReceipt.template.json", + "templateFile": "aws-cdk-ses-receipt.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -22,7 +22,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "AwsCdkSesReceipt.assets" + "aws-cdk-ses-receipt.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,91 +31,91 @@ } }, "dependencies": [ - "AwsCdkSesReceipt.assets" + "aws-cdk-ses-receipt.assets" ], "metadata": { - "/AwsCdkSesReceipt/RuleSet/Resource": [ + "/aws-cdk-ses-receipt/RuleSet/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetE30C6C48" } ], - "/AwsCdkSesReceipt/RuleSet/DropSpam/Rule/Resource": [ + "/aws-cdk-ses-receipt/RuleSet/DropSpam/Rule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetDropSpamRule5809F51B" } ], - "/AwsCdkSesReceipt/RuleSet/FirstRule/Resource": [ + "/aws-cdk-ses-receipt/RuleSet/FirstRule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetFirstRule0A27C8CC" } ], - "/AwsCdkSesReceipt/RuleSet/SecondRule/Resource": [ + "/aws-cdk-ses-receipt/RuleSet/SecondRule/Resource": [ { "type": "aws:cdk:logicalId", "data": "RuleSetSecondRule03178AD4" } ], - "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource": [ + "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4" } ], - "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource": [ + "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15" } ], - "/AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes": [ + "/aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes": [ { "type": "aws:cdk:logicalId", "data": "SingletonLambda224e77f9a32e4b4dac32983477abba16AllowSesB42DF904" } ], - "/AwsCdkSesReceipt/Allowlist/BlockAll/Resource": [ + "/aws-cdk-ses-receipt/Allowlist/BlockAll/Resource": [ { "type": "aws:cdk:logicalId", "data": "AllowlistBlockAll7E0A7F11" } ], - "/AwsCdkSesReceipt/Allowlist/Allow1000016/Resource": [ + "/aws-cdk-ses-receipt/Allowlist/Allow1000016/Resource": [ { "type": "aws:cdk:logicalId", "data": "AllowlistAllow1000016E9465A18" } ], - "/AwsCdkSesReceipt/BootstrapVersion": [ + "/aws-cdk-ses-receipt/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/AwsCdkSesReceipt/CheckBootstrapVersion": [ + "/aws-cdk-ses-receipt/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "AwsCdkSesReceipt" + "displayName": "aws-cdk-ses-receipt" }, - "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets": { + "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets.json", + "file": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0": { + "cdksesreceiptintegDefaultTestDeployAssertA2776C75": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.template.json", + "templateFile": "cdksesreceiptintegDefaultTestDeployAssertA2776C75.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -124,7 +124,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets" + "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -133,23 +133,23 @@ } }, "dependencies": [ - "CdkSesReceiptIntegDefaultTestDeployAssert45B267B0.assets" + "cdksesreceiptintegDefaultTestDeployAssertA2776C75.assets" ], "metadata": { - "/CdkSesReceiptInteg/DefaultTest/DeployAssert/BootstrapVersion": [ + "/cdk-ses-receipt-integ/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/CdkSesReceiptInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/cdk-ses-receipt-integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "CdkSesReceiptInteg/DefaultTest/DeployAssert" + "displayName": "cdk-ses-receipt-integ/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json index 178ec0c62ed87..a1bfec6fdcbe9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses/test/integ.receipt.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "AwsCdkSesReceipt": { - "id": "AwsCdkSesReceipt", - "path": "AwsCdkSesReceipt", + "aws-cdk-ses-receipt": { + "id": "aws-cdk-ses-receipt", + "path": "aws-cdk-ses-receipt", "children": { "RuleSet": { "id": "RuleSet", - "path": "AwsCdkSesReceipt/RuleSet", + "path": "aws-cdk-ses-receipt/RuleSet", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/RuleSet/Resource", + "path": "aws-cdk-ses-receipt/RuleSet/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRuleSet", "aws:cdk:cloudformation:props": {} @@ -26,11 +26,11 @@ }, "DropSpam": { "id": "DropSpam", - "path": "AwsCdkSesReceipt/RuleSet/DropSpam", + "path": "aws-cdk-ses-receipt/RuleSet/DropSpam", "children": { "Function": { "id": "Function", - "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Function", + "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Function", "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction", "version": "0.0.0" @@ -38,11 +38,11 @@ }, "Rule": { "id": "Rule", - "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Rule", + "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Rule", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/RuleSet/DropSpam/Rule/Resource", + "path": "aws-cdk-ses-receipt/RuleSet/DropSpam/Rule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -87,11 +87,11 @@ }, "FirstRule": { "id": "FirstRule", - "path": "AwsCdkSesReceipt/RuleSet/FirstRule", + "path": "aws-cdk-ses-receipt/RuleSet/FirstRule", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/RuleSet/FirstRule/Resource", + "path": "aws-cdk-ses-receipt/RuleSet/FirstRule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -125,11 +125,11 @@ }, "SecondRule": { "id": "SecondRule", - "path": "AwsCdkSesReceipt/RuleSet/SecondRule", + "path": "aws-cdk-ses-receipt/RuleSet/SecondRule", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/RuleSet/SecondRule/Resource", + "path": "aws-cdk-ses-receipt/RuleSet/SecondRule/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptRule", "aws:cdk:cloudformation:props": { @@ -163,15 +163,15 @@ }, "SingletonLambda224e77f9a32e4b4dac32983477abba16": { "id": "SingletonLambda224e77f9a32e4b4dac32983477abba16", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/ImportServiceRole", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -179,7 +179,7 @@ }, "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -224,11 +224,11 @@ }, "Code": { "id": "Code", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code", "children": { "Stage": { "id": "Stage", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/Stage", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" @@ -236,7 +236,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/AssetBucket", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" @@ -250,7 +250,7 @@ }, "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -277,7 +277,7 @@ }, "AllowSes": { "id": "AllowSes", - "path": "AwsCdkSesReceipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes", + "path": "aws-cdk-ses-receipt/SingletonLambda224e77f9a32e4b4dac32983477abba16/AllowSes", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { @@ -307,15 +307,15 @@ }, "Allowlist": { "id": "Allowlist", - "path": "AwsCdkSesReceipt/Allowlist", + "path": "aws-cdk-ses-receipt/Allowlist", "children": { "BlockAll": { "id": "BlockAll", - "path": "AwsCdkSesReceipt/Allowlist/BlockAll", + "path": "aws-cdk-ses-receipt/Allowlist/BlockAll", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/Allowlist/BlockAll/Resource", + "path": "aws-cdk-ses-receipt/Allowlist/BlockAll/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptFilter", "aws:cdk:cloudformation:props": { @@ -340,11 +340,11 @@ }, "Allow1000016": { "id": "Allow1000016", - "path": "AwsCdkSesReceipt/Allowlist/Allow1000016", + "path": "aws-cdk-ses-receipt/Allowlist/Allow1000016", "children": { "Resource": { "id": "Resource", - "path": "AwsCdkSesReceipt/Allowlist/Allow1000016/Resource", + "path": "aws-cdk-ses-receipt/Allowlist/Allow1000016/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SES::ReceiptFilter", "aws:cdk:cloudformation:props": { @@ -375,7 +375,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "AwsCdkSesReceipt/BootstrapVersion", + "path": "aws-cdk-ses-receipt/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -383,7 +383,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "AwsCdkSesReceipt/CheckBootstrapVersion", + "path": "aws-cdk-ses-receipt/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -395,29 +395,29 @@ "version": "0.0.0" } }, - "CdkSesReceiptInteg": { - "id": "CdkSesReceiptInteg", - "path": "CdkSesReceiptInteg", + "cdk-ses-receipt-integ": { + "id": "cdk-ses-receipt-integ", + "path": "cdk-ses-receipt-integ", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "CdkSesReceiptInteg/DefaultTest", + "path": "cdk-ses-receipt-integ/DefaultTest", "children": { "Default": { "id": "Default", - "path": "CdkSesReceiptInteg/DefaultTest/Default", + "path": "cdk-ses-receipt-integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } }, "DeployAssert": { "id": "DeployAssert", - "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert", + "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert/BootstrapVersion", + "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -425,7 +425,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "CdkSesReceiptInteg/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "cdk-ses-receipt-integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -454,7 +454,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.2.70" } } }, From 81b7796f83a2f01d4242ad4f2b228a616b17a358 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 18:02:33 -0800 Subject: [PATCH 61/74] handler path Signed-off-by: Francis --- packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts index 65f9d21d6758e..c9ea7ed3f5ff4 100644 --- a/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts +++ b/packages/aws-cdk-lib/aws-dynamodb/lib/replica-provider.ts @@ -58,13 +58,13 @@ export class ReplicaProvider extends NestedStack { super(scope, id); const onEventHandler = new CdkHandler(this, 'OnEvent', { - codeDirectory: path.join(__dirname, 'replica-handler'), + codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-dynamodb', 'replica-handler'), entrypoint: 'index.onEventHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); const onCompleteHandler = new CdkHandler(this, 'OnComplete', { - codeDirectory: path.join(__dirname, 'replica-handler'), + codeDirectory: path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-dynamodb', 'replica-handler'), entrypoint: 'index.isCompleteHandler', compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); From a68a85418258a2e3b44206e33d95dc5038d8212d Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 18:33:22 -0800 Subject: [PATCH 62/74] custom resource props format Signed-off-by: Francis --- .../aws-cloudfront/lib/experimental/edge-function.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index f209c6d311304..0a428be5b70b1 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -213,8 +213,8 @@ export class EdgeFunction extends Resource implements lambda.IVersion { }); const resource = new CustomResource(this, 'ArnReader', { - resourceType: resourceType, - serviceToken: serviceToken, + resourceType, + serviceToken, properties: { Region: EdgeFunction.EDGE_REGION, ParameterName: parameterName, From ffa888dc08c2032beb99be6c3d44d256a869b224 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 18:42:07 -0800 Subject: [PATCH 63/74] refactor deprecated runtimes unit tests to use test.each Signed-off-by: Francis --- .../aws-lambda/test/runtime.test.ts | 81 +++++-------------- 1 file changed, 19 insertions(+), 62 deletions(-) diff --git a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts index 2f4fedefeed45..5a6a421a9cb80 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/runtime.test.ts @@ -57,67 +57,24 @@ describe('runtime', () => { }); describe('deprecated runtimes', () => { - test('python 2.7 is deprecated', () => { - expect(lambda.Runtime.PYTHON_2_7.isDeprecated).toEqual(true); - }); - - test('python 3.6 is deprecated', () => { - expect(lambda.Runtime.PYTHON_3_6.isDeprecated).toEqual(true); - }); - - test('nodejs is deprecated', () => { - expect(lambda.Runtime.NODEJS.isDeprecated).toEqual(true); - }); - - test('nodejs 4.3 is deprecated', () => { - expect(lambda.Runtime.NODEJS_4_3.isDeprecated).toEqual(true); - }); - - test('nodejs 6.10 is deprecated', () => { - expect(lambda.Runtime.NODEJS_6_10.isDeprecated).toEqual(true); - }); - - test('nodejs 8.10 is deprecated', () => { - expect(lambda.Runtime.NODEJS_8_10.isDeprecated).toEqual(true); - }); - - test('nodejs 10.x is deprecated', () => { - expect(lambda.Runtime.NODEJS_10_X.isDeprecated).toEqual(true); - }); - - test('nodejs 12.x is deprecated', () => { - expect(lambda.Runtime.NODEJS_12_X.isDeprecated).toEqual(true); - }); - - test('nodejs 14.x is deprecated', () => { - expect(lambda.Runtime.NODEJS_14_X.isDeprecated).toEqual(true); - }); - - test('.net core 1.0 is deprecated', () => { - expect(lambda.Runtime.DOTNET_CORE_1.isDeprecated).toEqual(true); - }); - - test('.net core 2.0 is deprecated', () => { - expect(lambda.Runtime.DOTNET_CORE_2.isDeprecated).toEqual(true); - }); - - test('.net core 2.1 is deprecated', () => { - expect(lambda.Runtime.DOTNET_CORE_2_1.isDeprecated).toEqual(true); - }); - - test('.net core 3.1 is deprecated', () => { - expect(lambda.Runtime.DOTNET_CORE_3_1.isDeprecated).toEqual(true); - }); - - test('go 1.x is deprecated', () => { - expect(lambda.Runtime.GO_1_X.isDeprecated).toEqual(true); - }); - - test('ruby 2.5 is deprecated', () => { - expect(lambda.Runtime.RUBY_2_5.isDeprecated).toEqual(true); - }); - - test('custom provided runtime is deprecated', () => { - expect(lambda.Runtime.PROVIDED.isDeprecated).toEqual(true); + test.each([ + [lambda.Runtime.PYTHON_2_7], + [lambda.Runtime.PYTHON_3_6], + [lambda.Runtime.NODEJS], + [lambda.Runtime.NODEJS_4_3], + [lambda.Runtime.NODEJS_6_10], + [lambda.Runtime.NODEJS_8_10], + [lambda.Runtime.NODEJS_10_X], + [lambda.Runtime.NODEJS_12_X], + [lambda.Runtime.NODEJS_14_X], + [lambda.Runtime.DOTNET_CORE_1], + [lambda.Runtime.DOTNET_CORE_2], + [lambda.Runtime.DOTNET_CORE_2_1], + [lambda.Runtime.DOTNET_CORE_3_1], + [lambda.Runtime.GO_1_X], + [lambda.Runtime.RUBY_2_5], + [lambda.Runtime.PROVIDED], + ])('%s is deprecated', (runtime) => { + expect(runtime.isDeprecated).toEqual(true); }); }); From fc02c0b2ca16c372d9922a583e1ccafe70aa2400 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 19:07:22 -0800 Subject: [PATCH 64/74] fixed cdk handler unit tests Signed-off-by: Francis --- .../handler-framework/test/cdk-handler.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts index b7cc17945762d..b747c5f23882a 100644 --- a/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-handler.test.ts @@ -4,14 +4,15 @@ import { Stack } from '../../core'; import { CdkHandler } from '../lib/cdk-handler'; describe('cdk handler', () => { - let stack: Stack; let codeDirectory: string; beforeAll(() => { - stack = new Stack(); codeDirectory = path.join(__dirname, 'test-handler'); }); test('code directory property is correctly set', () => { + // GIVEN + const stack = new Stack(); + // WHEN const handler = new CdkHandler(stack, 'CdkHandler', { codeDirectory, @@ -23,6 +24,9 @@ describe('cdk handler', () => { }); test('runtime property is correctly set', () => { + // GIVEN + const stack = new Stack(); + // WHEN const handler = new CdkHandler(stack, 'CdkHandler', { codeDirectory, @@ -34,6 +38,9 @@ describe('cdk handler', () => { }); test('index.handler is default entrypoint', () => { + // GIVEN + const stack = new Stack(); + // WHEN const handler = new CdkHandler(stack, 'CdkHandler', { codeDirectory, @@ -45,6 +52,9 @@ describe('cdk handler', () => { }); test('entrypoint property is set correctly for non-default entrypoint', () => { + // GIVEN + const stack = new Stack(); + // WHEN const handler = new CdkHandler(stack, 'CdkHandler', { codeDirectory, From 6b8542d8d659450de7cdb5ff0dbf3371f3d77a8b Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 29 Nov 2023 19:15:44 -0800 Subject: [PATCH 65/74] fixed cdk custom resource provider unit tests Signed-off-by: Francis --- .../cdk-custom-resource-provider.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts b/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts index f7de24d58cf2b..8fe79ba3a6293 100644 --- a/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts +++ b/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts @@ -257,7 +257,7 @@ describe('cdk custom resource provider', () => { 'Arn', ], }, - Runtime: STANDARD_PROVIDER, + Runtime: STANDARD_PROVIDER.name, }, DependsOn: [ 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', From 9ee148c95b6f67abdd9cccd826bdcd05d14fbf97 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 09:00:21 -0800 Subject: [PATCH 66/74] update aws custom resource to use nodejs18 Signed-off-by: Francis --- .../lib/aws-custom-resource/aws-custom-resource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index 0c14c939f2c66..a7a373de9d5d5 100644 --- a/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -450,7 +450,7 @@ export class AwsCustomResource extends Construct implements iam.IGrantable { const handler = new CdkHandler(this, 'Handler', { codeDirectory: path.join(__dirname, '..', '..', '..', 'custom-resource-handlers', 'dist', 'custom-resources', 'aws-custom-resource-handler'), - compatibleRuntimes: [lambda.Runtime.NODEJS_LATEST], + compatibleRuntimes: [lambda.Runtime.NODEJS_18_X], }); const provider = new CdkSingletonFunction(this, 'Provider', { From 4856943c64a3e7eda4aede1412aed1f735017a82 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 09:10:21 -0800 Subject: [PATCH 67/74] use code from asset in cdk handler Signed-off-by: Francis --- .../aws-cdk-lib/handler-framework/lib/cdk-function.ts | 4 ++-- packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts | 8 +++++++- .../handler-framework/lib/cdk-singleton-function.ts | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts index e96ec15ef16ae..bd2a40af59e43 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { Code, Function, FunctionOptions } from '../../aws-lambda'; +import { Function, FunctionOptions } from '../../aws-lambda'; /** * Properties used to define a Lambda function used as a custom resource provider. @@ -19,7 +19,7 @@ export class CdkFunction extends Function { public constructor(scope: Construct, id: string, props: CdkFunctionProps) { super(scope, id, { ...props, - code: Code.fromAsset(props.handler.codeDirectory), + code: props.handler.code, handler: props.handler.entrypoint, runtime: props.handler.runtime, }); diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts index 77009e6e7a82f..b0c35a69874b0 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-handler.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { RuntimeDeterminer } from './utils/runtime-determiner'; -import { Runtime } from '../../aws-lambda'; +import { Code, Runtime } from '../../aws-lambda'; /** * Properties used to define source code executed within a Lambda function acting as a @@ -36,6 +36,11 @@ export class CdkHandler extends Construct { */ public readonly codeDirectory: string; + /** + * The source code of your Lambda function. + */ + public readonly code: Code; + /** * The name of the method within your code that Lambda calls to execute your function. */ @@ -49,6 +54,7 @@ export class CdkHandler extends Construct { public constructor(scope: Construct, id: string, props: CdkHandlerProps) { super(scope, id); this.codeDirectory = props.codeDirectory; + this.code = Code.fromAsset(props.codeDirectory); this.entrypoint = props.entrypoint ?? 'index.handler'; this.runtime = RuntimeDeterminer.determineLatestRuntime(props.compatibleRuntimes); } diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts index 028e703dd2307..de0308fd278e5 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-singleton-function.ts @@ -1,6 +1,6 @@ import { Construct } from 'constructs'; import { CdkHandler } from './cdk-handler'; -import { Code, FunctionOptions, SingletonFunction } from '../../aws-lambda'; +import { FunctionOptions, SingletonFunction } from '../../aws-lambda'; /** * Properties used to define a singleton Lambda function to be used as a custom resource @@ -39,7 +39,7 @@ export class CdkSingletonFunction extends SingletonFunction { public constructor(scope: Construct, id: string, props: CdkSingletonFunctionProps) { super(scope, id, { ...props, - code: Code.fromAsset(props.handler.codeDirectory), + code: props.handler.code, handler: props.handler.entrypoint, runtime: props.handler.runtime, }); From 3fa4aac75f28520dec3d20676930b290af25a145 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 12:19:20 -0800 Subject: [PATCH 68/74] moved all framework files under handler-framework module Signed-off-by: Francis --- .../lib/experimental/edge-function.ts | 2 +- .../custom-resource-provider-base.ts | 2 +- .../aws-cdk-lib/handler-framework/README.md | 4 +++- .../lib}/cdk-custom-resource-provider.ts | 6 ++---- .../test}/cdk-custom-resource-provider.test.ts | 17 ++++++++++------- 5 files changed, 17 insertions(+), 14 deletions(-) rename packages/aws-cdk-lib/{core/lib/custom-resource-provider => handler-framework/lib}/cdk-custom-resource-provider.ts (89%) rename packages/aws-cdk-lib/{core/test/custom-resource-provider => handler-framework/test}/cdk-custom-resource-provider.test.ts (96%) diff --git a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts index 0a428be5b70b1..0478646c1e38e 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/lib/experimental/edge-function.ts @@ -14,7 +14,7 @@ import { Stage, Token, } from '../../../core'; -import { CdkCustomResourceProvider } from '../../../core/lib/custom-resource-provider/cdk-custom-resource-provider'; +import { CdkCustomResourceProvider } from '../../../handler-framework/lib/cdk-custom-resource-provider'; import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; /** diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts index d2d59ca436e54..ecd8f72f42d41 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider-base.ts @@ -28,7 +28,7 @@ export interface CustomResourceProviderBaseProps extends CustomResourceProviderO readonly codeDirectory: string; /** - * The AWS Lambda runtime and version to use for the provider. + * The AWS Lambda runtime and version name to use for the provider. */ readonly runtimeName: string; } diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md index 4e6dddb19c586..b5d26fd529277 100644 --- a/packages/aws-cdk-lib/handler-framework/README.md +++ b/packages/aws-cdk-lib/handler-framework/README.md @@ -1,6 +1,6 @@ # AWS CDK Vended Handler Framework -This module is an internal framework used to establish best practices for vending Lambda handlers that are deployed to user accounts. Primarily, this framework includes a centralized definition of the default runtime version which is the latest version of NodeJs available across all AWS Regions. +The handler framework module is an internal framework used to establish best practices for vending Lambda handlers that are deployed to user accounts. Primarily, this framework includes a centralized definition of the default runtime version which is the latest version of NodeJs available across all AWS Regions. In addition to including a default runtime version, this framework forces the user to specify `compatibleRuntimes` for each Lambda handler being used. The framework first checks for the default runtime in the list of `compatibleRuntimes`. If found, the default runtime is used. If not found, the framework will look for the latest defined runtime in the list of `compatibleRuntimes`. If the latest runtime found is marked as deprecated, then the framework will force the build to fail. To continue, the user must specify a non-deprecated runtime version that the handler code is compatible with. @@ -59,3 +59,5 @@ const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { const fn = new CdkSingletonFunction(stack, 'CdkSingletonFunction', { handler }); ``` + +## CDK Custom Resource Provider diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts similarity index 89% rename from packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts rename to packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts index 1fac09d7913b0..33659182ca37f 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts @@ -1,8 +1,6 @@ import { Construct } from 'constructs'; -import { CustomResourceProviderBase } from './custom-resource-provider-base'; -import { CustomResourceProviderOptions } from './shared'; -import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; -import { Stack } from '../stack'; +import { CdkHandler } from './cdk-handler'; +import { Stack, CustomResourceProviderBase, CustomResourceProviderOptions } from '../../core'; /** * Initialization properties for `CdkCustomResourceProvider` diff --git a/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts b/packages/aws-cdk-lib/handler-framework/test/cdk-custom-resource-provider.test.ts similarity index 96% rename from packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts rename to packages/aws-cdk-lib/handler-framework/test/cdk-custom-resource-provider.test.ts index 8fe79ba3a6293..54488b3620f1a 100644 --- a/packages/aws-cdk-lib/core/test/custom-resource-provider/cdk-custom-resource-provider.test.ts +++ b/packages/aws-cdk-lib/handler-framework/test/cdk-custom-resource-provider.test.ts @@ -1,12 +1,15 @@ import * as fs from 'fs'; import * as path from 'path'; -import { Runtime } from '../../../aws-lambda'; -import * as cxapi from '../../../cx-api'; -import { CdkHandler } from '../../../handler-framework/lib/cdk-handler'; -import { App, AssetStaging, DockerImageAssetLocation, DockerImageAssetSource, Duration, FileAssetLocation, FileAssetSource, ISynthesisSession, Size, Stack, CfnResource } from '../../lib'; -import { CdkCustomResourceProvider } from '../../lib/custom-resource-provider/cdk-custom-resource-provider'; -import { CUSTOMIZE_ROLES_CONTEXT_KEY } from '../../lib/helpers-internal'; -import { toCloudFormation } from '../util'; +import { Runtime } from '../../aws-lambda'; +import { + App, AssetStaging, DockerImageAssetLocation, DockerImageAssetSource, Duration, + FileAssetLocation, FileAssetSource, ISynthesisSession, Size, Stack, CfnResource, +} from '../../core'; +import { CUSTOMIZE_ROLES_CONTEXT_KEY } from '../../core/lib/helpers-internal'; +import { toCloudFormation } from '../../core/test/util'; +import * as cxapi from '../../cx-api'; +import { CdkCustomResourceProvider } from '../lib/cdk-custom-resource-provider'; +import { CdkHandler } from '../lib/cdk-handler'; const TEST_HANDLER = `${__dirname}/mock-provider`; const STANDARD_PROVIDER = Runtime.NODEJS_18_X; From 7048170e2393fb61ee95c271572c064681c34619 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 13:28:36 -0800 Subject: [PATCH 69/74] readme Signed-off-by: Francis --- .../aws-cdk-lib/handler-framework/README.md | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/packages/aws-cdk-lib/handler-framework/README.md b/packages/aws-cdk-lib/handler-framework/README.md index b5d26fd529277..d7556fa95cd2b 100644 --- a/packages/aws-cdk-lib/handler-framework/README.md +++ b/packages/aws-cdk-lib/handler-framework/README.md @@ -7,17 +7,21 @@ In addition to including a default runtime version, this framework forces the us ## CDK Handler `CdkHandler` is a class that represents the source code that will be executed within a Lambda `Function` acting as a custom resource provider. Once constructed, this class contains three attributes: -1. `code` - the source code that is loaded from a local disk path -2. `entrypoint` - the name of the method within your `code` that Lambda calls to execute your `Function` -3. `compatibleRuntimes` - the runtimes that your `code` is compatible with +1. `codeDirectory` - the local file system directory with the provider's code. This the code that will be bundled into a zip asset and wired to the provider's AWS Lambda function. +2. `code` - the source code that is loaded from a local disk path +3. `entrypoint` - the name of the method within your `code` that Lambda calls to execute your `Function`. Note that the default entrypoint is 'index.handler' +4. `compatibleRuntimes` - the runtimes that your `code` is compatible with -Note that `compatibleRuntimes` can be any python or nodejs runtimes, but the nodejs runtime family are preferred. Python runtimes are supported to provide support for legacy handler code that was written using python. +Note that `compatibleRuntimes` can be any python or nodejs runtimes, but the nodejs runtime family is preferred. Python runtimes are supported to provide support for legacy handler code that was written using python. The following is an example of how to use `CdkHandler`: ```ts -const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { - entrypoint: 'index.handler', +const stack = new Stack(); + +const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: path.join(__dirname, 'my-handler'), + entrypoint: 'index.onEventHandler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); ``` @@ -33,8 +37,9 @@ The following is an example of how to use `CdkFunction`: ```ts const stack = new Stack(); -const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { - entrypoint: 'index.handler', +const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: path.join(__dirname, 'my-handler'), + entrypoint: 'index.onEventHandler', compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); @@ -52,8 +57,8 @@ The following is an example of how to use `CdkSingletonFunction`: ```ts const stack = new Stack(); -const handler = CdkHandler.fromAsset(path.join(__dirname, 'my-handler'), { - entrypoint: 'index.handler', +const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: path.join(__dirname, 'my-handler'), compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], }); @@ -61,3 +66,19 @@ const fn = new CdkSingletonFunction(stack, 'CdkSingletonFunction', { handler }); ``` ## CDK Custom Resource Provider + +The `CdkCustomResourceProvider` construct enables the construction of a custom resource provider with runtime compatibility checking. The key difference between `CdkCustomResourceProvider` and `CustomResourceProvider` is that `CdkHandler` is a required property when using the static `getOrCreate` or `getOrCreateProvider` methods. + +The following is an example of how to use `CdkCustomResourceProvider`: + +```ts +const stack = new Stack(); + +const handler = new CdkHandler(stack, 'Handler', { + codeDirectory: path.join(__dirname, 'my-handler'), + compatibleRuntimes: [Runtime.NODEJS_16_X, Runtime.NODEJS_18_X], +}); + +const resourceType = 'Custom::Resource'; +const serviceToken = CdkCustomResourceProvider.getOrCreate(this, resourceType, { handler }); +``` From 437842fd9a0d6357377c29b8983e4f9f285bed75 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 13:32:50 -0800 Subject: [PATCH 70/74] mock provider Signed-off-by: Francis --- .../aws-cdk-lib/handler-framework/test/mock-provider/.gitignore | 1 + .../aws-cdk-lib/handler-framework/test/mock-provider/index.js | 0 2 files changed, 1 insertion(+) create mode 100644 packages/aws-cdk-lib/handler-framework/test/mock-provider/.gitignore create mode 100644 packages/aws-cdk-lib/handler-framework/test/mock-provider/index.js diff --git a/packages/aws-cdk-lib/handler-framework/test/mock-provider/.gitignore b/packages/aws-cdk-lib/handler-framework/test/mock-provider/.gitignore new file mode 100644 index 0000000000000..033e6722bb6e0 --- /dev/null +++ b/packages/aws-cdk-lib/handler-framework/test/mock-provider/.gitignore @@ -0,0 +1 @@ +!index.js diff --git a/packages/aws-cdk-lib/handler-framework/test/mock-provider/index.js b/packages/aws-cdk-lib/handler-framework/test/mock-provider/index.js new file mode 100644 index 0000000000000..e69de29bb2d1d From 8dff028f0eb1601ede8542d932c8b589097cc0de Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Nov 2023 13:36:14 -0800 Subject: [PATCH 71/74] doc string Signed-off-by: Francis --- .../handler-framework/lib/cdk-custom-resource-provider.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts index 33659182ca37f..3f0ff7012d172 100644 --- a/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts +++ b/packages/aws-cdk-lib/handler-framework/lib/cdk-custom-resource-provider.ts @@ -37,8 +37,7 @@ export class CdkCustomResourceProvider extends CustomResourceProviderBase { * construct. * @param props Provider properties which will only be applied when the * provider is first created. - * @returns the service token of the custom resource provider, which should be - * used when defining a `CustomResource`. + * @returns the custom resource provider. */ public static getOrCreateProvider(scope: Construct, uniqueid: string, props: CdkCustomResourceProviderProps) { const id = `${uniqueid}CustomResourceProvider`; From 569eedbb110e6c2a91159e0ed0d11671d8b3b699 Mon Sep 17 00:00:00 2001 From: Francis Date: Fri, 1 Dec 2023 13:50:04 -0800 Subject: [PATCH 72/74] initial code for framework codegen Signed-off-by: Francis --- .../cdk-handler-framework/.eslintrc.js | 15 ++ .../@aws-cdk/cdk-handler-framework/.gitignore | 19 ++ .../@aws-cdk/cdk-handler-framework/.npmignore | 29 +++ .../@aws-cdk/cdk-handler-framework/LICENSE | 201 ++++++++++++++++++ .../@aws-cdk/cdk-handler-framework/NOTICE | 2 + .../lib/handler-framework.ts | 36 ++++ .../cdk-handler-framework/lib/index.ts | 0 .../cdk-handler-framework/package.json | 59 +++++ .../test/handler-framework.test.ts | 9 + .../cdk-handler-framework/tsconfig.dev.json | 24 +++ 10 files changed, 394 insertions(+) create mode 100644 packages/@aws-cdk/cdk-handler-framework/.eslintrc.js create mode 100644 packages/@aws-cdk/cdk-handler-framework/.gitignore create mode 100644 packages/@aws-cdk/cdk-handler-framework/.npmignore create mode 100644 packages/@aws-cdk/cdk-handler-framework/LICENSE create mode 100644 packages/@aws-cdk/cdk-handler-framework/NOTICE create mode 100644 packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts create mode 100644 packages/@aws-cdk/cdk-handler-framework/lib/index.ts create mode 100644 packages/@aws-cdk/cdk-handler-framework/package.json create mode 100644 packages/@aws-cdk/cdk-handler-framework/test/handler-framework.test.ts create mode 100644 packages/@aws-cdk/cdk-handler-framework/tsconfig.dev.json diff --git a/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js b/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js new file mode 100644 index 0000000000000..bae9a67cd8758 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js @@ -0,0 +1,15 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.dev.json'; +baseConfig.rules['import/no-extraneous-dependencies'] = [ + 'error', + { + devDependencies: [ + '**/build-tools/**', + '**/scripts/**', + '**/test/**', + ], + optionalDependencies: false, + peerDependencies: true, + } +]; +module.exports = baseConfig; diff --git a/packages/@aws-cdk/cdk-handler-framework/.gitignore b/packages/@aws-cdk/cdk-handler-framework/.gitignore new file mode 100644 index 0000000000000..d8a8561d50885 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/.gitignore @@ -0,0 +1,19 @@ +*.js +*.js.map +*.d.ts +tsconfig.json +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +nyc.config.js +.LAST_PACKAGE +*.snk +!.eslintrc.js +!jest.config.js + +junit.xml \ No newline at end of file diff --git a/packages/@aws-cdk/cdk-handler-framework/.npmignore b/packages/@aws-cdk/cdk-handler-framework/.npmignore new file mode 100644 index 0000000000000..5ddbf25e19336 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/.npmignore @@ -0,0 +1,29 @@ +# Don't include original .ts files when doing `npm pack` +*.ts +!*.d.ts +coverage +.nyc_output +*.tgz + +dist +.LAST_PACKAGE +.LAST_BUILD +!*.js + +# Include .jsii +!.jsii + +*.snk + +*.tsbuildinfo + +tsconfig.json +.eslintrc.js +jest.config.js + +# exclude cdk artifacts +**/cdk.out +junit.xml +test/ +!*.lit.ts +**/*.snapshot \ No newline at end of file diff --git a/packages/@aws-cdk/cdk-handler-framework/LICENSE b/packages/@aws-cdk/cdk-handler-framework/LICENSE new file mode 100644 index 0000000000000..9b722c65c5481 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk/cdk-handler-framework/NOTICE b/packages/@aws-cdk/cdk-handler-framework/NOTICE new file mode 100644 index 0000000000000..a27b7dd317649 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts new file mode 100644 index 0000000000000..fa68e8a1e828b --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts @@ -0,0 +1,36 @@ +import { Module, ClassType, TypeScriptRenderer, PropertySpec, Type } from '@cdklabs/typewriter'; + +export abstract class FrameworkGenerator { + /** + * Generates a CdkHandler class that can be rendered to produce code. + */ + public static generateCdkHandler() { + return new (class CdkHandlerGenerator extends FrameworkGenerator { + public constructor() { + const module = new Module('cdk-handler'); + + const codeDirectoryProperty: PropertySpec = { + name: 'codeDirectory', + type: Type.STRING, + }; + + new ClassType(module, { + name: 'CdkHandler', + properties: [codeDirectoryProperty], + }); + super(module); + } + })(); + } + + public readonly renderer = new TypeScriptRenderer(); + + protected constructor(public readonly module: Module) {} + + /** + * Render code for the framework. + */ + public render() { + return this.renderer.render(this.module); + }; +} diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/index.ts b/packages/@aws-cdk/cdk-handler-framework/lib/index.ts new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/@aws-cdk/cdk-handler-framework/package.json b/packages/@aws-cdk/cdk-handler-framework/package.json new file mode 100644 index 0000000000000..bfcd5c5da690e --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/package.json @@ -0,0 +1,59 @@ +{ + "name": "@aws-cdk/cdk-handler-framework", + "version": "0.0.0", + "private": true, + "description": "CDK Vended Handler Framework", + "scripts": { + "build": "cdk-build", + "integ": "integ-runner", + "lint": "cdk-lint", + "package": "cdk-package", + "awslint": "cdk-awslint", + "pkglint": "pkglint -f", + "test": "cdk-test", + "watch": "cdk-watch", + "build+test": "yarn build && yarn test", + "build+test+package": "yarn build+test && yarn package", + "compat": "cdk-compat", + "build+extract": "yarn build", + "build+test+extract": "yarn build+test" + }, + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@aws-cdk/cdk-build-tools": "0.0.0", + "@aws-cdk/pkglint": "0.0.0" + }, + "dependencies": { + "@cdklabs/typewriter": "^0.0.3" + }, + "peerDependencies": { + "aws-cdk-lib": "^0.0.0", + "constructs": "^10.0.0" + }, + "repository": { + "url": "https://github.com/aws/aws-cdk.git", + "type": "git", + "directory": "packages/@aws-cdk/cdk-handler-framework" + }, + "keywords": [ + "aws", + "cdk" + ], + "homepage": "https://github.com/aws/aws-cdk", + "engines": { + "node": ">= 14.15.0" + }, + "cdk-package": { + "shrinkWrap": true + }, + "stability": "experimental", + "maturity": "experimental", + "publishConfig": { + "tag": "latest" + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/cdk-handler-framework/test/handler-framework.test.ts b/packages/@aws-cdk/cdk-handler-framework/test/handler-framework.test.ts new file mode 100644 index 0000000000000..0d1e4d76f8e8e --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/test/handler-framework.test.ts @@ -0,0 +1,9 @@ +import { FrameworkGenerator } from '../lib/handler-framework'; + +describe('framework generator', () => { + test('generate and render cdk handler', () => { + const cdkHandler = FrameworkGenerator.generateCdkHandler(); + /* eslint-disable no-console */ + console.log(cdkHandler.render()); + }); +}); diff --git a/packages/@aws-cdk/cdk-handler-framework/tsconfig.dev.json b/packages/@aws-cdk/cdk-handler-framework/tsconfig.dev.json new file mode 100644 index 0000000000000..e7bd34931012a --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/tsconfig.dev.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["es2020", "dom"], + "strict": true, + "alwaysStrict": true, + "declaration": true, + "inlineSourceMap": true, + "inlineSources": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "resolveJsonModule": true, + "composite": true, + "incremental": true, + "skipLibCheck": true, + }, + "include": [ + "**/*.ts", + "**/*.d.ts", + ], +} From c90a85abdbaa18c39a0a12e2a69bee62955930bf Mon Sep 17 00:00:00 2001 From: Francis Date: Sat, 2 Dec 2023 14:17:28 -0800 Subject: [PATCH 73/74] framewokr codegen Signed-off-by: Francis --- .../cdk-handler-framework/.eslintrc.js | 14 +--- .../cdk-handler-framework/lib/cdk-imports.ts | 39 +++++++++++ .../lib/class-builder.ts | 65 +++++++++++++++++++ .../lib/handler-framework.ts | 41 +++++++----- .../cdk-handler-framework/lib/index.ts | 0 .../cdk-handler-framework/package.json | 6 +- 6 files changed, 134 insertions(+), 31 deletions(-) create mode 100644 packages/@aws-cdk/cdk-handler-framework/lib/cdk-imports.ts create mode 100644 packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts delete mode 100644 packages/@aws-cdk/cdk-handler-framework/lib/index.ts diff --git a/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js b/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js index bae9a67cd8758..2658ee8727166 100644 --- a/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js +++ b/packages/@aws-cdk/cdk-handler-framework/.eslintrc.js @@ -1,15 +1,3 @@ const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); -baseConfig.parserOptions.project = __dirname + '/tsconfig.dev.json'; -baseConfig.rules['import/no-extraneous-dependencies'] = [ - 'error', - { - devDependencies: [ - '**/build-tools/**', - '**/scripts/**', - '**/test/**', - ], - optionalDependencies: false, - peerDependencies: true, - } -]; +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; module.exports = baseConfig; diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/cdk-imports.ts b/packages/@aws-cdk/cdk-handler-framework/lib/cdk-imports.ts new file mode 100644 index 0000000000000..d14bf73666f62 --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/lib/cdk-imports.ts @@ -0,0 +1,39 @@ +import { ExternalModule, Type } from '@cdklabs/typewriter'; + +class ConstructsModule extends ExternalModule { + public readonly Construct = Type.fromName(this, 'Construct'); + public readonly IConstruct = Type.fromName(this, 'IConstruct'); + + public constructor() { + super('constructs'); + } +} + +class CdkHandlerModule extends ExternalModule { + public readonly CdkHandler = Type.fromName(this, 'CdkHandler'); + + public constructor() { + super('../../handler-framework/lib/cdk-handler'); + } +} + +class CdkFunctionModule extends ExternalModule { + public readonly CdkFunction = Type.fromName(this, 'CdkFunction'); + + public constructor() { + super('../../handler-framework/lib/cdk-function'); + } +} + +class CdkSingletonFunctionModule extends ExternalModule { + public readonly CdkSingletonFunction = Type.fromName(this, 'CdkSingletonFunction'); + + public constructor() { + super('../../handler-framework/lib/cdk-singleton-function'); + } +} + +export const CONSTRUCTS_MODULE = new ConstructsModule(); +export const CDK_HANDLER_MODULE = new CdkHandlerModule(); +export const CDK_FUNCTION_MODULE = new CdkFunctionModule(); +export const CDK_SINGLETON_FUNCTION_MODULE = new CdkSingletonFunctionModule(); diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts b/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts new file mode 100644 index 0000000000000..47247f996d36d --- /dev/null +++ b/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts @@ -0,0 +1,65 @@ +import { SuperInitializer, ClassType, Type, IScope, expr, stmt } from '@cdklabs/typewriter'; +import { CDK_FUNCTION_MODULE, CDK_SINGLETON_FUNCTION_MODULE, CONSTRUCTS_MODULE } from './cdk-imports'; + +export abstract class CdkHandlerClass extends ClassType { + public static buildCdkFunction(scope: IScope, className: string, codeDirectory: string): ClassType { + return new (class CdkFunction extends CdkHandlerClass { + public constructor() { + super(scope, { + name: className, + extends: CDK_FUNCTION_MODULE.CdkFunction, + }); + this.buildConstructor(codeDirectory); + } + })(); + } + + public static buildCdkSingletonFunction(scope: IScope, className: string, codeDirectory: string): ClassType { + return new (class CdkSingleFunction extends CdkHandlerClass { + public constructor() { + super(scope, { + name: className, + extends: CDK_SINGLETON_FUNCTION_MODULE.CdkSingletonFunction, + }); + this.buildConstructor(codeDirectory); + } + })(); + } + + public static buildCdkCustomResourceProvider() {} + + private buildConstructor(codeDirectory: string, entrypoint?: string) { + // constructor + const init = this.addInitializer({}); + + // build CdkHandler instance + init.addBody( + stmt.constVar( + expr.ident('cdkHandlerProps'), + expr.object({ + codeDirectory: expr.directCode(codeDirectory), + entrypoint: entrypoint ? expr.directCode(entrypoint) : expr.lit('index.handler'), + }), + ), + ); + init.addBody( + stmt.constVar( + expr.ident('cdkHandler'), + expr.directCode('new CdkHandler(scope, `Handler`, cdkHandlerProps)'), + ), + ); + + // build super call + const scope = init.addParameter({ + name: 'scope', + type: CONSTRUCTS_MODULE.Construct, + }); + const id = init.addParameter({ + name: 'id', + type: Type.STRING, + }); + init.addBody(new SuperInitializer(scope, id, expr.object({ + handler: expr.ident('cdkHandler'), + }))); + } +} diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts index fa68e8a1e828b..4a0c0408135a2 100644 --- a/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts +++ b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts @@ -1,31 +1,40 @@ -import { Module, ClassType, TypeScriptRenderer, PropertySpec, Type } from '@cdklabs/typewriter'; +import { Module, TypeScriptRenderer } from '@cdklabs/typewriter'; +import { CDK_FUNCTION_MODULE, CDK_HANDLER_MODULE, CONSTRUCTS_MODULE, CDK_SINGLETON_FUNCTION_MODULE } from './cdk-imports'; +import { CdkHandlerClass } from './class-builder'; -export abstract class FrameworkGenerator { +export abstract class CdkHandlerFramework { /** * Generates a CdkHandler class that can be rendered to produce code. */ - public static generateCdkHandler() { - return new (class CdkHandlerGenerator extends FrameworkGenerator { + public static cdkFunction(className: string, codeDirectory: string): CdkHandlerFramework { + return new (class CdkFunction extends CdkHandlerFramework { public constructor() { - const module = new Module('cdk-handler'); - - const codeDirectoryProperty: PropertySpec = { - name: 'codeDirectory', - type: Type.STRING, - }; + const module = new Module('cdk-function'); + CONSTRUCTS_MODULE.importSelective(module, ['Construct']); + CDK_HANDLER_MODULE.importSelective(module, ['CdkHandler']); + CDK_FUNCTION_MODULE.importSelective(module, ['CdkFunction']); + CdkHandlerClass.buildCdkFunction(module, className, codeDirectory); + super(module); + } + })(); + } - new ClassType(module, { - name: 'CdkHandler', - properties: [codeDirectoryProperty], - }); + public static cdkSingletonFunction(className: string, codeDirectory: string): CdkHandlerFramework { + return new (class CdkSingletonFunction extends CdkHandlerFramework { + public constructor() { + const module = new Module('cdk-singleton-function'); + CONSTRUCTS_MODULE.importSelective(module, ['Construct']); + CDK_HANDLER_MODULE.importSelective(module, ['CdkHandler']); + CDK_SINGLETON_FUNCTION_MODULE.importSelective(module, ['CdkSingletonFunction']); + CdkHandlerClass.buildCdkSingletonFunction(module, className, codeDirectory); super(module); } })(); } - public readonly renderer = new TypeScriptRenderer(); + private readonly renderer = new TypeScriptRenderer(); - protected constructor(public readonly module: Module) {} + protected constructor(private readonly module: Module) {} /** * Render code for the framework. diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/index.ts b/packages/@aws-cdk/cdk-handler-framework/lib/index.ts deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/@aws-cdk/cdk-handler-framework/package.json b/packages/@aws-cdk/cdk-handler-framework/package.json index bfcd5c5da690e..bc0f96b550e28 100644 --- a/packages/@aws-cdk/cdk-handler-framework/package.json +++ b/packages/@aws-cdk/cdk-handler-framework/package.json @@ -26,10 +26,12 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", - "@aws-cdk/pkglint": "0.0.0" + "@aws-cdk/pkglint": "0.0.0", + "jest": "^29.7.0" }, "dependencies": { - "@cdklabs/typewriter": "^0.0.3" + "@cdklabs/typewriter": "^0.0.3", + "fs-extra": "^11.2.0" }, "peerDependencies": { "aws-cdk-lib": "^0.0.0", From 0ccf3e86464ace7ff726767e2031e3b00aa27524 Mon Sep 17 00:00:00 2001 From: Francis Date: Sat, 2 Dec 2023 14:30:11 -0800 Subject: [PATCH 74/74] props Signed-off-by: Francis --- .../lib/class-builder.ts | 27 ++++++++++++------- .../lib/handler-framework.ts | 12 +++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts b/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts index 47247f996d36d..89da2b46a95b8 100644 --- a/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts +++ b/packages/@aws-cdk/cdk-handler-framework/lib/class-builder.ts @@ -1,34 +1,43 @@ import { SuperInitializer, ClassType, Type, IScope, expr, stmt } from '@cdklabs/typewriter'; import { CDK_FUNCTION_MODULE, CDK_SINGLETON_FUNCTION_MODULE, CONSTRUCTS_MODULE } from './cdk-imports'; +interface CdkHandlerClassOptions { + readonly entrypoint?: string; +} + +export interface CdkHandlerClassProps extends CdkHandlerClassOptions { + readonly className: string; + readonly codeDirectory: string; +} + export abstract class CdkHandlerClass extends ClassType { - public static buildCdkFunction(scope: IScope, className: string, codeDirectory: string): ClassType { + public static buildCdkFunction(scope: IScope, props: CdkHandlerClassProps): ClassType { return new (class CdkFunction extends CdkHandlerClass { public constructor() { super(scope, { - name: className, + name: props.className, extends: CDK_FUNCTION_MODULE.CdkFunction, }); - this.buildConstructor(codeDirectory); + this.buildConstructor(props); } })(); } - public static buildCdkSingletonFunction(scope: IScope, className: string, codeDirectory: string): ClassType { + public static buildCdkSingletonFunction(scope: IScope, props: CdkHandlerClassProps): ClassType { return new (class CdkSingleFunction extends CdkHandlerClass { public constructor() { super(scope, { - name: className, + name: props.className, extends: CDK_SINGLETON_FUNCTION_MODULE.CdkSingletonFunction, }); - this.buildConstructor(codeDirectory); + this.buildConstructor(props); } })(); } public static buildCdkCustomResourceProvider() {} - private buildConstructor(codeDirectory: string, entrypoint?: string) { + private buildConstructor(props: CdkHandlerClassProps) { // constructor const init = this.addInitializer({}); @@ -37,8 +46,8 @@ export abstract class CdkHandlerClass extends ClassType { stmt.constVar( expr.ident('cdkHandlerProps'), expr.object({ - codeDirectory: expr.directCode(codeDirectory), - entrypoint: entrypoint ? expr.directCode(entrypoint) : expr.lit('index.handler'), + codeDirectory: expr.directCode(props.codeDirectory), + entrypoint: props.entrypoint ? expr.directCode(props.entrypoint) : expr.lit('index.handler'), }), ), ); diff --git a/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts index 4a0c0408135a2..4f4daab3c4286 100644 --- a/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts +++ b/packages/@aws-cdk/cdk-handler-framework/lib/handler-framework.ts @@ -1,32 +1,34 @@ import { Module, TypeScriptRenderer } from '@cdklabs/typewriter'; import { CDK_FUNCTION_MODULE, CDK_HANDLER_MODULE, CONSTRUCTS_MODULE, CDK_SINGLETON_FUNCTION_MODULE } from './cdk-imports'; -import { CdkHandlerClass } from './class-builder'; +import { CdkHandlerClass, CdkHandlerClassProps } from './class-builder'; + +export interface CdkHandlerFrameworkProps extends CdkHandlerClassProps {} export abstract class CdkHandlerFramework { /** * Generates a CdkHandler class that can be rendered to produce code. */ - public static cdkFunction(className: string, codeDirectory: string): CdkHandlerFramework { + public static cdkFunction(props: CdkHandlerFrameworkProps): CdkHandlerFramework { return new (class CdkFunction extends CdkHandlerFramework { public constructor() { const module = new Module('cdk-function'); CONSTRUCTS_MODULE.importSelective(module, ['Construct']); CDK_HANDLER_MODULE.importSelective(module, ['CdkHandler']); CDK_FUNCTION_MODULE.importSelective(module, ['CdkFunction']); - CdkHandlerClass.buildCdkFunction(module, className, codeDirectory); + CdkHandlerClass.buildCdkFunction(module, props); super(module); } })(); } - public static cdkSingletonFunction(className: string, codeDirectory: string): CdkHandlerFramework { + public static cdkSingletonFunction(props: CdkHandlerFrameworkProps): CdkHandlerFramework { return new (class CdkSingletonFunction extends CdkHandlerFramework { public constructor() { const module = new Module('cdk-singleton-function'); CONSTRUCTS_MODULE.importSelective(module, ['Construct']); CDK_HANDLER_MODULE.importSelective(module, ['CdkHandler']); CDK_SINGLETON_FUNCTION_MODULE.importSelective(module, ['CdkSingletonFunction']); - CdkHandlerClass.buildCdkSingletonFunction(module, className, codeDirectory); + CdkHandlerClass.buildCdkSingletonFunction(module, props); super(module); } })();