From 98a6fbb9b4a4a2b4ba3d114e8d3ad959063514a0 Mon Sep 17 00:00:00 2001 From: Ryan Andonian Date: Mon, 30 Jan 2023 11:51:56 -0800 Subject: [PATCH 1/3] feat(aws-lambda-python): support for poetry bundle asset exclusion list --- packages/@aws-cdk/aws-lambda-python/README.md | 14 +++++ .../aws-lambda-python/lib/bundling.ts | 16 ++++- .../@aws-cdk/aws-lambda-python/lib/types.ts | 7 +++ .../aws-lambda-python/test/bundling.test.ts | 60 ++++++++++++++++--- 4 files changed, 86 insertions(+), 11 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python/README.md b/packages/@aws-cdk/aws-lambda-python/README.md index f399d1559c81a..ac8c5780cbc37 100644 --- a/packages/@aws-cdk/aws-lambda-python/README.md +++ b/packages/@aws-cdk/aws-lambda-python/README.md @@ -109,6 +109,20 @@ Packaging is executed using the `Packaging` class, which: ├── poetry.lock # your poetry lock file has to be present at the entry path ``` +If using `poetry`, particularly with `virtualenvs.in-project = true`, you can exclude specific files from the copied files using the optional bundling string array parameter `poetryAssetExcludes` + +```ts +new python.PythonFunction(this, 'function', { + entry: '/path/to/poetry-function', + runtime: Runtime.PYTHON_3_8, + bundling: { + // translates to `rsync --exclude='.venv'` + poetryAssetExcludes: ['.venv'], + }, +}); +``` + + ## Custom Bundling Custom bundling can be performed by passing in additional build arguments that point to index URLs to private repos, or by using an entirely custom Docker images for bundling dependencies. The build args currently supported are: diff --git a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts index fad11266bb0cb..dc73c0ea437f3 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts @@ -47,6 +47,12 @@ export interface BundlingProps extends BundlingOptions { * @default - BundlingFileAccess.BIND_MOUNT */ bundlingFileAccess?: BundlingFileAccess + + /** + * List of file patterns to exclude when copying assets for bundling + * @default - Empty list + */ + readonly assetExcludes?: string[]; } /** @@ -83,6 +89,7 @@ export class Bundling implements CdkBundlingOptions { image, poetryIncludeHashes, commandHooks, + assetExcludes = [], } = props; const outputPath = path.posix.join(AssetStaging.BUNDLING_OUTPUT_DIR, outputPathSuffix); @@ -93,6 +100,7 @@ export class Bundling implements CdkBundlingOptions { outputDir: outputPath, poetryIncludeHashes, commandHooks, + assetExcludes, }); this.image = image ?? DockerImage.fromBuild(path.join(__dirname, '../lib'), { @@ -118,7 +126,10 @@ export class Bundling implements CdkBundlingOptions { const packaging = Packaging.fromEntry(options.entry, options.poetryIncludeHashes); let bundlingCommands: string[] = []; bundlingCommands.push(...options.commandHooks?.beforeBundling(options.inputDir, options.outputDir) ?? []); - bundlingCommands.push(`cp -rTL ${options.inputDir}/ ${options.outputDir}`); + const exclusionStr = options.assetExcludes?.map(item => `--exclude='${item}'`).join(' '); + bundlingCommands.push([ + 'rsync', '-rLv', exclusionStr ?? '', `${options.inputDir}/`, options.outputDir, + ].filter(item => item).join(' ')); bundlingCommands.push(`cd ${options.outputDir}`); bundlingCommands.push(packaging.exportCommand ?? ''); if (packaging.dependenciesFile) { @@ -134,7 +145,8 @@ interface BundlingCommandOptions { readonly inputDir: string; readonly outputDir: string; readonly poetryIncludeHashes?: boolean; - readonly commandHooks?: ICommandHooks + readonly commandHooks?: ICommandHooks; + readonly assetExcludes?: string[]; } /** diff --git a/packages/@aws-cdk/aws-lambda-python/lib/types.ts b/packages/@aws-cdk/aws-lambda-python/lib/types.ts index e0d328e68c858..80003cab8a327 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/types.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/types.ts @@ -15,6 +15,13 @@ export interface BundlingOptions extends DockerRunOptions { */ readonly poetryIncludeHashes?: boolean; + /** + * When using Poetry bundler, list of file patterns to exclude when copying assets for bundling. + * + * @default - Empty list + */ + readonly poetryAssetExcludes?: string[]; + /** * Output path suffix: the suffix for the directory into which the bundled output is written. * diff --git a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts index b51e8bb046acc..0069ed8c3b8c9 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts @@ -37,7 +37,7 @@ test('Bundling a function without dependencies', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output && cd /asset-output', + 'rsync -rLv /asset-input/ /asset-output && cd /asset-output', ], }), })); @@ -66,7 +66,7 @@ test('Bundling a function with requirements.txt', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output', + 'rsync -rLv /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output', ], }), })); @@ -89,7 +89,7 @@ test('Bundling Python 2.7 with requirements.txt installed', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output', + 'rsync -rLv /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output', ], }), })); @@ -109,7 +109,7 @@ test('Bundling a layer with dependencies', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python && python -m pip install -r requirements.txt -t /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && python -m pip install -r requirements.txt -t /asset-output/python', ], }), })); @@ -129,7 +129,7 @@ test('Bundling a python code layer', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python', ], }), })); @@ -149,7 +149,7 @@ test('Bundling a function with pipenv dependencies', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python', ], }), })); @@ -176,7 +176,7 @@ test('Bundling a function with poetry dependencies', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python && poetry export --without-hashes --with-credentials --format requirements.txt --output requirements.txt && python -m pip install -r requirements.txt -t /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && poetry export --without-hashes --with-credentials --format requirements.txt --output requirements.txt && python -m pip install -r requirements.txt -t /asset-output/python', ], }), })); @@ -189,6 +189,48 @@ test('Bundling a function with poetry dependencies', () => { expect(files).toContain('.ignorefile'); }); +test('Bundling a function with poetry and assetExcludes', () => { + const entry = path.join(__dirname, 'lambda-handler-poetry'); + + Bundling.bundle({ + entry: path.join(entry, '.'), + runtime: Runtime.PYTHON_3_9, + architecture: Architecture.X86_64, + outputPathSuffix: 'python', + assetExcludes: ['.ignorefile'], + }); + + expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + "rsync -rLv --exclude='.ignorefile' /asset-input/ /asset-output/python && cd /asset-output/python && poetry export --without-hashes --with-credentials --format requirements.txt --output requirements.txt && python -m pip install -r requirements.txt -t /asset-output/python", + ], + }), + })); + +}); + +test('Bundling a function with poetry and no assetExcludes', () => { + const entry = path.join(__dirname, 'lambda-handler-poetry'); + + Bundling.bundle({ + entry: path.join(entry, '.'), + runtime: Runtime.PYTHON_3_9, + architecture: Architecture.X86_64, + outputPathSuffix: 'python', + }); + + expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + expect.not.stringContaining('--exclude'), + ], + }), + })); +}); + test('Bundling a function with poetry dependencies, with hashes', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); @@ -204,7 +246,7 @@ test('Bundling a function with poetry dependencies, with hashes', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python && poetry export --with-credentials --format requirements.txt --output requirements.txt && python -m pip install -r requirements.txt -t /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && poetry export --with-credentials --format requirements.txt --output requirements.txt && python -m pip install -r requirements.txt -t /asset-output/python', ], }), })); @@ -234,7 +276,7 @@ test('Bundling a function with custom bundling image', () => { image, command: [ 'bash', '-c', - 'cp -rTL /asset-input/ /asset-output/python && cd /asset-output/python && python -m pip install -r requirements.txt -t /asset-output/python', + 'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && python -m pip install -r requirements.txt -t /asset-output/python', ], }), })); From 0449eef74473d29c5769ef5f9bfecab201f90ee2 Mon Sep 17 00:00:00 2001 From: Ryan Andonian Date: Tue, 7 Feb 2023 15:37:41 -0800 Subject: [PATCH 2/3] fix bundle props to be correctly sent to bundler add snapshot test verifying functionality --- .../aws-lambda-python/lib/bundling.ts | 14 +- .../aws-lambda-python/test/bundling.test.ts | 6 +- .../index.js | 1205 ++++++++++++++++ .../cdk.out | 1 + ...ambda-python-poetry-exclusions.assets.json | 97 ++ ...bda-python-poetry-exclusions.template.json | 406 ++++++ .../integ.json | 13 + .../manifest.json | 334 +++++ ...efaultTestDeployAssertE9C9CB8F.assets.json | 32 + ...aultTestDeployAssertE9C9CB8F.template.json | 608 ++++++++ .../tree.json | 1285 +++++++++++++++++ .../test/integ.function.poetry-exclusions.ts | 98 ++ 12 files changed, 4086 insertions(+), 13 deletions(-) create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts diff --git a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts index dc73c0ea437f3..fd94eb4dcfde6 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts @@ -47,12 +47,6 @@ export interface BundlingProps extends BundlingOptions { * @default - BundlingFileAccess.BIND_MOUNT */ bundlingFileAccess?: BundlingFileAccess - - /** - * List of file patterns to exclude when copying assets for bundling - * @default - Empty list - */ - readonly assetExcludes?: string[]; } /** @@ -89,7 +83,7 @@ export class Bundling implements CdkBundlingOptions { image, poetryIncludeHashes, commandHooks, - assetExcludes = [], + poetryAssetExcludes = [], } = props; const outputPath = path.posix.join(AssetStaging.BUNDLING_OUTPUT_DIR, outputPathSuffix); @@ -100,7 +94,7 @@ export class Bundling implements CdkBundlingOptions { outputDir: outputPath, poetryIncludeHashes, commandHooks, - assetExcludes, + poetryAssetExcludes, }); this.image = image ?? DockerImage.fromBuild(path.join(__dirname, '../lib'), { @@ -126,7 +120,7 @@ export class Bundling implements CdkBundlingOptions { const packaging = Packaging.fromEntry(options.entry, options.poetryIncludeHashes); let bundlingCommands: string[] = []; bundlingCommands.push(...options.commandHooks?.beforeBundling(options.inputDir, options.outputDir) ?? []); - const exclusionStr = options.assetExcludes?.map(item => `--exclude='${item}'`).join(' '); + const exclusionStr = options.poetryAssetExcludes?.map(item => `--exclude='${item}'`).join(' '); bundlingCommands.push([ 'rsync', '-rLv', exclusionStr ?? '', `${options.inputDir}/`, options.outputDir, ].filter(item => item).join(' ')); @@ -144,9 +138,9 @@ interface BundlingCommandOptions { readonly entry: string; readonly inputDir: string; readonly outputDir: string; + readonly poetryAssetExcludes?: string[]; readonly poetryIncludeHashes?: boolean; readonly commandHooks?: ICommandHooks; - readonly assetExcludes?: string[]; } /** diff --git a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts index 0069ed8c3b8c9..69956d1f08d3a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts @@ -189,7 +189,7 @@ test('Bundling a function with poetry dependencies', () => { expect(files).toContain('.ignorefile'); }); -test('Bundling a function with poetry and assetExcludes', () => { +test('Bundling a function with poetry and poetryAssetExcludes', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); Bundling.bundle({ @@ -197,7 +197,7 @@ test('Bundling a function with poetry and assetExcludes', () => { runtime: Runtime.PYTHON_3_9, architecture: Architecture.X86_64, outputPathSuffix: 'python', - assetExcludes: ['.ignorefile'], + poetryAssetExcludes: ['.ignorefile'], }); expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ @@ -211,7 +211,7 @@ test('Bundling a function with poetry and assetExcludes', () => { }); -test('Bundling a function with poetry and no assetExcludes', () => { +test('Bundling a function with poetry and no poetryAssetExcludes', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); Bundling.bundle({ diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js new file mode 100644 index 0000000000000..58bcb1ef7f38e --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js @@ -0,0 +1,1205 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + /** + * Check whether the provided object is a subtype of the `IMatcher`. + */ + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + /** + * DEPRECATED + * @deprecated use recordFailure() + */ + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + /** + * Record a new failure into this result at a specific path. + */ + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + /** Whether the match is a success */ + get isSuccess() { + return !this._hasFailed; + } + /** Does the result contain any failures. If not, the result is a success */ + hasFailed() { + return this._hasFailed; + } + /** The number of failures */ + get failCount() { + return this._failCount; + } + /** The cost of the failures so far */ + get failCost() { + return this._cost; + } + /** + * Compose the results of a previous match as a subtree. + * @param id the id of the parent tree. + */ + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + /** + * Prepare the result to be analyzed. + * This API *must* be called prior to analyzing these results. + */ + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + /** + * Render the failed match in a presentable way + * + * Prefer using `renderMismatch` over this method. It is left for backwards + * compatibility for test suites that expect it, but `renderMismatch()` will + * produce better output. + */ + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + /** + * Do a deep render of the match result, showing the structure mismatches in context + */ + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + /** + * Record a capture against in this match result. + */ + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + /** + * Use this matcher in the place of a field's value, if the field must not be present. + */ + static absent() { + return new AbsentMatch("absent"); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must be in the same order as would be found. + * @param pattern the pattern to match + */ + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must match exactly and in order. + * @param pattern the pattern to match + */ + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + /** + * Deep exact matching of the specified pattern to the target. + * @param pattern the pattern to match + */ + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must be present in the target but the target can be a superset. + * @param pattern the pattern to match + */ + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must match exactly with the target. + * @param pattern the pattern to match + */ + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + /** + * Matches any target which does NOT follow the specified pattern. + * @param pattern the pattern to NOT match + */ + static not(pattern) { + return new NotMatch("not", pattern); + } + /** + * Matches any string-encoded JSON and applies the specified pattern after parsing it. + * @param pattern the pattern to match after parsing the encoded JSON. + */ + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + /** + * Matches any non-null value at the target. + */ + static anyValue() { + return new AnyMatch("anyValue"); + } + /** + * Matches targets according to a regular expression + */ + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + // This is an informational message so it would be unfair to assign it cost + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + // Informational message + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + /** + * Handles executing the custom resource event. If `stateMachineArn` is present + * in the props then trigger the waiter statemachine + */ + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Handle async requests from the waiter state machine + */ + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Start a step function state machine which will wait for the request + * to be successful. + */ + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + /** + * Return a Matcher that can be tested against the actual results. + * This will convert the encoded matchers into their corresponding + * assertions matcher. + * + * For example: + * + * ExpectedResult.objectLike({ + * Messages: [{ + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * }], + * }); + * + * Will be encoded as: + * { + * $ObjectLike: { + * Messages: [{ + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * }], + * }, + * } + * + * Which can then be parsed by this function. For each key (recursively) + * the parser will check if the value has one of the encoded matchers as a key + * and if so, it will set the value as the Matcher. So, + * + * { + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * } + * + * Will be converted to + * { + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * } + */ + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + // return both the result of the API call _and_ the assertion results + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out new file mode 100644 index 0000000000000..d8b441d447f8a --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json new file mode 100644 index 0000000000000..0c220fe46bca6 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json @@ -0,0 +1,97 @@ +{ + "version": "29.0.0", + "files": { + "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9": { + "source": { + "path": "asset.9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e": { + "source": { + "path": "asset.66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8": { + "source": { + "path": "asset.ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499": { + "source": { + "path": "asset.8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572": { + "source": { + "path": "asset.5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49": { + "source": { + "path": "asset.194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1": { + "source": { + "path": "integ-lambda-python-poetry-exclusions.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json new file mode 100644 index 0000000000000..f53b62c1efe1d --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json @@ -0,0 +1,406 @@ +{ + "Resources": { + "myhandlerinlineServiceRole10C681F6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerinline53D120C7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerinlineServiceRole10C681F6", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.9" + }, + "DependsOn": [ + "myhandlerinlineServiceRole10C681F6" + ] + }, + "myhandlerinlinewithhashesServiceRoleDC418F75": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerinlinewithhashes352ED54D": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerinlinewithhashesServiceRoleDC418F75", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.9" + }, + "DependsOn": [ + "myhandlerinlinewithhashesServiceRoleDC418F75" + ] + }, + "myhandlerpython38ServiceRole2049AFF7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython384D62BBB5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython38ServiceRole2049AFF7", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.8" + }, + "DependsOn": [ + "myhandlerpython38ServiceRole2049AFF7" + ] + }, + "myhandlerpython38withhashesServiceRoleFE19CA7C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython38withhashesF2275091": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython38withhashesServiceRoleFE19CA7C", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.8" + }, + "DependsOn": [ + "myhandlerpython38withhashesServiceRoleFE19CA7C" + ] + }, + "myhandlerpython37ServiceRole45CBD18D": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37C34039A7": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37ServiceRole45CBD18D", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37ServiceRole45CBD18D" + ] + }, + "myhandlerpython37withhashesServiceRoleD9828997": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37withhashesE95C48AC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37withhashesServiceRoleD9828997", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37withhashesServiceRoleD9828997" + ] + } + }, + "Outputs": { + "ExportsOutputRefmyhandlerinline53D120C7B0898676": { + "Value": { + "Ref": "myhandlerinline53D120C7" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" + } + }, + "ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6": { + "Value": { + "Ref": "myhandlerinlinewithhashes352ED54D" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" + } + }, + "ExportsOutputRefmyhandlerpython384D62BBB58AA8B940": { + "Value": { + "Ref": "myhandlerpython384D62BBB5" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" + } + }, + "ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A": { + "Value": { + "Ref": "myhandlerpython38withhashesF2275091" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" + } + }, + "ExportsOutputRefmyhandlerpython37C34039A7BB71D94D": { + "Value": { + "Ref": "myhandlerpython37C34039A7" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + } + }, + "ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4": { + "Value": { + "Ref": "myhandlerpython37withhashesE95C48AC" + }, + "Export": { + "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json new file mode 100644 index 0000000000000..2eb6e84ffde0d --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json @@ -0,0 +1,13 @@ +{ + "version": "29.0.0", + "testCases": { + "poetry/DefaultTest": { + "stacks": [ + "integ-lambda-python-poetry-exclusions" + ], + "stackUpdateWorkflow": false, + "assertionStack": "poetry/DefaultTest/DeployAssert", + "assertionStackName": "poetryDefaultTestDeployAssertE9C9CB8F" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json new file mode 100644 index 0000000000000..ed2c7d688caf0 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json @@ -0,0 +1,334 @@ +{ + "version": "29.0.0", + "artifacts": { + "integ-lambda-python-poetry-exclusions.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-lambda-python-poetry-exclusions.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-lambda-python-poetry-exclusions": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-lambda-python-poetry-exclusions.template.json", + "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}/65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-lambda-python-poetry-exclusions.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-lambda-python-poetry-exclusions.assets" + ], + "metadata": { + "/integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlineServiceRole10C681F6" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_inline/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinline53D120C7" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlinewithhashesServiceRoleDC418F75" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlinewithhashes352ED54D" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38ServiceRole2049AFF7" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_38/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython384D62BBB5" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38withhashesServiceRoleFE19CA7C" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38withhashesF2275091" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37ServiceRole45CBD18D" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_37/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37C34039A7" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37withhashesServiceRoleD9828997" + } + ], + "/integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37withhashesE95C48AC" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerinline53D120C7B0898676" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + } + ], + "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" + } + ], + "/integ-lambda-python-poetry-exclusions/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-lambda-python-poetry-exclusions/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-lambda-python-poetry-exclusions" + }, + "poetryDefaultTestDeployAssertE9C9CB8F.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "poetryDefaultTestDeployAssertE9C9CB8F.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "poetryDefaultTestDeployAssertE9C9CB8F": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "poetryDefaultTestDeployAssertE9C9CB8F.template.json", + "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}/fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "poetryDefaultTestDeployAssertE9C9CB8F.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-lambda-python-poetry-exclusions", + "poetryDefaultTestDeployAssertE9C9CB8F.assets" + ], + "metadata": { + "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3d" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3dInvokeEBA46CA4" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d" + } + ], + "/poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" + } + ], + "/poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8InvokeEA59DC11" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292InvokeFD76DE7B" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39eInvoke930611A4" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke26497bb1c12c14ed3deada8d7d76b39e" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89Invoke884F6CA8" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89" + } + ], + "/poetry/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/poetry/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "poetry/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json new file mode 100644 index 0000000000000..e0fc6e1590d32 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json @@ -0,0 +1,32 @@ +{ + "version": "29.0.0", + "files": { + "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { + "source": { + "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3": { + "source": { + "path": "poetryDefaultTestDeployAssertE9C9CB8F.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json new file mode 100644 index 0000000000000..acf91d438cf6c --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json @@ -0,0 +1,608 @@ +{ + "Resources": { + "LambdaInvoke81c9998b1b428b309c8501e21b919d3d": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" + } + }, + "flattenResponse": "false", + "salt": "1675812819695" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke81c9998b1b428b309c8501e21b919d3dInvokeEBA46CA4": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { + "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" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" + } + ] + ] + } + ] + } + ] + } + } + ] + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Runtime": "nodejs14.x", + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" + }, + "Timeout": 120, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" + } + }, + "flattenResponse": "false", + "salt": "1675812819696" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8InvokeEA59DC11": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" + } + }, + "flattenResponse": "false", + "salt": "1675812819696" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292InvokeFD76DE7B": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" + } + }, + "flattenResponse": "false", + "salt": "1675812819697" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39eInvoke930611A4": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + } + }, + "flattenResponse": "false", + "salt": "1675812819697" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" + } + }, + "flattenResponse": "false", + "salt": "1675812819697" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89Invoke884F6CA8": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + } + }, + "Outputs": { + "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "assertion" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json new file mode 100644 index 0000000000000..fe3e0f8e6185b --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json @@ -0,0 +1,1285 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-lambda-python-poetry-exclusions": { + "id": "integ-lambda-python-poetry-exclusions", + "path": "integ-lambda-python-poetry-exclusions", + "children": { + "my_handler_inline": { + "id": "my_handler_inline", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerinlineServiceRole10C681F6", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_inline_with_hashes": { + "id": "my_handler_inline_with_hashes", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerinlinewithhashesServiceRoleDC418F75", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_38": { + "id": "my_handler_python_38", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython38ServiceRole2049AFF7", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.8" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_38_with_hashes": { + "id": "my_handler_python_38_with_hashes", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython38withhashesServiceRoleFE19CA7C", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.8" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_37": { + "id": "my_handler_python_37", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37ServiceRole45CBD18D", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_37_with_hashes": { + "id": "my_handler_python_37_with_hashes", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37withhashesServiceRoleD9828997", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "integ-lambda-python-poetry-exclusions/Exports", + "children": { + "Output{\"Ref\":\"myhandlerinline53D120C7\"}": { + "id": "Output{\"Ref\":\"myhandlerinline53D120C7\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": { + "id": "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": { + "id": "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": { + "id": "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37C34039A7\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37C34039A7\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", + "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-lambda-python-poetry-exclusions/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-lambda-python-poetry-exclusions/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "poetry": { + "id": "poetry", + "path": "poetry", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "poetry/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "poetry/DefaultTest/DeployAssert", + "children": { + "LambdaInvoke81c9998b1b428b309c8501e21b919d3d": { + "id": "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81": { + "id": "SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "children": { + "Staging": { + "id": "Staging", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + }, + "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { + "id": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { + "id": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { + "id": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { + "id": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "poetry/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "poetry/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts new file mode 100644 index 0000000000000..bce5c5c026873 --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts @@ -0,0 +1,98 @@ +import * as path from 'path'; +import { Runtime } from '@aws-cdk/aws-lambda'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; +import * as lambda from '../lib'; + +/* + * Stack verification steps: + * aws lambda invoke --function-name --invocation-type Event --payload $(base64 <<<''OK'') response.json + */ + +class TestStack extends Stack { + public readonly functionNames: string[] = []; + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const pythonFunction39 = new lambda.PythonFunction(this, 'my_handler_inline', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_9, + bundling: { + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction39.functionName); + + const pythonFunction39WithHashes = new lambda.PythonFunction(this, 'my_handler_inline_with_hashes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_9, + bundling: { + poetryIncludeHashes: true, + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction39WithHashes.functionName); + + const pythonFunction38 = new lambda.PythonFunction(this, 'my_handler_python_38', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_8, + bundling: { + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction38.functionName); + + const pythonFunction38WithHashes = new lambda.PythonFunction(this, 'my_handler_python_38_with_hashes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_8, + bundling: { + poetryIncludeHashes: true, + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction38WithHashes.functionName); + + const pythonFunction37 = new lambda.PythonFunction(this, 'my_handler_python_37', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_7, + bundling: { + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction37.functionName); + + const pythonFunction37WithHashes = new lambda.PythonFunction(this, 'my_handler_python_37_with_hashes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_7, + bundling: { + poetryIncludeHashes: true, + poetryAssetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction37WithHashes.functionName); + + } +} + +const app = new App(); +const testCase = new TestStack(app, 'integ-lambda-python-poetry-exclusions'); + +const integ = new IntegTest(app, 'poetry', { + testCases: [testCase], + // disabling update workflow because we don't want to include the assets in the snapshot + // python bundling changes the asset hash pretty frequently + stackUpdateWorkflow: false, +}); + +testCase.functionNames.forEach(functionName => { + const invoke = integ.assertions.invokeFunction({ + functionName: functionName, + }); + + invoke.expect(ExpectedResult.objectLike({ + Payload: '200', + })); +}); + +app.synth(); From dc9dbb267794dcbf1888b80f5b7569a04375a3f3 Mon Sep 17 00:00:00 2001 From: Ryan Andonian Date: Mon, 13 Feb 2023 15:28:11 -0800 Subject: [PATCH 3/3] remove poetry-specific assetExcludes in favor of general assetExcludes for python --- packages/@aws-cdk/aws-lambda-python/README.md | 6 +- .../aws-lambda-python/lib/bundling.ts | 8 +- .../@aws-cdk/aws-lambda-python/lib/types.ts | 4 +- .../aws-lambda-python/test/bundling.test.ts | 78 +- .../index.js | 0 .../index.js | 612 -------- .../test/integ.function.js.snapshot/cdk.out | 2 +- .../integ-lambda-python-function.assets.json | 25 +- ...integ-lambda-python-function.template.json | 73 +- .../integ.function.js.snapshot/integ.json | 2 +- ...efaultTestDeployAssertC9C6EE6F.assets.json | 12 +- ...aultTestDeployAssertC9C6EE6F.template.json | 118 +- .../integ.function.js.snapshot/manifest.json | 74 +- .../test/integ.function.js.snapshot/tree.json | 340 ++++- .../index.js | 1205 +++++++++++++++ .../index.js | 612 -------- .../integ.function.pipenv.js.snapshot/cdk.out | 2 +- .../integ-lambda-python-pipenv.assets.json | 63 +- .../integ-lambda-python-pipenv.template.json | 189 ++- .../integ.json | 2 +- .../manifest.json | 148 +- ...efaultTestDeployAssertF8231517.assets.json | 12 +- ...aultTestDeployAssertF8231517.template.json | 304 +++- .../tree.json | 878 ++++++++--- .../test/integ.function.pipenv.ts | 27 + .../cdk.out | 1 - ...ambda-python-poetry-exclusions.assets.json | 97 -- ...bda-python-poetry-exclusions.template.json | 406 ------ .../integ.json | 13 - .../manifest.json | 334 ----- ...efaultTestDeployAssertE9C9CB8F.assets.json | 32 - ...aultTestDeployAssertE9C9CB8F.template.json | 608 -------- .../tree.json | 1285 ---------------- .../test/integ.function.poetry-exclusions.ts | 98 -- .../index.js | 1205 +++++++++++++++ .../index.js | 669 --------- .../integ.function.poetry.js.snapshot/cdk.out | 2 +- .../integ-lambda-python-poetry.assets.json | 107 +- .../integ-lambda-python-poetry.template.json | 317 +++- .../integ.json | 2 +- .../manifest.json | 220 ++- ...efaultTestDeployAssertE9C9CB8F.assets.json | 12 +- ...aultTestDeployAssertE9C9CB8F.template.json | 444 +++++- .../tree.json | 1292 +++++++++++++++-- .../test/integ.function.poetry.ts | 47 + .../aws-lambda-python/test/integ.function.ts | 38 +- .../test/lambda-handler/.ignorelist | 0 47 files changed, 6581 insertions(+), 5444 deletions(-) rename packages/@aws-cdk/aws-lambda-python/test/{integ.function.poetry-exclusions.js.snapshot => integ.function.js.snapshot}/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js (100%) delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts create mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js delete mode 100644 packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.bundle/index.js create mode 100644 packages/@aws-cdk/aws-lambda-python/test/lambda-handler/.ignorelist diff --git a/packages/@aws-cdk/aws-lambda-python/README.md b/packages/@aws-cdk/aws-lambda-python/README.md index ac8c5780cbc37..065ba66d68c88 100644 --- a/packages/@aws-cdk/aws-lambda-python/README.md +++ b/packages/@aws-cdk/aws-lambda-python/README.md @@ -109,7 +109,9 @@ Packaging is executed using the `Packaging` class, which: ├── poetry.lock # your poetry lock file has to be present at the entry path ``` -If using `poetry`, particularly with `virtualenvs.in-project = true`, you can exclude specific files from the copied files using the optional bundling string array parameter `poetryAssetExcludes` +**Excluding source files** + +You can exclude files from being copied using the optional bundling string array parameter `assetExcludes` ```ts new python.PythonFunction(this, 'function', { @@ -117,7 +119,7 @@ new python.PythonFunction(this, 'function', { runtime: Runtime.PYTHON_3_8, bundling: { // translates to `rsync --exclude='.venv'` - poetryAssetExcludes: ['.venv'], + assetExcludes: ['.venv'], }, }); ``` diff --git a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts index fd94eb4dcfde6..8e11381d22187 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/bundling.ts @@ -83,7 +83,7 @@ export class Bundling implements CdkBundlingOptions { image, poetryIncludeHashes, commandHooks, - poetryAssetExcludes = [], + assetExcludes = [], } = props; const outputPath = path.posix.join(AssetStaging.BUNDLING_OUTPUT_DIR, outputPathSuffix); @@ -94,7 +94,7 @@ export class Bundling implements CdkBundlingOptions { outputDir: outputPath, poetryIncludeHashes, commandHooks, - poetryAssetExcludes, + assetExcludes, }); this.image = image ?? DockerImage.fromBuild(path.join(__dirname, '../lib'), { @@ -120,7 +120,7 @@ export class Bundling implements CdkBundlingOptions { const packaging = Packaging.fromEntry(options.entry, options.poetryIncludeHashes); let bundlingCommands: string[] = []; bundlingCommands.push(...options.commandHooks?.beforeBundling(options.inputDir, options.outputDir) ?? []); - const exclusionStr = options.poetryAssetExcludes?.map(item => `--exclude='${item}'`).join(' '); + const exclusionStr = options.assetExcludes?.map(item => `--exclude='${item}'`).join(' '); bundlingCommands.push([ 'rsync', '-rLv', exclusionStr ?? '', `${options.inputDir}/`, options.outputDir, ].filter(item => item).join(' ')); @@ -138,7 +138,7 @@ interface BundlingCommandOptions { readonly entry: string; readonly inputDir: string; readonly outputDir: string; - readonly poetryAssetExcludes?: string[]; + readonly assetExcludes?: string[]; readonly poetryIncludeHashes?: boolean; readonly commandHooks?: ICommandHooks; } diff --git a/packages/@aws-cdk/aws-lambda-python/lib/types.ts b/packages/@aws-cdk/aws-lambda-python/lib/types.ts index 80003cab8a327..9503a05005b7a 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/types.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/types.ts @@ -16,11 +16,11 @@ export interface BundlingOptions extends DockerRunOptions { readonly poetryIncludeHashes?: boolean; /** - * When using Poetry bundler, list of file patterns to exclude when copying assets for bundling. + * List of file patterns to exclude when copying assets from source for bundling. * * @default - Empty list */ - readonly poetryAssetExcludes?: string[]; + readonly assetExcludes?: string[]; /** * Output path suffix: the suffix for the directory into which the bundled output is written. diff --git a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts index 69956d1f08d3a..e78f4a5247e71 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts @@ -71,6 +71,31 @@ test('Bundling a function with requirements.txt', () => { }), })); + const files = fs.readdirSync(assetCode.path); + expect(files).toContain('index.py'); + expect(files).toContain('requirements.txt'); + expect(files).toContain('.ignorelist'); +}); + +test('Bundling a function with requirements.txt using assetExcludes', () => { + const entry = path.join(__dirname, 'lambda-handler'); + const assetCode = Bundling.bundle({ + entry: entry, + runtime: Runtime.PYTHON_3_7, + architecture: Architecture.X86_64, + assetExcludes: ['.ignorelist'], + }); + + // Correctly bundles + expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + "rsync -rLv --exclude='.ignorelist' /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output", + ], + }), + })); + const files = fs.readdirSync(assetCode.path); expect(files).toContain('index.py'); expect(files).toContain('requirements.txt'); @@ -95,6 +120,25 @@ test('Bundling Python 2.7 with requirements.txt installed', () => { })); }); +test('Bundling Python 2.7 with requirements.txt installed', () => { + const entry = path.join(__dirname, 'lambda-handler'); + Bundling.bundle({ + entry: entry, + runtime: Runtime.PYTHON_2_7, + architecture: Architecture.X86_64, + }); + + // Correctly bundles with requirements.txt pip installed + expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + 'rsync -rLv /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output', + ], + }), + })); +}); + test('Bundling a layer with dependencies', () => { const entry = path.join(__dirname, 'lambda-handler'); @@ -162,6 +206,34 @@ test('Bundling a function with pipenv dependencies', () => { expect(files).toContain('.ignorefile'); }); +test('Bundling a function with pipenv dependencies with assetExcludes', () => { + const entry = path.join(__dirname, 'lambda-handler-pipenv'); + + const assetCode = Bundling.bundle({ + entry: path.join(entry, '.'), + runtime: Runtime.PYTHON_3_9, + architecture: Architecture.X86_64, + outputPathSuffix: 'python', + assetExcludes: ['.ignorefile'], + }); + + expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ + bundling: expect.objectContaining({ + command: [ + 'bash', '-c', + "rsync -rLv --exclude='.ignorefile' /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python", + ], + }), + })); + + const files = fs.readdirSync(assetCode.path); + expect(files).toContain('index.py'); + expect(files).toContain('Pipfile'); + expect(files).toContain('Pipfile.lock'); + // Contains hidden files. + expect(files).toContain('.ignorefile'); +}); + test('Bundling a function with poetry dependencies', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); @@ -189,7 +261,7 @@ test('Bundling a function with poetry dependencies', () => { expect(files).toContain('.ignorefile'); }); -test('Bundling a function with poetry and poetryAssetExcludes', () => { +test('Bundling a function with poetry and assetExcludes', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); Bundling.bundle({ @@ -197,7 +269,7 @@ test('Bundling a function with poetry and poetryAssetExcludes', () => { runtime: Runtime.PYTHON_3_9, architecture: Architecture.X86_64, outputPathSuffix: 'python', - poetryAssetExcludes: ['.ignorefile'], + assetExcludes: ['.ignorefile'], }); expect(Code.fromAsset).toHaveBeenCalledWith(entry, expect.objectContaining({ @@ -211,7 +283,7 @@ test('Bundling a function with poetry and poetryAssetExcludes', () => { }); -test('Bundling a function with poetry and no poetryAssetExcludes', () => { +test('Bundling a function with poetry and no assetExcludes', () => { const entry = path.join(__dirname, 'lambda-handler-poetry'); Bundling.bundle({ diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js similarity index 100% rename from packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js rename to packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js deleted file mode 100644 index ba956d47f51fe..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js +++ /dev/null @@ -1,612 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); - const response = await this.processEvent(this.event.ResourceProperties); - console.log(`Event output : ${JSON.stringify(response)}`); - await this.respond({ - status: "SUCCESS", - reason: "OK", - data: response - }); - } catch (e) { - console.log(e); - await this.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - data: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - if (request2.failDeployment) { - throw new Error(result.data); - } - } else { - result = { - data: JSON.stringify({ - status: "success" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - this.parsedObj = { - matcher: obj - }; - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - if (Matcher.isMatcher(final.matcher)) { - return final.matcher; - } - return Match.exact(final.matcher); - } catch { - return Match.exact(this.parsedObj.matcher); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = { - ...flatten(respond) - }; - return request2.flattenResponse === "true" ? flatData : respond; - } -}; - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - const provider = createResourceHandler(event, context); - await provider.handle(); -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } - switch (event.ResourceType) { - case ASSERT_RESOURCE_TYPE: - return new AssertionHandler(event, context); - default: - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/cdk.out index 8ecc185e9dbee..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.assets.json index 43f3d57a184f8..2db813a1704fd 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.assets.json @@ -1,20 +1,33 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "75eef6be4f79fab5d65ef63569aac0de3aab47ca778c063cdea466e47c4ea755": { + "74aba657619dfbc372ad5df5cf98a022a4322098a338ee81683de7c8d01d4664": { "source": { - "path": "asset.75eef6be4f79fab5d65ef63569aac0de3aab47ca778c063cdea466e47c4ea755", + "path": "asset.74aba657619dfbc372ad5df5cf98a022a4322098a338ee81683de7c8d01d4664", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "75eef6be4f79fab5d65ef63569aac0de3aab47ca778c063cdea466e47c4ea755.zip", + "objectKey": "74aba657619dfbc372ad5df5cf98a022a4322098a338ee81683de7c8d01d4664.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "d759a2959a657473cc039ac933b56005d266cfc872bb8a2cb0b6a4c07aafff56": { + "8e8d2a8b3838f7d231d348e1c27c9f8e682c8dd4ff9af71d88795db2009a6d51": { + "source": { + "path": "asset.8e8d2a8b3838f7d231d348e1c27c9f8e682c8dd4ff9af71d88795db2009a6d51", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "8e8d2a8b3838f7d231d348e1c27c9f8e682c8dd4ff9af71d88795db2009a6d51.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "85ce1d521db629d713f3de5e618c84c51c48944e22ff2e64d3a6d12770a8199d": { "source": { "path": "integ-lambda-python-function.template.json", "packaging": "file" @@ -22,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d759a2959a657473cc039ac933b56005d266cfc872bb8a2cb0b6a4c07aafff56.json", + "objectKey": "85ce1d521db629d713f3de5e618c84c51c48944e22ff2e64d3a6d12770a8199d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.template.json index 154f82a3e4dd6..54bbe0249ec00 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ-lambda-python-function.template.json @@ -38,7 +38,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "75eef6be4f79fab5d65ef63569aac0de3aab47ca778c063cdea466e47c4ea755.zip" + "S3Key": "74aba657619dfbc372ad5df5cf98a022a4322098a338ee81683de7c8d01d4664.zip" }, "Role": { "Fn::GetAtt": [ @@ -52,10 +52,63 @@ "DependsOn": [ "myhandlerServiceRole77891068" ] + }, + "myhandlerexcludesServiceRoleBB475DCC": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerexcludes0437E0D2": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "8e8d2a8b3838f7d231d348e1c27c9f8e682c8dd4ff9af71d88795db2009a6d51.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerexcludesServiceRoleBB475DCC", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.9" + }, + "DependsOn": [ + "myhandlerexcludesServiceRoleBB475DCC" + ] } }, "Outputs": { - "FunctionArn": { + "DefaultFunctionArn": { "Value": { "Fn::GetAtt": [ "myhandlerD202FA8E", @@ -63,6 +116,14 @@ ] } }, + "FunctionArnWithExcludes": { + "Value": { + "Fn::GetAtt": [ + "myhandlerexcludes0437E0D2", + "Arn" + ] + } + }, "ExportsOutputRefmyhandlerD202FA8E369E8804": { "Value": { "Ref": "myhandlerD202FA8E" @@ -70,6 +131,14 @@ "Export": { "Name": "integ-lambda-python-function:ExportsOutputRefmyhandlerD202FA8E369E8804" } + }, + "ExportsOutputRefmyhandlerexcludes0437E0D23D81F234": { + "Value": { + "Ref": "myhandlerexcludes0437E0D2" + }, + "Export": { + "Name": "integ-lambda-python-function:ExportsOutputRefmyhandlerexcludes0437E0D23D81F234" + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ.json index c9e27957a3b6a..2a091993572eb 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "testCases": { "lambda-python-function/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.assets.json index 3197f8c05ca02..aad6c70a7e233 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.assets.json @@ -1,20 +1,20 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { "source": { - "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.zip", + "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "f6fe40c0c1113210f5fd8c07b8e5ded3f7c35a6cfb554b207fc1523f10d9eaa9": { + "4d65bf80ba312f74702ad54f1b55f5f18667457d4867535222323470d0ae5194": { "source": { "path": "lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f6fe40c0c1113210f5fd8c07b8e5ded3f7c35a6cfb554b207fc1523f10d9eaa9.json", + "objectKey": "4d65bf80ba312f74702ad54f1b55f5f18667457d4867535222323470d0ae5194.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.template.json index e35047e6cae8d..e83b2eaf357f4 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/lambdapythonfunctionDefaultTestDeployAssertC9C6EE6F.template.json @@ -11,13 +11,14 @@ }, "service": "Lambda", "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", "parameters": { "FunctionName": { "Fn::ImportValue": "integ-lambda-python-function:ExportsOutputRefmyhandlerD202FA8E369E8804" } }, "flattenResponse": "false", - "salt": "1662643989220" + "salt": "1676327434136" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -37,27 +38,6 @@ } } }, - "LambdaInvoke431773224924ebf10c8a31d363a6bf16AssertEqualsLambdainvokeF6179C6B": { - "Type": "Custom::DeployAssert@AssertEquals", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "actual": { - "Fn::GetAtt": [ - "LambdaInvoke431773224924ebf10c8a31d363a6bf16", - "apiCallResponse" - ] - }, - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1662643989220" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { "Type": "AWS::IAM::Role", "Properties": { @@ -123,6 +103,46 @@ ] } ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-function:ExportsOutputRefmyhandlerexcludes0437E0D23D81F234" + } + ] + ] + } + ] } ] } @@ -138,7 +158,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.zip" + "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -149,14 +169,60 @@ ] } } + }, + "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-function:ExportsOutputRefmyhandlerexcludes0437E0D23D81F234" + } + }, + "flattenResponse": "false", + "salt": "1676327434137" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14InvokeD7AA9E7A": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-function:ExportsOutputRefmyhandlerexcludes0437E0D23D81F234" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } } }, "Outputs": { - "AssertionResultsAssertEqualsLambdainvoke64d766e0ddfdf2e2979fef994a5cd2aa": { + "AssertionResultsLambdaInvoke431773224924ebf10c8a31d363a6bf16": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke431773224924ebf10c8a31d363a6bf16", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke431773224924ebf10c8a31d363a6bf16AssertEqualsLambdainvokeF6179C6B", - "data" + "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14", + "assertion" ] } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/manifest.json index 1e64a7aae2f14..eb41f8ed61560 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "integ-lambda-python-function.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "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}/d759a2959a657473cc039ac933b56005d266cfc872bb8a2cb0b6a4c07aafff56.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/85ce1d521db629d713f3de5e618c84c51c48944e22ff2e64d3a6d12770a8199d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -51,10 +45,28 @@ "data": "myhandlerD202FA8E" } ], - "/integ-lambda-python-function/FunctionArn": [ + "/integ-lambda-python-function/DefaultFunctionArn": [ + { + "type": "aws:cdk:logicalId", + "data": "DefaultFunctionArn" + } + ], + "/integ-lambda-python-function/my_handler_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerexcludesServiceRoleBB475DCC" + } + ], + "/integ-lambda-python-function/my_handler_excludes/Resource": [ { "type": "aws:cdk:logicalId", - "data": "FunctionArn" + "data": "myhandlerexcludes0437E0D2" + } + ], + "/integ-lambda-python-function/FunctionArnWithExcludes": [ + { + "type": "aws:cdk:logicalId", + "data": "FunctionArnWithExcludes" } ], "/integ-lambda-python-function/Exports/Output{\"Ref\":\"myhandlerD202FA8E\"}": [ @@ -63,6 +75,12 @@ "data": "ExportsOutputRefmyhandlerD202FA8E369E8804" } ], + "/integ-lambda-python-function/Exports/Output{\"Ref\":\"myhandlerexcludes0437E0D2\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerexcludes0437E0D23D81F234" + } + ], "/integ-lambda-python-function/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -94,7 +112,7 @@ "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}/f6fe40c0c1113210f5fd8c07b8e5ded3f7c35a6cfb554b207fc1523f10d9eaa9.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4d65bf80ba312f74702ad54f1b55f5f18667457d4867535222323470d0ae5194.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -123,16 +141,10 @@ "data": "LambdaInvoke431773224924ebf10c8a31d363a6bf16Invoke9BC0E67F" } ], - "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/Default/Default": [ + "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke431773224924ebf10c8a31d363a6bf16AssertEqualsLambdainvokeF6179C6B" - } - ], - "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsLambdainvoke64d766e0ddfdf2e2979fef994a5cd2aa" + "data": "AssertionResultsLambdaInvoke431773224924ebf10c8a31d363a6bf16" } ], "/lambda-python-function/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -147,6 +159,24 @@ "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" } ], + "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14" + } + ], + "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14InvokeD7AA9E7A" + } + ], + "/lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14" + } + ], "/lambda-python-function/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -161,6 +191,12 @@ ] }, "displayName": "lambda-python-function/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/tree.json index fb6f36cb47f0c..bee46863b8e55 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - }, "integ-lambda-python-function": { "id": "integ-lambda-python-function", "path": "integ-lambda-python-function", @@ -24,6 +16,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-function/my_handler/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-function/my_handler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-function/my_handler/ServiceRole/Resource", @@ -105,7 +105,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "75eef6be4f79fab5d65ef63569aac0de3aab47ca778c063cdea466e47c4ea755.zip" + "s3Key": "74aba657619dfbc372ad5df5cf98a022a4322098a338ee81683de7c8d01d4664.zip" }, "role": { "Fn::GetAtt": [ @@ -128,9 +128,137 @@ "version": "0.0.0" } }, - "FunctionArn": { - "id": "FunctionArn", - "path": "integ-lambda-python-function/FunctionArn", + "DefaultFunctionArn": { + "id": "DefaultFunctionArn", + "path": "integ-lambda-python-function/DefaultFunctionArn", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "my_handler_excludes": { + "id": "my_handler_excludes", + "path": "integ-lambda-python-function/my_handler_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-function/my_handler_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-function/my_handler_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-function/my_handler_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-function/my_handler_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-function/my_handler_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-function/my_handler_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-function/my_handler_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "8e8d2a8b3838f7d231d348e1c27c9f8e682c8dd4ff9af71d88795db2009a6d51.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerexcludesServiceRoleBB475DCC", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "FunctionArnWithExcludes": { + "id": "FunctionArnWithExcludes", + "path": "integ-lambda-python-function/FunctionArnWithExcludes", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -147,11 +275,35 @@ "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" } + }, + "Output{\"Ref\":\"myhandlerexcludes0437E0D2\"}": { + "id": "Output{\"Ref\":\"myhandlerexcludes0437E0D2\"}", + "path": "integ-lambda-python-function/Exports/Output{\"Ref\":\"myhandlerexcludes0437E0D2\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-lambda-python-function/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-lambda-python-function/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -173,7 +325,7 @@ "path": "lambda-python-function/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } }, "DeployAssert": { @@ -193,13 +345,13 @@ "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" } }, "Default": { @@ -228,64 +380,18 @@ "version": "0.0.0" } }, - "AssertEqualsLambdainvoke": { - "id": "AssertEqualsLambdainvoke", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - }, - "Default": { - "id": "Default", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/Default", - "children": { - "Default": { - "id": "Default", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertEqualsLambdainvoke/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, + "AssertionResults": { + "id": "AssertionResults", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke431773224924ebf10c8a31d363a6bf16/AssertionResults", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" } }, "SingletonFunction1488541a7b23466481b69b4408076b81": { @@ -319,7 +425,85 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" + } + }, + "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14": { + "id": "LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/Default", + "children": { + "Default": { + "id": "Default", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "lambda-python-function/DefaultTest/DeployAssert/LambdaInvoke0e6bc88fc58c90a2753e79d6caf4bc14/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "lambda-python-function/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "lambda-python-function/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -330,14 +514,22 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js new file mode 100644 index 0000000000000..58bcb1ef7f38e --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js @@ -0,0 +1,1205 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + /** + * Check whether the provided object is a subtype of the `IMatcher`. + */ + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + /** + * DEPRECATED + * @deprecated use recordFailure() + */ + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + /** + * Record a new failure into this result at a specific path. + */ + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + /** Whether the match is a success */ + get isSuccess() { + return !this._hasFailed; + } + /** Does the result contain any failures. If not, the result is a success */ + hasFailed() { + return this._hasFailed; + } + /** The number of failures */ + get failCount() { + return this._failCount; + } + /** The cost of the failures so far */ + get failCost() { + return this._cost; + } + /** + * Compose the results of a previous match as a subtree. + * @param id the id of the parent tree. + */ + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + /** + * Prepare the result to be analyzed. + * This API *must* be called prior to analyzing these results. + */ + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + /** + * Render the failed match in a presentable way + * + * Prefer using `renderMismatch` over this method. It is left for backwards + * compatibility for test suites that expect it, but `renderMismatch()` will + * produce better output. + */ + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + /** + * Do a deep render of the match result, showing the structure mismatches in context + */ + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + /** + * Record a capture against in this match result. + */ + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + /** + * Use this matcher in the place of a field's value, if the field must not be present. + */ + static absent() { + return new AbsentMatch("absent"); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must be in the same order as would be found. + * @param pattern the pattern to match + */ + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must match exactly and in order. + * @param pattern the pattern to match + */ + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + /** + * Deep exact matching of the specified pattern to the target. + * @param pattern the pattern to match + */ + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must be present in the target but the target can be a superset. + * @param pattern the pattern to match + */ + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must match exactly with the target. + * @param pattern the pattern to match + */ + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + /** + * Matches any target which does NOT follow the specified pattern. + * @param pattern the pattern to NOT match + */ + static not(pattern) { + return new NotMatch("not", pattern); + } + /** + * Matches any string-encoded JSON and applies the specified pattern after parsing it. + * @param pattern the pattern to match after parsing the encoded JSON. + */ + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + /** + * Matches any non-null value at the target. + */ + static anyValue() { + return new AnyMatch("anyValue"); + } + /** + * Matches targets according to a regular expression + */ + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + // This is an informational message so it would be unfair to assign it cost + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + // Informational message + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + /** + * Handles executing the custom resource event. If `stateMachineArn` is present + * in the props then trigger the waiter statemachine + */ + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Handle async requests from the waiter state machine + */ + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Start a step function state machine which will wait for the request + * to be successful. + */ + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + /** + * Return a Matcher that can be tested against the actual results. + * This will convert the encoded matchers into their corresponding + * assertions matcher. + * + * For example: + * + * ExpectedResult.objectLike({ + * Messages: [{ + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * }], + * }); + * + * Will be encoded as: + * { + * $ObjectLike: { + * Messages: [{ + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * }], + * }, + * } + * + * Which can then be parsed by this function. For each key (recursively) + * the parser will check if the value has one of the encoded matchers as a key + * and if so, it will set the value as the Matcher. So, + * + * { + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * } + * + * Will be converted to + * { + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * } + */ + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + // return both the result of the API call _and_ the assertion results + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js deleted file mode 100644 index ba956d47f51fe..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle/index.js +++ /dev/null @@ -1,612 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - console.log(`Event: ${JSON.stringify({ ...this.event, ResponseURL: "..." })}`); - const response = await this.processEvent(this.event.ResourceProperties); - console.log(`Event output : ${JSON.stringify(response)}`); - await this.respond({ - status: "SUCCESS", - reason: "OK", - data: response - }); - } catch (e) { - console.log(e); - await this.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - data: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - if (request2.failDeployment) { - throw new Error(result.data); - } - } else { - result = { - data: JSON.stringify({ - status: "success" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - this.parsedObj = { - matcher: obj - }; - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - if (Matcher.isMatcher(final.matcher)) { - return final.matcher; - } - return Match.exact(final.matcher); - } catch { - return Match.exact(this.parsedObj.matcher); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - const childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = { - ...flatten(respond) - }; - return request2.flattenResponse === "true" ? flatData : respond; - } -}; - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - const provider = createResourceHandler(event, context); - await provider.handle(); -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } - switch (event.ResourceType) { - case ASSERT_RESOURCE_TYPE: - return new AssertionHandler(event, context); - default: - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/cdk.out index 8ecc185e9dbee..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.assets.json index 06fc3c46efd8b..8cfdfddad8d20 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.assets.json @@ -1,46 +1,85 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "803e66cf17a8155efd491fa5e68f796bb74ae8337c455b23b5e52d0e5927b2a7": { + "2f3bbbf29fb95dea832d2f407fb3af92e2179a31a179650c1e9bad3d5d51afaf": { "source": { - "path": "asset.803e66cf17a8155efd491fa5e68f796bb74ae8337c455b23b5e52d0e5927b2a7", + "path": "asset.2f3bbbf29fb95dea832d2f407fb3af92e2179a31a179650c1e9bad3d5d51afaf", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "803e66cf17a8155efd491fa5e68f796bb74ae8337c455b23b5e52d0e5927b2a7.zip", + "objectKey": "2f3bbbf29fb95dea832d2f407fb3af92e2179a31a179650c1e9bad3d5d51afaf.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "2a6fcac567a26e1be604dec572e270fbd091180dccf23a209e21c5900ce24ff0": { + "393d0817d83ce87664be2c627863e3f448f1106ceeb687e3f3c370b7957b9a21": { "source": { - "path": "asset.2a6fcac567a26e1be604dec572e270fbd091180dccf23a209e21c5900ce24ff0", + "path": "asset.393d0817d83ce87664be2c627863e3f448f1106ceeb687e3f3c370b7957b9a21", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2a6fcac567a26e1be604dec572e270fbd091180dccf23a209e21c5900ce24ff0.zip", + "objectKey": "393d0817d83ce87664be2c627863e3f448f1106ceeb687e3f3c370b7957b9a21.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "e223ff54d4d46f8f1e5876b5697de59a81ba36113fa0bf2b46d29917fcbee403": { + "f4e3739faf89086835a11fc5cdc60f9f437560fdc808ba5f7b8c717b280eb2b1": { "source": { - "path": "asset.e223ff54d4d46f8f1e5876b5697de59a81ba36113fa0bf2b46d29917fcbee403", + "path": "asset.f4e3739faf89086835a11fc5cdc60f9f437560fdc808ba5f7b8c717b280eb2b1", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e223ff54d4d46f8f1e5876b5697de59a81ba36113fa0bf2b46d29917fcbee403.zip", + "objectKey": "f4e3739faf89086835a11fc5cdc60f9f437560fdc808ba5f7b8c717b280eb2b1.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "0ed561f0d555914dbd2d0c6af29be68dd27eb65ee922d0f6eee6d50d3a0b5362": { + "6259c1fcafbecaa6547531670fa651cce171cf49a597b58343c28ad4c6a4ba04": { + "source": { + "path": "asset.6259c1fcafbecaa6547531670fa651cce171cf49a597b58343c28ad4c6a4ba04", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "6259c1fcafbecaa6547531670fa651cce171cf49a597b58343c28ad4c6a4ba04.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "7885d5d20a5bca7141b637a7e9db57f95730b26b0c4a5d7a6e6db0f392042f7e": { + "source": { + "path": "asset.7885d5d20a5bca7141b637a7e9db57f95730b26b0c4a5d7a6e6db0f392042f7e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "7885d5d20a5bca7141b637a7e9db57f95730b26b0c4a5d7a6e6db0f392042f7e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "53f2ca7d739f5ee14104a478b820bb6f429b8afaa9c00a9aed6cf32538cf7207": { + "source": { + "path": "asset.53f2ca7d739f5ee14104a478b820bb6f429b8afaa9c00a9aed6cf32538cf7207", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "53f2ca7d739f5ee14104a478b820bb6f429b8afaa9c00a9aed6cf32538cf7207.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "0dac102ffa4d6e4e405149901d1ae37f467ad83c0906696eef73df546a839e0d": { "source": { "path": "integ-lambda-python-pipenv.template.json", "packaging": "file" @@ -48,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0ed561f0d555914dbd2d0c6af29be68dd27eb65ee922d0f6eee6d50d3a0b5362.json", + "objectKey": "0dac102ffa4d6e4e405149901d1ae37f467ad83c0906696eef73df546a839e0d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.template.json index 3e664aeb17e51..4f40fb40c66e6 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ-lambda-python-pipenv.template.json @@ -38,7 +38,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "803e66cf17a8155efd491fa5e68f796bb74ae8337c455b23b5e52d0e5927b2a7.zip" + "S3Key": "2f3bbbf29fb95dea832d2f407fb3af92e2179a31a179650c1e9bad3d5d51afaf.zip" }, "Role": { "Fn::GetAtt": [ @@ -91,7 +91,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "2a6fcac567a26e1be604dec572e270fbd091180dccf23a209e21c5900ce24ff0.zip" + "S3Key": "393d0817d83ce87664be2c627863e3f448f1106ceeb687e3f3c370b7957b9a21.zip" }, "Role": { "Fn::GetAtt": [ @@ -144,7 +144,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "e223ff54d4d46f8f1e5876b5697de59a81ba36113fa0bf2b46d29917fcbee403.zip" + "S3Key": "f4e3739faf89086835a11fc5cdc60f9f437560fdc808ba5f7b8c717b280eb2b1.zip" }, "Role": { "Fn::GetAtt": [ @@ -158,6 +158,165 @@ "DependsOn": [ "myhandlerpython37ServiceRole45CBD18D" ] + }, + "myhandlerinlineexcludesServiceRoleFF9028A3": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerinlineexcludes9ACF1422": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "6259c1fcafbecaa6547531670fa651cce171cf49a597b58343c28ad4c6a4ba04.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerinlineexcludesServiceRoleFF9028A3", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.9" + }, + "DependsOn": [ + "myhandlerinlineexcludesServiceRoleFF9028A3" + ] + }, + "myhandlerpython38excludesServiceRole05CD433C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython38excludes1CEDD615": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7885d5d20a5bca7141b637a7e9db57f95730b26b0c4a5d7a6e6db0f392042f7e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython38excludesServiceRole05CD433C", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.8" + }, + "DependsOn": [ + "myhandlerpython38excludesServiceRole05CD433C" + ] + }, + "myhandlerpython37excludesServiceRole083BD595": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37excludes977F9CDF": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "53f2ca7d739f5ee14104a478b820bb6f429b8afaa9c00a9aed6cf32538cf7207.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37excludesServiceRole083BD595", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37excludesServiceRole083BD595" + ] } }, "Outputs": { @@ -184,6 +343,30 @@ "Export": { "Name": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" } + }, + "ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9": { + "Value": { + "Ref": "myhandlerinlineexcludes9ACF1422" + }, + "Export": { + "Name": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + }, + "ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35": { + "Value": { + "Ref": "myhandlerpython38excludes1CEDD615" + }, + "Export": { + "Name": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + }, + "ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3": { + "Value": { + "Ref": "myhandlerpython37excludes977F9CDF" + }, + "Export": { + "Name": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ.json index 37e33ee99af21..e492fff5d5158 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "testCases": { "pipenv/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/manifest.json index 7758c7d1f91fe..a8ef03dd5872a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "integ-lambda-python-pipenv.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "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}/0ed561f0d555914dbd2d0c6af29be68dd27eb65ee922d0f6eee6d50d3a0b5362.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0dac102ffa4d6e4e405149901d1ae37f467ad83c0906696eef73df546a839e0d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -75,6 +69,42 @@ "data": "myhandlerpython37C34039A7" } ], + "/integ-lambda-python-pipenv/my_handler_inline_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlineexcludesServiceRoleFF9028A3" + } + ], + "/integ-lambda-python-pipenv/my_handler_inline_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlineexcludes9ACF1422" + } + ], + "/integ-lambda-python-pipenv/my_handler_python_38_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38excludesServiceRole05CD433C" + } + ], + "/integ-lambda-python-pipenv/my_handler_python_38_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38excludes1CEDD615" + } + ], + "/integ-lambda-python-pipenv/my_handler_python_37_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37excludesServiceRole083BD595" + } + ], + "/integ-lambda-python-pipenv/my_handler_python_37_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37excludes977F9CDF" + } + ], "/integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}": [ { "type": "aws:cdk:logicalId", @@ -93,6 +123,24 @@ "data": "ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" } ], + "/integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + ], + "/integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + ], + "/integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + ], "/integ-lambda-python-pipenv/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -124,7 +172,7 @@ "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}/60915425ae6d91c88b04adf7c9631b4ea5f48c4764bbff1edc0bc70d57705d3f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/18850596c8959107f64d5dfdacaa5c53015e0bb3e8dd6d3f4ba039dad52e576b.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -153,16 +201,10 @@ "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3dInvokeEBA46CA4" } ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3dAssertEqualsLambdainvoke0BDD9934" - } - ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/AssertionResults": [ + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsLambdainvoke556559ea7575e3a52e6d6c32e2c07934" + "data": "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d" } ], "/pipenv/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ @@ -189,16 +231,10 @@ "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292InvokeFD76DE7B" } ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292AssertEqualsLambdainvoke3F6858A2" - } - ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/AssertionResults": [ + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsLambdainvoke921b66a1d8c9b23c2c2caef76d4b249b" + "data": "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292" } ], "/pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default": [ @@ -213,16 +249,64 @@ "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252" } ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/Default/Default": [ + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36cInvoke7568F400" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default/Default": [ { "type": "aws:cdk:logicalId", - "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75AssertEqualsLambdainvoke2346EE1F" + "data": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7" } ], - "/pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/AssertionResults": [ + "/pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Invoke": [ { "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsLambdainvoke98ea6f3253baf793823267fb4d86d1ed" + "data": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7Invoke1AF08F67" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvokefbdb1fc975f2f372fd64335aa07b46b7" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172Invoke5D442C14" + } + ], + "/pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke26ce5a20d1ffee210d056cd2aa005172" } ], "/pipenv/DefaultTest/DeployAssert/BootstrapVersion": [ @@ -239,6 +323,12 @@ ] }, "displayName": "pipenv/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.assets.json index 636ffaeafc5ce..0483f3451c18a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.assets.json @@ -1,20 +1,20 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7": { + "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { "source": { - "path": "asset.84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.bundle", + "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.zip", + "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "60915425ae6d91c88b04adf7c9631b4ea5f48c4764bbff1edc0bc70d57705d3f": { + "18850596c8959107f64d5dfdacaa5c53015e0bb3e8dd6d3f4ba039dad52e576b": { "source": { "path": "pipenvDefaultTestDeployAssertF8231517.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "60915425ae6d91c88b04adf7c9631b4ea5f48c4764bbff1edc0bc70d57705d3f.json", + "objectKey": "18850596c8959107f64d5dfdacaa5c53015e0bb3e8dd6d3f4ba039dad52e576b.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.template.json index 4c9ade29468ec..34e4c1e79d66a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/pipenvDefaultTestDeployAssertF8231517.template.json @@ -11,13 +11,14 @@ }, "service": "Lambda", "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", "parameters": { "FunctionName": { "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerinline53D120C7B0898676" } }, "flattenResponse": "false", - "salt": "1662643820432" + "salt": "1676321224706" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -37,27 +38,6 @@ } } }, - "LambdaInvoke81c9998b1b428b309c8501e21b919d3dAssertEqualsLambdainvoke0BDD9934": { - "Type": "Custom::DeployAssert@AssertEquals", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "actual": { - "Fn::GetAtt": [ - "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", - "apiCallResponse" - ] - }, - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1662643820433" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { "Type": "AWS::IAM::Role", "Properties": { @@ -203,6 +183,126 @@ ] } ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + ] + ] + } + ] } ] } @@ -218,7 +318,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "84802aa01d2d2c9e7d8d69705ee832c97f1ebad2d73c72be5c32d53f16cf90a7.zip" + "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -241,13 +341,14 @@ }, "service": "Lambda", "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", "parameters": { "FunctionName": { "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" } }, "flattenResponse": "false", - "salt": "1662643820434" + "salt": "1676321224707" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -267,8 +368,8 @@ } } }, - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292AssertEqualsLambdainvoke3F6858A2": { - "Type": "Custom::DeployAssert@AssertEquals", + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { "Fn::GetAtt": [ @@ -276,19 +377,36 @@ "Arn" ] }, - "actual": { - "Fn::GetAtt": [ - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", - "apiCallResponse" - ] - }, + "service": "Lambda", + "api": "invoke", "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1662643820434" + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + } + }, + "flattenResponse": "false", + "salt": "1676321224707" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { @@ -299,23 +417,24 @@ }, "service": "Lambda", "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", "parameters": { "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" } }, "flattenResponse": "false", - "salt": "1662643820434" + "salt": "1676321224708" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252": { + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36cInvoke7568F400": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" }, "Principal": { "Fn::GetAtt": [ @@ -325,8 +444,8 @@ } } }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75AssertEqualsLambdainvoke2346EE1F": { - "Type": "Custom::DeployAssert@AssertEquals", + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", "Properties": { "ServiceToken": { "Fn::GetAtt": [ @@ -334,41 +453,120 @@ "Arn" ] }, - "actual": { + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + }, + "flattenResponse": "false", + "salt": "1676321224708" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7Invoke1AF08F67": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + }, + "Principal": { "Fn::GetAtt": [ - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "apiCallResponse" + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" ] }, + "service": "Lambda", + "api": "invoke", "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "salt": "1662643820434" + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + }, + "flattenResponse": "false", + "salt": "1676321224708" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172Invoke5D442C14": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-pipenv:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } } }, "Outputs": { - "AssertionResultsAssertEqualsLambdainvoke556559ea7575e3a52e6d6c32e2c07934": { + "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke81c9998b1b428b309c8501e21b919d3dAssertEqualsLambdainvoke0BDD9934", - "data" + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", + "assertion" ] } }, - "AssertionResultsAssertEqualsLambdainvoke921b66a1d8c9b23c2c2caef76d4b249b": { + "AssertionResultsLambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292AssertEqualsLambdainvoke3F6858A2", - "data" + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", + "assertion" ] } }, - "AssertionResultsAssertEqualsLambdainvoke98ea6f3253baf793823267fb4d86d1ed": { + "AssertionResultsLambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { "Value": { "Fn::GetAtt": [ - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75AssertEqualsLambdainvoke2346EE1F", - "data" + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", + "assertion" ] } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/tree.json index c8fc3ed91b09b..8c19769996a99 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - }, "integ-lambda-python-pipenv": { "id": "integ-lambda-python-pipenv", "path": "integ-lambda-python-pipenv", @@ -22,11 +14,379 @@ "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-pipenv/my_handler_inline/ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_inline/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_inline/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_inline/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-pipenv/my_handler_inline/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-pipenv/my_handler_inline/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_inline/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_inline/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "2f3bbbf29fb95dea832d2f407fb3af92e2179a31a179650c1e9bad3d5d51afaf.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerinlineServiceRole10C681F6", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.9" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_38": { + "id": "my_handler_python_38", + "path": "integ-lambda-python-pipenv/my_handler_python_38", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_38/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_38/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_38/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-pipenv/my_handler_python_38/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-pipenv/my_handler_python_38/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_python_38/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_38/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "393d0817d83ce87664be2c627863e3f448f1106ceeb687e3f3c370b7957b9a21.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython38ServiceRole2049AFF7", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.8" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_37": { + "id": "my_handler_python_37", + "path": "integ-lambda-python-pipenv/my_handler_python_37", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_37/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_37/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_37/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-pipenv/my_handler_python_37/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-pipenv/my_handler_python_37/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_python_37/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_37/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "f4e3739faf89086835a11fc5cdc60f9f437560fdc808ba5f7b8c717b280eb2b1.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37ServiceRole45CBD18D", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_inline_excludes": { + "id": "my_handler_inline_excludes", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_inline/ServiceRole/Resource", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -71,11 +431,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-pipenv/my_handler_inline/Code", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-pipenv/my_handler_inline/Code/Stage", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/Code/Stage", "constructInfo": { "fqn": "@aws-cdk/core.AssetStaging", "version": "0.0.0" @@ -83,7 +443,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-pipenv/my_handler_inline/Code/AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/Code/AssetBucket", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -97,7 +457,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_inline/Resource", + "path": "integ-lambda-python-pipenv/my_handler_inline_excludes/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -105,11 +465,11 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "803e66cf17a8155efd491fa5e68f796bb74ae8337c455b23b5e52d0e5927b2a7.zip" + "s3Key": "6259c1fcafbecaa6547531670fa651cce171cf49a597b58343c28ad4c6a4ba04.zip" }, "role": { "Fn::GetAtt": [ - "myhandlerinlineServiceRole10C681F6", + "myhandlerinlineexcludesServiceRoleFF9028A3", "Arn" ] }, @@ -128,17 +488,25 @@ "version": "0.0.0" } }, - "my_handler_python_38": { - "id": "my_handler_python_38", - "path": "integ-lambda-python-pipenv/my_handler_python_38", + "my_handler_python_38_excludes": { + "id": "my_handler_python_38_excludes", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-pipenv/my_handler_python_38/ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_python_38/ServiceRole/Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -183,11 +551,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-pipenv/my_handler_python_38/Code", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-pipenv/my_handler_python_38/Code/Stage", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/Code/Stage", "constructInfo": { "fqn": "@aws-cdk/core.AssetStaging", "version": "0.0.0" @@ -195,7 +563,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-pipenv/my_handler_python_38/Code/AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/Code/AssetBucket", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -209,7 +577,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_python_38/Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_38_excludes/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -217,11 +585,11 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "2a6fcac567a26e1be604dec572e270fbd091180dccf23a209e21c5900ce24ff0.zip" + "s3Key": "7885d5d20a5bca7141b637a7e9db57f95730b26b0c4a5d7a6e6db0f392042f7e.zip" }, "role": { "Fn::GetAtt": [ - "myhandlerpython38ServiceRole2049AFF7", + "myhandlerpython38excludesServiceRole05CD433C", "Arn" ] }, @@ -240,17 +608,25 @@ "version": "0.0.0" } }, - "my_handler_python_37": { - "id": "my_handler_python_37", - "path": "integ-lambda-python-pipenv/my_handler_python_37", + "my_handler_python_37_excludes": { + "id": "my_handler_python_37_excludes", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "integ-lambda-python-pipenv/my_handler_python_37/ServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_python_37/ServiceRole/Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -295,11 +671,11 @@ }, "Code": { "id": "Code", - "path": "integ-lambda-python-pipenv/my_handler_python_37/Code", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/Code", "children": { "Stage": { "id": "Stage", - "path": "integ-lambda-python-pipenv/my_handler_python_37/Code/Stage", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/Code/Stage", "constructInfo": { "fqn": "@aws-cdk/core.AssetStaging", "version": "0.0.0" @@ -307,7 +683,7 @@ }, "AssetBucket": { "id": "AssetBucket", - "path": "integ-lambda-python-pipenv/my_handler_python_37/Code/AssetBucket", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/Code/AssetBucket", "constructInfo": { "fqn": "@aws-cdk/aws-s3.BucketBase", "version": "0.0.0" @@ -321,7 +697,7 @@ }, "Resource": { "id": "Resource", - "path": "integ-lambda-python-pipenv/my_handler_python_37/Resource", + "path": "integ-lambda-python-pipenv/my_handler_python_37_excludes/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -329,11 +705,11 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "e223ff54d4d46f8f1e5876b5697de59a81ba36113fa0bf2b46d29917fcbee403.zip" + "s3Key": "53f2ca7d739f5ee14104a478b820bb6f429b8afaa9c00a9aed6cf32538cf7207.zip" }, "role": { "Fn::GetAtt": [ - "myhandlerpython37ServiceRole45CBD18D", + "myhandlerpython37excludesServiceRole083BD595", "Arn" ] }, @@ -379,11 +755,51 @@ "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" } + }, + "Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}": { + "id": "Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}", + "path": "integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}": { + "id": "Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}", + "path": "integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}", + "path": "integ-lambda-python-pipenv/Exports/Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-lambda-python-pipenv/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-lambda-python-pipenv/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -405,7 +821,7 @@ "path": "pipenv/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } }, "DeployAssert": { @@ -425,13 +841,13 @@ "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" } }, "Default": { @@ -460,64 +876,18 @@ "version": "0.0.0" } }, - "AssertEqualsLambdainvoke": { - "id": "AssertEqualsLambdainvoke", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - }, - "Default": { - "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/Default", - "children": { - "Default": { - "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertEqualsLambdainvoke/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults", "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" } }, "SingletonFunction1488541a7b23466481b69b4408076b81": { @@ -551,7 +921,7 @@ }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } }, "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { @@ -567,13 +937,13 @@ "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" } }, "Default": { @@ -602,95 +972,111 @@ "version": "0.0.0" } }, - "AssertEqualsLambdainvoke": { - "id": "AssertEqualsLambdainvoke", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke", + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - } - }, + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } - }, + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", + "children": { "Default": { "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/Default", - "children": { - "Default": { - "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertEqualsLambdainvoke/AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" } }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { - "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { + "id": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" } }, "Default": { "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default", "children": { "Default": { "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -704,70 +1090,164 @@ }, "Invoke": { "id": "Invoke", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } }, - "AssertEqualsLambdainvoke": { - "id": "AssertEqualsLambdainvoke", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke", + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { + "id": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/SdkProvider", "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" - } - } - }, + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } - }, + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default", + "children": { "Default": { "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/Default", - "children": { - "Default": { - "id": "Default", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", + "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertEqualsLambdainvoke/AssertionResults", + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { + "id": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default", + "children": { + "Default": { + "id": "Default", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default/Default", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "pipenv/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "pipenv/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "pipenv/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" } } }, @@ -778,14 +1258,22 @@ } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.95" + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" } } }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.95" + "version": "10.1.237" } } }, diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.ts index 3d5a31dac63f9..ef43660f67a66 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.pipenv.ts @@ -35,6 +35,33 @@ class TestStack extends Stack { runtime: Runtime.PYTHON_3_7, }); this.functionNames.push(pythonFunction37.functionName); + + const pythonFunction39Excludes = new lambda.PythonFunction(this, 'my_handler_inline_excludes', { + entry: path.join(__dirname, 'lambda-handler-pipenv'), + runtime: Runtime.PYTHON_3_9, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction39Excludes.functionName); + + const pythonFunction38Excludes = new lambda.PythonFunction(this, 'my_handler_python_38_excludes', { + entry: path.join(__dirname, 'lambda-handler-pipenv'), + runtime: Runtime.PYTHON_3_8, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction38Excludes.functionName); + + const pythonFunction37Excludes = new lambda.PythonFunction(this, 'my_handler_python_37_excludes', { + entry: path.join(__dirname, 'lambda-handler-pipenv'), + runtime: Runtime.PYTHON_3_7, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction37Excludes.functionName); } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out deleted file mode 100644 index d8b441d447f8a..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json deleted file mode 100644 index 0c220fe46bca6..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.assets.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "version": "29.0.0", - "files": { - "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9": { - "source": { - "path": "asset.9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e": { - "source": { - "path": "asset.66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8": { - "source": { - "path": "asset.ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499": { - "source": { - "path": "asset.8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572": { - "source": { - "path": "asset.5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49": { - "source": { - "path": "asset.194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1": { - "source": { - "path": "integ-lambda-python-poetry-exclusions.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json deleted file mode 100644 index f53b62c1efe1d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ-lambda-python-poetry-exclusions.template.json +++ /dev/null @@ -1,406 +0,0 @@ -{ - "Resources": { - "myhandlerinlineServiceRole10C681F6": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerinline53D120C7": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerinlineServiceRole10C681F6", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.9" - }, - "DependsOn": [ - "myhandlerinlineServiceRole10C681F6" - ] - }, - "myhandlerinlinewithhashesServiceRoleDC418F75": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerinlinewithhashes352ED54D": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerinlinewithhashesServiceRoleDC418F75", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.9" - }, - "DependsOn": [ - "myhandlerinlinewithhashesServiceRoleDC418F75" - ] - }, - "myhandlerpython38ServiceRole2049AFF7": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerpython384D62BBB5": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerpython38ServiceRole2049AFF7", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.8" - }, - "DependsOn": [ - "myhandlerpython38ServiceRole2049AFF7" - ] - }, - "myhandlerpython38withhashesServiceRoleFE19CA7C": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerpython38withhashesF2275091": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerpython38withhashesServiceRoleFE19CA7C", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.8" - }, - "DependsOn": [ - "myhandlerpython38withhashesServiceRoleFE19CA7C" - ] - }, - "myhandlerpython37ServiceRole45CBD18D": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerpython37C34039A7": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerpython37ServiceRole45CBD18D", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.7" - }, - "DependsOn": [ - "myhandlerpython37ServiceRole45CBD18D" - ] - }, - "myhandlerpython37withhashesServiceRoleD9828997": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "myhandlerpython37withhashesE95C48AC": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip" - }, - "Role": { - "Fn::GetAtt": [ - "myhandlerpython37withhashesServiceRoleD9828997", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "python3.7" - }, - "DependsOn": [ - "myhandlerpython37withhashesServiceRoleD9828997" - ] - } - }, - "Outputs": { - "ExportsOutputRefmyhandlerinline53D120C7B0898676": { - "Value": { - "Ref": "myhandlerinline53D120C7" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" - } - }, - "ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6": { - "Value": { - "Ref": "myhandlerinlinewithhashes352ED54D" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" - } - }, - "ExportsOutputRefmyhandlerpython384D62BBB58AA8B940": { - "Value": { - "Ref": "myhandlerpython384D62BBB5" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" - } - }, - "ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A": { - "Value": { - "Ref": "myhandlerpython38withhashesF2275091" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" - } - }, - "ExportsOutputRefmyhandlerpython37C34039A7BB71D94D": { - "Value": { - "Ref": "myhandlerpython37C34039A7" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" - } - }, - "ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4": { - "Value": { - "Ref": "myhandlerpython37withhashesE95C48AC" - }, - "Export": { - "Name": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json deleted file mode 100644 index 2eb6e84ffde0d..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/integ.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "29.0.0", - "testCases": { - "poetry/DefaultTest": { - "stacks": [ - "integ-lambda-python-poetry-exclusions" - ], - "stackUpdateWorkflow": false, - "assertionStack": "poetry/DefaultTest/DeployAssert", - "assertionStackName": "poetryDefaultTestDeployAssertE9C9CB8F" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json deleted file mode 100644 index ed2c7d688caf0..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/manifest.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "version": "29.0.0", - "artifacts": { - "integ-lambda-python-poetry-exclusions.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "integ-lambda-python-poetry-exclusions.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "integ-lambda-python-poetry-exclusions": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "integ-lambda-python-poetry-exclusions.template.json", - "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}/65276d01f4d7a39ac04d2c12fe83fc6f50070d3faea4ebb30c1bddffd9fd40c1.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "integ-lambda-python-poetry-exclusions.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "integ-lambda-python-poetry-exclusions.assets" - ], - "metadata": { - "/integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerinlineServiceRole10C681F6" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_inline/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerinline53D120C7" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerinlinewithhashesServiceRoleDC418F75" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerinlinewithhashes352ED54D" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython38ServiceRole2049AFF7" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_38/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython384D62BBB5" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython38withhashesServiceRoleFE19CA7C" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython38withhashesF2275091" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython37ServiceRole45CBD18D" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_37/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython37C34039A7" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython37withhashesServiceRoleD9828997" - } - ], - "/integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "myhandlerpython37withhashesE95C48AC" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerinline53D120C7B0898676" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" - } - ], - "/integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" - } - ], - "/integ-lambda-python-poetry-exclusions/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/integ-lambda-python-poetry-exclusions/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "integ-lambda-python-poetry-exclusions" - }, - "poetryDefaultTestDeployAssertE9C9CB8F.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "poetryDefaultTestDeployAssertE9C9CB8F.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "poetryDefaultTestDeployAssertE9C9CB8F": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "poetryDefaultTestDeployAssertE9C9CB8F.template.json", - "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}/fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "poetryDefaultTestDeployAssertE9C9CB8F.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "integ-lambda-python-poetry-exclusions", - "poetryDefaultTestDeployAssertE9C9CB8F.assets" - ], - "metadata": { - "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3d" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke81c9998b1b428b309c8501e21b919d3dInvokeEBA46CA4" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d" - } - ], - "/poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" - } - ], - "/poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8InvokeEA59DC11" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292InvokeFD76DE7B" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39eInvoke930611A4" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke26497bb1c12c14ed3deada8d7d76b39e" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke": [ - { - "type": "aws:cdk:logicalId", - "data": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89Invoke884F6CA8" - } - ], - "/poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsLambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89" - } - ], - "/poetry/DefaultTest/DeployAssert/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/poetry/DefaultTest/DeployAssert/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "poetry/DefaultTest/DeployAssert" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json deleted file mode 100644 index e0fc6e1590d32..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "29.0.0", - "files": { - "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { - "source": { - "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3": { - "source": { - "path": "poetryDefaultTestDeployAssertE9C9CB8F.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "fa2e68ad34e7e7da5bafb1cd2d8672e24592198d01f5be4c0d1430f451db84d3.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json deleted file mode 100644 index acf91d438cf6c..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json +++ /dev/null @@ -1,608 +0,0 @@ -{ - "Resources": { - "LambdaInvoke81c9998b1b428b309c8501e21b919d3d": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" - } - }, - "flattenResponse": "false", - "salt": "1675812819695" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke81c9998b1b428b309c8501e21b919d3dInvokeEBA46CA4": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { - "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" - } - ], - "Policies": [ - { - "PolicyName": "Inline", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinline53D120C7B0898676" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" - } - ] - ] - } - ] - }, - { - "Action": [ - "lambda:Invoke" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "lambda:InvokeFunction" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":lambda:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":function:", - { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" - } - ] - ] - } - ] - } - ] - } - } - ] - } - }, - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Runtime": "nodejs14.x", - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" - }, - "Timeout": 120, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" - } - }, - "flattenResponse": "false", - "salt": "1675812819696" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8InvokeEA59DC11": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerinlinewithhashes352ED54DCDE8C1A6" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" - } - }, - "flattenResponse": "false", - "salt": "1675812819696" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292InvokeFD76DE7B": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython384D62BBB58AA8B940" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" - } - }, - "flattenResponse": "false", - "salt": "1675812819697" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39eInvoke930611A4": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython38withhashesF2275091B829511A" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" - } - }, - "flattenResponse": "false", - "salt": "1675812819697" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75Invoke11F9A252": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37C34039A7BB71D94D" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { - "Type": "Custom::DeployAssert@SdkCallLambdainvoke", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Lambda", - "api": "invoke", - "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", - "parameters": { - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" - } - }, - "flattenResponse": "false", - "salt": "1675812819697" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89Invoke884F6CA8": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::ImportValue": "integ-lambda-python-poetry-exclusions:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" - }, - "Principal": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - } - }, - "Outputs": { - "AssertionResultsLambdaInvoke81c9998b1b428b309c8501e21b919d3d": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "assertion" - ] - } - }, - "AssertionResultsLambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { - "Value": { - "Fn::GetAtt": [ - "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", - "assertion" - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json deleted file mode 100644 index fe3e0f8e6185b..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.js.snapshot/tree.json +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "integ-lambda-python-poetry-exclusions": { - "id": "integ-lambda-python-poetry-exclusions", - "path": "integ-lambda-python-poetry-exclusions", - "children": { - "my_handler_inline": { - "id": "my_handler_inline", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "9fbbaa0b9e61fd469cda1c66b3cec7afcb83a2a2d3160ba64c65c71b5392bda9.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerinlineServiceRole10C681F6", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.9" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "my_handler_inline_with_hashes": { - "id": "my_handler_inline_with_hashes", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_inline_with_hashes/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "66b50a6ad418ff67c1436cae63384d25da0d39629aaf52c27e775e9ebd341b5e.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerinlinewithhashesServiceRoleDC418F75", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.9" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "my_handler_python_38": { - "id": "my_handler_python_38", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "ac7fc706a98de3c937a46b064c2927412487575b1079c79da7eb8ee149e829a8.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerpython38ServiceRole2049AFF7", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.8" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "my_handler_python_38_with_hashes": { - "id": "my_handler_python_38_with_hashes", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_38_with_hashes/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "8136fefa1ea7ddaeb5383df88a73f7c70c44d452c22d5a53b8444b503c16f499.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerpython38withhashesServiceRoleFE19CA7C", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.8" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "my_handler_python_37": { - "id": "my_handler_python_37", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "5720e7adb19d468ee661e3a5e63b6d956a5235379dbfc75c23df5e1ee36ec572.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerpython37ServiceRole45CBD18D", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.7" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "my_handler_python_37_with_hashes": { - "id": "my_handler_python_37_with_hashes", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "integ-lambda-python-poetry-exclusions/my_handler_python_37_with_hashes/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "194fdbd14e78bbc4194900647e969123863eb1e24965cf5c7e549e6513126f49.zip" - }, - "role": { - "Fn::GetAtt": [ - "myhandlerpython37withhashesServiceRoleD9828997", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "python3.7" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", - "version": "0.0.0" - } - }, - "Exports": { - "id": "Exports", - "path": "integ-lambda-python-poetry-exclusions/Exports", - "children": { - "Output{\"Ref\":\"myhandlerinline53D120C7\"}": { - "id": "Output{\"Ref\":\"myhandlerinline53D120C7\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": { - "id": "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": { - "id": "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": { - "id": "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"myhandlerpython37C34039A7\"}": { - "id": "Output{\"Ref\":\"myhandlerpython37C34039A7\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": { - "id": "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", - "path": "integ-lambda-python-poetry-exclusions/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "integ-lambda-python-poetry-exclusions/BootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "integ-lambda-python-poetry-exclusions/CheckBootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "poetry": { - "id": "poetry", - "path": "poetry", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "poetry/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "poetry/DefaultTest/DeployAssert", - "children": { - "LambdaInvoke81c9998b1b428b309c8501e21b919d3d": { - "id": "LambdaInvoke81c9998b1b428b309c8501e21b919d3d", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "SingletonFunction1488541a7b23466481b69b4408076b81": { - "id": "SingletonFunction1488541a7b23466481b69b4408076b81", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", - "children": { - "Staging": { - "id": "Staging", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "Role": { - "id": "Role", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Handler": { - "id": "Handler", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - }, - "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { - "id": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { - "id": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { - "id": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { - "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { - "id": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default", - "children": { - "Default": { - "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "Invoke": { - "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "poetry/DefaultTest/DeployAssert/BootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "poetry/DefaultTest/DeployAssert/CheckBootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.237" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts deleted file mode 100644 index bce5c5c026873..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry-exclusions.ts +++ /dev/null @@ -1,98 +0,0 @@ -import * as path from 'path'; -import { Runtime } from '@aws-cdk/aws-lambda'; -import { App, Stack, StackProps } from '@aws-cdk/core'; -import { IntegTest, ExpectedResult } from '@aws-cdk/integ-tests'; -import { Construct } from 'constructs'; -import * as lambda from '../lib'; - -/* - * Stack verification steps: - * aws lambda invoke --function-name --invocation-type Event --payload $(base64 <<<''OK'') response.json - */ - -class TestStack extends Stack { - public readonly functionNames: string[] = []; - constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - - const pythonFunction39 = new lambda.PythonFunction(this, 'my_handler_inline', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_9, - bundling: { - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction39.functionName); - - const pythonFunction39WithHashes = new lambda.PythonFunction(this, 'my_handler_inline_with_hashes', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_9, - bundling: { - poetryIncludeHashes: true, - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction39WithHashes.functionName); - - const pythonFunction38 = new lambda.PythonFunction(this, 'my_handler_python_38', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_8, - bundling: { - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction38.functionName); - - const pythonFunction38WithHashes = new lambda.PythonFunction(this, 'my_handler_python_38_with_hashes', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_8, - bundling: { - poetryIncludeHashes: true, - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction38WithHashes.functionName); - - const pythonFunction37 = new lambda.PythonFunction(this, 'my_handler_python_37', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_7, - bundling: { - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction37.functionName); - - const pythonFunction37WithHashes = new lambda.PythonFunction(this, 'my_handler_python_37_with_hashes', { - entry: path.join(__dirname, 'lambda-handler-poetry'), - runtime: Runtime.PYTHON_3_7, - bundling: { - poetryIncludeHashes: true, - poetryAssetExcludes: ['.ignorefile'], - }, - }); - this.functionNames.push(pythonFunction37WithHashes.functionName); - - } -} - -const app = new App(); -const testCase = new TestStack(app, 'integ-lambda-python-poetry-exclusions'); - -const integ = new IntegTest(app, 'poetry', { - testCases: [testCase], - // disabling update workflow because we don't want to include the assets in the snapshot - // python bundling changes the asset hash pretty frequently - stackUpdateWorkflow: false, -}); - -testCase.functionNames.forEach(functionName => { - const invoke = integ.assertions.invokeFunction({ - functionName: functionName, - }); - - invoke.expect(ExpectedResult.objectLike({ - Payload: '200', - })); -}); - -app.synth(); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js new file mode 100644 index 0000000000000..58bcb1ef7f38e --- /dev/null +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle/index.js @@ -0,0 +1,1205 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + /** + * Check whether the provided object is a subtype of the `IMatcher`. + */ + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failuresHere = /* @__PURE__ */ new Map(); + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.innerMatchFailures = /* @__PURE__ */ new Map(); + this._hasFailed = false; + this._failCount = 0; + this._cost = 0; + this.target = target; + } + /** + * DEPRECATED + * @deprecated use recordFailure() + */ + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + /** + * Record a new failure into this result at a specific path. + */ + recordFailure(failure) { + const failKey = failure.path.join("."); + let list = this.failuresHere.get(failKey); + if (!list) { + list = []; + this.failuresHere.set(failKey, list); + } + this._failCount += 1; + this._cost += failure.cost ?? 1; + list.push(failure); + this._hasFailed = true; + return this; + } + /** Whether the match is a success */ + get isSuccess() { + return !this._hasFailed; + } + /** Does the result contain any failures. If not, the result is a success */ + hasFailed() { + return this._hasFailed; + } + /** The number of failures */ + get failCount() { + return this._failCount; + } + /** The cost of the failures so far */ + get failCost() { + return this._cost; + } + /** + * Compose the results of a previous match as a subtree. + * @param id the id of the parent tree. + */ + compose(id, inner) { + if (inner.hasFailed()) { + this._hasFailed = true; + this._failCount += inner.failCount; + this._cost += inner._cost; + this.innerMatchFailures.set(id, inner); + } + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + /** + * Prepare the result to be analyzed. + * This API *must* be called prior to analyzing these results. + */ + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + /** + * Render the failed match in a presentable way + * + * Prefer using `renderMismatch` over this method. It is left for backwards + * compatibility for test suites that expect it, but `renderMismatch()` will + * produce better output. + */ + toHumanStrings() { + const failures = new Array(); + debugger; + recurse(this, []); + return failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at /${r.path.join("/")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + function recurse(x, prefix) { + for (const fail of Array.from(x.failuresHere.values()).flat()) { + failures.push({ + matcher: fail.matcher, + message: fail.message, + path: [...prefix, ...fail.path] + }); + } + for (const [key, inner] of x.innerMatchFailures.entries()) { + recurse(inner, [...prefix, key]); + } + } + } + /** + * Do a deep render of the match result, showing the structure mismatches in context + */ + renderMismatch() { + if (!this.hasFailed()) { + return ""; + } + const parts = new Array(); + const indents = new Array(); + emitFailures(this, ""); + recurse(this); + return moveMarkersToFront(parts.join("").trimEnd()); + function emit(x) { + if (x === void 0) { + debugger; + } + parts.push(x.replace(/\n/g, ` +${indents.join("")}`)); + } + function emitFailures(r, path, scrapSet) { + for (const fail of r.failuresHere.get(path) ?? []) { + emit(`!! ${fail.message} +`); + } + scrapSet == null ? void 0 : scrapSet.delete(path); + } + function recurse(r) { + const remainingFailures = new Set(Array.from(r.failuresHere.keys()).filter((x) => x !== "")); + if (Array.isArray(r.target)) { + indents.push(" "); + emit("[\n"); + for (const [first, i] of enumFirst(range(r.target.length))) { + if (!first) { + emit(",\n"); + } + emitFailures(r, `${i}`, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(`${i}`); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + recurseComparingValues(innerMatcher, r.target[i]); + } else { + emit(renderAbridged(r.target[i])); + } + } + emitRemaining(); + indents.pop(); + emit("\n]"); + return; + } + if (r.target && typeof r.target === "object") { + indents.push(" "); + emit("{\n"); + const keys = Array.from(/* @__PURE__ */ new Set([ + ...Object.keys(r.target), + ...Array.from(remainingFailures) + ])).sort(); + for (const [first, key] of enumFirst(keys)) { + if (!first) { + emit(",\n"); + } + emitFailures(r, key, remainingFailures); + const innerMatcher = r.innerMatchFailures.get(key); + if (innerMatcher) { + emitFailures(innerMatcher, ""); + emit(`${jsonify(key)}: `); + recurseComparingValues(innerMatcher, r.target[key]); + } else { + emit(`${jsonify(key)}: `); + emit(renderAbridged(r.target[key])); + } + } + emitRemaining(); + indents.pop(); + emit("\n}"); + return; + } + emitRemaining(); + emit(jsonify(r.target)); + function emitRemaining() { + if (remainingFailures.size > 0) { + emit("\n"); + } + for (const key of remainingFailures) { + emitFailures(r, key); + } + } + } + function recurseComparingValues(inner, actualValue) { + if (inner.target === actualValue) { + return recurse(inner); + } + emit(renderAbridged(actualValue)); + emit(" <*> "); + recurse(inner); + } + function renderAbridged(x) { + if (Array.isArray(x)) { + switch (x.length) { + case 0: + return "[]"; + case 1: + return `[ ${renderAbridged(x[0])} ]`; + case 2: + if (x.every((e) => ["number", "boolean", "string"].includes(typeof e))) { + return `[ ${x.map(renderAbridged).join(", ")} ]`; + } + return "[ ... ]"; + default: + return "[ ... ]"; + } + } + if (x && typeof x === "object") { + const keys = Object.keys(x); + switch (keys.length) { + case 0: + return "{}"; + case 1: + return `{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`; + default: + return "{ ... }"; + } + } + return jsonify(x); + } + function jsonify(x) { + return JSON.stringify(x) ?? "undefined"; + } + function moveMarkersToFront(x) { + const re = /^(\s+)!!/gm; + return x.replace(re, (_, spaces) => `!!${spaces.substring(0, spaces.length - 2)}`); + } + } + /** + * Record a capture against in this match result. + */ + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; +function* range(n) { + for (let i = 0; i < n; i++) { + yield i; + } +} +function* enumFirst(xs) { + let first = true; + for (const x of xs) { + yield [first, x]; + first = false; + } +} + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/sorting.ts +function sortKeyComparator(keyFn) { + return (a, b) => { + const ak = keyFn(a); + const bk = keyFn(b); + for (let i = 0; i < ak.length && i < bk.length; i++) { + const av = ak[i]; + const bv = bk[i]; + let diff = 0; + if (typeof av === "number" && typeof bv === "number") { + diff = av - bv; + } else if (typeof av === "string" && typeof bv === "string") { + diff = av.localeCompare(bv); + } + if (diff !== 0) { + return diff; + } + } + return bk.length - ak.length; + }; +} + +// ../assertions/lib/private/sparse-matrix.ts +var SparseMatrix = class { + constructor() { + this.matrix = /* @__PURE__ */ new Map(); + } + get(row, col) { + var _a; + return (_a = this.matrix.get(row)) == null ? void 0 : _a.get(col); + } + row(row) { + var _a; + return Array.from(((_a = this.matrix.get(row)) == null ? void 0 : _a.entries()) ?? []); + } + set(row, col, value) { + let r = this.matrix.get(row); + if (!r) { + r = /* @__PURE__ */ new Map(); + this.matrix.set(row, r); + } + r.set(col, value); + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + /** + * Use this matcher in the place of a field's value, if the field must not be present. + */ + static absent() { + return new AbsentMatch("absent"); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must be in the same order as would be found. + * @param pattern the pattern to match + */ + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + /** + * Matches the specified pattern with the array found in the same relative path of the target. + * The set of elements (or matchers) must match exactly and in order. + * @param pattern the pattern to match + */ + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + /** + * Deep exact matching of the specified pattern to the target. + * @param pattern the pattern to match + */ + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must be present in the target but the target can be a superset. + * @param pattern the pattern to match + */ + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + /** + * Matches the specified pattern to an object found in the same relative path of the target. + * The keys and their values (or matchers) must match exactly with the target. + * @param pattern the pattern to match + */ + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + /** + * Matches any target which does NOT follow the specified pattern. + * @param pattern the pattern to NOT match + */ + static not(pattern) { + return new NotMatch("not", pattern); + } + /** + * Matches any string-encoded JSON and applies the specified pattern after parsing it. + * @param pattern the pattern to match after parsing the encoded JSON. + */ + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + /** + * Matches any non-null value at the target. + */ + static anyValue() { + return new AnyMatch("anyValue"); + } + /** + * Matches targets according to a regular expression + */ + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + return this.subsequence ? this.testSubsequence(actual) : this.testFullArray(actual); + } + testFullArray(actual) { + const result = new MatchResult(actual); + let i = 0; + for (; i < this.pattern.length && i < actual.length; i++) { + const patternElement = this.pattern[i]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const innerResult = matcher.test(actual[i]); + result.compose(`${i}`, innerResult); + } + if (i < this.pattern.length) { + result.recordFailure({ + matcher: this, + message: `Not enough elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + if (i < actual.length) { + result.recordFailure({ + matcher: this, + message: `Too many elements in array (expecting ${this.pattern.length}, got ${actual.length})`, + path: [`${i}`] + }); + } + return result; + } + testSubsequence(actual) { + const result = new MatchResult(actual); + let patternIdx = 0; + let actualIdx = 0; + const matches = new SparseMatrix(); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (matcherName == "absent" || matcherName == "anyValue") { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + matches.set(patternIdx, actualIdx, innerResult); + actualIdx++; + if (innerResult.isSuccess) { + result.compose(`${actualIdx}`, innerResult); + patternIdx++; + } + } + if (patternIdx < this.pattern.length) { + for (let spi = 0; spi < patternIdx; spi++) { + const foundMatch = matches.row(spi).find(([, r]) => r.isSuccess); + if (!foundMatch) { + continue; + } + const [index] = foundMatch; + result.compose(`${index}`, new MatchResult(actual[index]).recordFailure({ + matcher: this, + message: `arrayWith pattern ${spi} matched here`, + path: [], + cost: 0 + // This is an informational message so it would be unfair to assign it cost + })); + } + const failedMatches = matches.row(patternIdx); + failedMatches.sort(sortKeyComparator(([i, r]) => [r.failCost, i])); + if (failedMatches.length > 0) { + const [index, innerResult] = failedMatches[0]; + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. This is the closest match`, + path: [`${index}`], + cost: 0 + // Informational message + }); + result.compose(`${index}`, innerResult); + } else { + result.recordFailure({ + matcher: this, + message: `Could not match arrayWith pattern ${patternIdx}. No more elements to try`, + path: [`${actual.length}`] + }); + } + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [a], + message: `Unexpected key ${a}` + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [patternKey], + message: `Missing key '${patternKey}'` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(patternKey, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + if (getType(actual) !== "string") { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + if (innerResult.hasFailed()) { + innerResult.recordFailure({ + matcher: this, + path: [], + message: "Encoded JSON value does not match" + }); + } + return innerResult; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + /** + * Handles executing the custom resource event. If `stateMachineArn` is present + * in the props then trigger the waiter statemachine + */ + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Handle async requests from the waiter state machine + */ + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + /** + * Start a step function state machine which will wait for the request + * to be successful. + */ + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: matchResult.renderMismatch() + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + /** + * Return a Matcher that can be tested against the actual results. + * This will convert the encoded matchers into their corresponding + * assertions matcher. + * + * For example: + * + * ExpectedResult.objectLike({ + * Messages: [{ + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * }], + * }); + * + * Will be encoded as: + * { + * $ObjectLike: { + * Messages: [{ + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * }], + * }, + * } + * + * Which can then be parsed by this function. For each key (recursively) + * the parser will check if the value has one of the encoded matchers as a key + * and if so, it will set the value as the Matcher. So, + * + * { + * Body: { + * $ObjectLike: { + * Elements: { + * $ArrayWith: [{ Asdf: 3 }], + * }, + * Payload: { + * $SerializedJson: { key: 'value' } + * } + * }, + * }, + * } + * + * Will be converted to + * { + * Body: Match.objectLike({ + * Elements: Match.arrayWith([{ Asdf: 3 }]), + * Payload: Match.serializedJson({ key: 'value' }), + * }), + * } + */ + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + case "$SerializedJson": + return Match.serializedJson(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + // return both the result of the API call _and_ the assertion results + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.bundle/index.js b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.bundle/index.js deleted file mode 100644 index a9e7e7241efc7..0000000000000 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/asset.d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.bundle/index.js +++ /dev/null @@ -1,669 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// lib/assertions/providers/lambda-handler/index.ts -var lambda_handler_exports = {}; -__export(lambda_handler_exports, { - handler: () => handler -}); -module.exports = __toCommonJS(lambda_handler_exports); - -// ../assertions/lib/matcher.ts -var Matcher = class { - static isMatcher(x) { - return x && x instanceof Matcher; - } -}; -var MatchResult = class { - constructor(target) { - this.failures = []; - this.captures = /* @__PURE__ */ new Map(); - this.finalized = false; - this.target = target; - } - push(matcher, path, message) { - return this.recordFailure({ matcher, path, message }); - } - recordFailure(failure) { - this.failures.push(failure); - return this; - } - hasFailed() { - return this.failures.length !== 0; - } - get failCount() { - return this.failures.length; - } - compose(id, inner) { - const innerF = inner.failures; - this.failures.push(...innerF.map((f) => { - return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; - })); - inner.captures.forEach((vals, capture) => { - vals.forEach((value) => this.recordCapture({ capture, value })); - }); - return this; - } - finished() { - if (this.finalized) { - return this; - } - if (this.failCount === 0) { - this.captures.forEach((vals, cap) => cap._captured.push(...vals)); - } - this.finalized = true; - return this; - } - toHumanStrings() { - return this.failures.map((r) => { - const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; - return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; - }); - } - recordCapture(options) { - let values = this.captures.get(options.capture); - if (values === void 0) { - values = []; - } - values.push(options.value); - this.captures.set(options.capture, values); - } -}; - -// ../assertions/lib/private/matchers/absent.ts -var AbsentMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual !== void 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Received ${actual}, but key should be absent` - }); - } - return result; - } -}; - -// ../assertions/lib/private/type.ts -function getType(obj) { - return Array.isArray(obj) ? "array" : typeof obj; -} - -// ../assertions/lib/match.ts -var Match = class { - static absent() { - return new AbsentMatch("absent"); - } - static arrayWith(pattern) { - return new ArrayMatch("arrayWith", pattern); - } - static arrayEquals(pattern) { - return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); - } - static exact(pattern) { - return new LiteralMatch("exact", pattern, { partialObjects: false }); - } - static objectLike(pattern) { - return new ObjectMatch("objectLike", pattern); - } - static objectEquals(pattern) { - return new ObjectMatch("objectEquals", pattern, { partial: false }); - } - static not(pattern) { - return new NotMatch("not", pattern); - } - static serializedJson(pattern) { - return new SerializedJson("serializedJson", pattern); - } - static anyValue() { - return new AnyMatch("anyValue"); - } - static stringLikeRegexp(pattern) { - return new StringLikeRegexpMatch("stringLikeRegexp", pattern); - } -}; -var LiteralMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partialObjects = options.partialObjects ?? false; - if (Matcher.isMatcher(this.pattern)) { - throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); - } - } - test(actual) { - if (Array.isArray(this.pattern)) { - return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); - } - if (typeof this.pattern === "object") { - return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); - } - const result = new MatchResult(actual); - if (typeof this.pattern !== typeof actual) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` - }); - return result; - } - if (actual !== this.pattern) { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected ${this.pattern} but received ${actual}` - }); - } - return result; - } -}; -var ArrayMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.subsequence = options.subsequence ?? true; - this.partialObjects = options.partialObjects ?? false; - } - test(actual) { - if (!Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type array but received ${getType(actual)}` - }); - } - if (!this.subsequence && this.pattern.length !== actual.length) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected array of length ${this.pattern.length} but received ${actual.length}` - }); - } - let patternIdx = 0; - let actualIdx = 0; - const result = new MatchResult(actual); - while (patternIdx < this.pattern.length && actualIdx < actual.length) { - const patternElement = this.pattern[patternIdx]; - const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); - const matcherName = matcher.name; - if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { - throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); - } - const innerResult = matcher.test(actual[actualIdx]); - if (!this.subsequence || !innerResult.hasFailed()) { - result.compose(`[${actualIdx}]`, innerResult); - patternIdx++; - actualIdx++; - } else { - actualIdx++; - } - } - for (; patternIdx < this.pattern.length; patternIdx++) { - const pattern = this.pattern[patternIdx]; - const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; - result.recordFailure({ - matcher: this, - path: [], - message: `Missing element${element}at pattern index ${patternIdx}` - }); - } - return result; - } -}; -var ObjectMatch = class extends Matcher { - constructor(name, pattern, options = {}) { - super(); - this.name = name; - this.pattern = pattern; - this.partial = options.partial ?? true; - } - test(actual) { - if (typeof actual !== "object" || Array.isArray(actual)) { - return new MatchResult(actual).recordFailure({ - matcher: this, - path: [], - message: `Expected type object but received ${getType(actual)}` - }); - } - const result = new MatchResult(actual); - if (!this.partial) { - for (const a of Object.keys(actual)) { - if (!(a in this.pattern)) { - result.recordFailure({ - matcher: this, - path: [`/${a}`], - message: "Unexpected key" - }); - } - } - } - for (const [patternKey, patternVal] of Object.entries(this.pattern)) { - if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { - result.recordFailure({ - matcher: this, - path: [`/${patternKey}`], - message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` - }); - continue; - } - const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); - const inner = matcher.test(actual[patternKey]); - result.compose(`/${patternKey}`, inner); - } - return result; - } -}; -var SerializedJson = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - if (getType(actual) !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected JSON as a string but found ${getType(actual)}` - }); - return result; - } - let parsed; - try { - parsed = JSON.parse(actual); - } catch (err) { - if (err instanceof SyntaxError) { - result.recordFailure({ - matcher: this, - path: [], - message: `Invalid JSON string: ${actual}` - }); - return result; - } else { - throw err; - } - } - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(parsed); - result.compose(`(${this.name})`, innerResult); - return result; - } -}; -var NotMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); - const innerResult = matcher.test(actual); - const result = new MatchResult(actual); - if (innerResult.failCount === 0) { - result.recordFailure({ - matcher: this, - path: [], - message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` - }); - } - return result; - } -}; -var AnyMatch = class extends Matcher { - constructor(name) { - super(); - this.name = name; - } - test(actual) { - const result = new MatchResult(actual); - if (actual == null) { - result.recordFailure({ - matcher: this, - path: [], - message: "Expected a value but found none" - }); - } - return result; - } -}; -var StringLikeRegexpMatch = class extends Matcher { - constructor(name, pattern) { - super(); - this.name = name; - this.pattern = pattern; - } - test(actual) { - const result = new MatchResult(actual); - const regex = new RegExp(this.pattern, "gm"); - if (typeof actual !== "string") { - result.recordFailure({ - matcher: this, - path: [], - message: `Expected a string, but got '${typeof actual}'` - }); - } - if (!regex.test(actual)) { - result.recordFailure({ - matcher: this, - path: [], - message: `String '${actual}' did not match pattern '${this.pattern}'` - }); - } - return result; - } -}; - -// lib/assertions/providers/lambda-handler/base.ts -var https = __toESM(require("https")); -var url = __toESM(require("url")); -var CustomResourceHandler = class { - constructor(event, context) { - this.event = event; - this.context = context; - this.timedOut = false; - this.timeout = setTimeout(async () => { - await this.respond({ - status: "FAILED", - reason: "Lambda Function Timeout", - data: this.context.logStreamName - }); - this.timedOut = true; - }, context.getRemainingTimeInMillis() - 1200); - this.event = event; - this.physicalResourceId = extractPhysicalResourceId(event); - } - async handle() { - try { - const response = await this.processEvent(this.event.ResourceProperties); - return response; - } catch (e) { - console.log(e); - throw e; - } finally { - clearTimeout(this.timeout); - } - } - respond(response) { - if (this.timedOut) { - return; - } - const cfResponse = { - Status: response.status, - Reason: response.reason, - PhysicalResourceId: this.physicalResourceId, - StackId: this.event.StackId, - RequestId: this.event.RequestId, - LogicalResourceId: this.event.LogicalResourceId, - NoEcho: false, - Data: response.data - }; - const responseBody = JSON.stringify(cfResponse); - console.log("Responding to CloudFormation", responseBody); - const parsedUrl = url.parse(this.event.ResponseURL); - const requestOptions = { - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: "PUT", - headers: { "content-type": "", "content-length": responseBody.length } - }; - return new Promise((resolve, reject) => { - try { - const request2 = https.request(requestOptions, resolve); - request2.on("error", reject); - request2.write(responseBody); - request2.end(); - } catch (e) { - reject(e); - } - }); - } -}; -function extractPhysicalResourceId(event) { - switch (event.RequestType) { - case "Create": - return event.LogicalResourceId; - case "Update": - case "Delete": - return event.PhysicalResourceId; - } -} - -// lib/assertions/providers/lambda-handler/assertion.ts -var AssertionHandler = class extends CustomResourceHandler { - async processEvent(request2) { - let actual = decodeCall(request2.actual); - const expected = decodeCall(request2.expected); - let result; - const matcher = new MatchCreator(expected).getMatcher(); - console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); - const matchResult = matcher.test(actual); - matchResult.finished(); - if (matchResult.hasFailed()) { - result = { - failed: true, - assertion: JSON.stringify({ - status: "fail", - message: [ - ...matchResult.toHumanStrings(), - JSON.stringify(matchResult.target, void 0, 2) - ].join("\n") - }) - }; - if (request2.failDeployment) { - throw new Error(result.assertion); - } - } else { - result = { - assertion: JSON.stringify({ - status: "success" - }) - }; - } - return result; - } -}; -var MatchCreator = class { - constructor(obj) { - this.parsedObj = { - matcher: obj - }; - } - getMatcher() { - try { - const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { - const nested = Object.keys(v)[0]; - switch (nested) { - case "$ArrayWith": - return Match.arrayWith(v[nested]); - case "$ObjectLike": - return Match.objectLike(v[nested]); - case "$StringLike": - return Match.stringLikeRegexp(v[nested]); - default: - return v; - } - }); - if (Matcher.isMatcher(final.matcher)) { - return final.matcher; - } - return Match.exact(final.matcher); - } catch { - return Match.exact(this.parsedObj.matcher); - } - } -}; -function decodeCall(call) { - if (!call) { - return void 0; - } - try { - const parsed = JSON.parse(call); - return parsed; - } catch (e) { - return call; - } -} - -// lib/assertions/providers/lambda-handler/utils.ts -function decode(object) { - return JSON.parse(JSON.stringify(object), (_k, v) => { - switch (v) { - case "TRUE:BOOLEAN": - return true; - case "FALSE:BOOLEAN": - return false; - default: - return v; - } - }); -} - -// lib/assertions/providers/lambda-handler/sdk.ts -function flatten(object) { - return Object.assign( - {}, - ...function _flatten(child, path = []) { - return [].concat(...Object.keys(child).map((key) => { - let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; - if (typeof childKey === "string") { - childKey = isJsonString(childKey); - } - return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; - })); - }(object) - ); -} -var AwsApiCallHandler = class extends CustomResourceHandler { - async processEvent(request2) { - const AWS = require("aws-sdk"); - console.log(`AWS SDK VERSION: ${AWS.VERSION}`); - if (!Object.prototype.hasOwnProperty.call(AWS, request2.service)) { - throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS.VERSION}.`); - } - const service = new AWS[request2.service](); - const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); - console.log(`SDK response received ${JSON.stringify(response)}`); - delete response.ResponseMetadata; - const respond = { - apiCallResponse: response - }; - const flatData = { - ...flatten(respond) - }; - const resp = request2.flattenResponse === "true" ? flatData : respond; - console.log(`Returning result ${JSON.stringify(resp)}`); - return resp; - } -}; -function isJsonString(value) { - try { - return JSON.parse(value); - } catch { - return value; - } -} - -// lib/assertions/providers/lambda-handler/types.ts -var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; -var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; - -// lib/assertions/providers/lambda-handler/index.ts -async function handler(event, context) { - console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); - const provider = createResourceHandler(event, context); - try { - if (event.RequestType === "Delete") { - await provider.respond({ - status: "SUCCESS", - reason: "OK" - }); - return; - } - const result = await provider.handle(); - const actualPath = event.ResourceProperties.actualPath; - const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; - if ("expected" in event.ResourceProperties) { - const assertion = new AssertionHandler({ - ...event, - ResourceProperties: { - ServiceToken: event.ServiceToken, - actual, - expected: event.ResourceProperties.expected - } - }, context); - try { - const assertionResult = await assertion.handle(); - await provider.respond({ - status: "SUCCESS", - reason: "OK", - data: { - ...assertionResult, - ...result - } - }); - return; - } catch (e) { - await provider.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - return; - } - } - await provider.respond({ - status: "SUCCESS", - reason: "OK", - data: result - }); - } catch (e) { - await provider.respond({ - status: "FAILED", - reason: e.message ?? "Internal Error" - }); - return; - } - return; -} -function createResourceHandler(event, context) { - if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { - return new AwsApiCallHandler(event, context); - } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { - return new AssertionHandler(event, context); - } else { - throw new Error(`Unsupported resource type "${event.ResourceType}`); - } -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - handler -}); diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/cdk.out b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/cdk.out index 8ecc185e9dbee..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.assets.json index c1f2d26c393c1..2f7c3109d01de 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.assets.json @@ -1,85 +1,150 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "08c3ae261768dd649ee56933737731af6e347329cb3e1faae2d767714e16c4ca": { + "4f1c60ea53236f3b51047f358750768c203c18bf8a96f637477e41205671054a": { "source": { - "path": "asset.08c3ae261768dd649ee56933737731af6e347329cb3e1faae2d767714e16c4ca", + "path": "asset.4f1c60ea53236f3b51047f358750768c203c18bf8a96f637477e41205671054a", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "08c3ae261768dd649ee56933737731af6e347329cb3e1faae2d767714e16c4ca.zip", + "objectKey": "4f1c60ea53236f3b51047f358750768c203c18bf8a96f637477e41205671054a.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "14d630e3e802caab7154afce187aade52a56a39aa16c7e510afbfdd6e1e7594e": { + "1676e8f6ce596977ce658377e74033e19d8bde0ab07624a629b7d06fe65247a7": { "source": { - "path": "asset.14d630e3e802caab7154afce187aade52a56a39aa16c7e510afbfdd6e1e7594e", + "path": "asset.1676e8f6ce596977ce658377e74033e19d8bde0ab07624a629b7d06fe65247a7", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "14d630e3e802caab7154afce187aade52a56a39aa16c7e510afbfdd6e1e7594e.zip", + "objectKey": "1676e8f6ce596977ce658377e74033e19d8bde0ab07624a629b7d06fe65247a7.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "1b8c70cb81031c22ef2063a87fcf090a5ce97ad10dcd400e98b01d902760ed35": { + "4888c4716b0076d774aee118a3d18e956968da2de4ccd0fbe8f8c32218e65873": { "source": { - "path": "asset.1b8c70cb81031c22ef2063a87fcf090a5ce97ad10dcd400e98b01d902760ed35", + "path": "asset.4888c4716b0076d774aee118a3d18e956968da2de4ccd0fbe8f8c32218e65873", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "1b8c70cb81031c22ef2063a87fcf090a5ce97ad10dcd400e98b01d902760ed35.zip", + "objectKey": "4888c4716b0076d774aee118a3d18e956968da2de4ccd0fbe8f8c32218e65873.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "b973a843566f0b8fcccb1188a899a6ee551a5a57d9460ee11c6270226fa2c745": { + "d5ea1207bacefbceffeec7ca81f7c3d4dfe29a6ddad941c128a8068f3dccff17": { "source": { - "path": "asset.b973a843566f0b8fcccb1188a899a6ee551a5a57d9460ee11c6270226fa2c745", + "path": "asset.d5ea1207bacefbceffeec7ca81f7c3d4dfe29a6ddad941c128a8068f3dccff17", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b973a843566f0b8fcccb1188a899a6ee551a5a57d9460ee11c6270226fa2c745.zip", + "objectKey": "d5ea1207bacefbceffeec7ca81f7c3d4dfe29a6ddad941c128a8068f3dccff17.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "65a6feb33ba221a1468300006b7fd9b123b8894e7eeb1be0e63ef23f6cf9b63e": { + "98dfac4193108bbc1a86f3e2579dd9537edd4896520ad70faefa913f156cceba": { "source": { - "path": "asset.65a6feb33ba221a1468300006b7fd9b123b8894e7eeb1be0e63ef23f6cf9b63e", + "path": "asset.98dfac4193108bbc1a86f3e2579dd9537edd4896520ad70faefa913f156cceba", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "65a6feb33ba221a1468300006b7fd9b123b8894e7eeb1be0e63ef23f6cf9b63e.zip", + "objectKey": "98dfac4193108bbc1a86f3e2579dd9537edd4896520ad70faefa913f156cceba.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "12b313bdc8543ea07689a76b42fb9faa74b6dfb6775de53df4e33d1041b8fe12": { + "93bc4017bed4959830121b1c93b7b9d4be293243966fac22561a1158b5760b17": { "source": { - "path": "asset.12b313bdc8543ea07689a76b42fb9faa74b6dfb6775de53df4e33d1041b8fe12", + "path": "asset.93bc4017bed4959830121b1c93b7b9d4be293243966fac22561a1158b5760b17", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "12b313bdc8543ea07689a76b42fb9faa74b6dfb6775de53df4e33d1041b8fe12.zip", + "objectKey": "93bc4017bed4959830121b1c93b7b9d4be293243966fac22561a1158b5760b17.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "531f02a0310a61f667b94d14b955adbdc98e5290659054cb1039dc4e3a147271": { + "6b80491454eeddb9d632f174e7ce9983ed75a439f5b29fec29558e2a4bfc5b4f": { + "source": { + "path": "asset.6b80491454eeddb9d632f174e7ce9983ed75a439f5b29fec29558e2a4bfc5b4f", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "6b80491454eeddb9d632f174e7ce9983ed75a439f5b29fec29558e2a4bfc5b4f.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "0f311a5a9cf1d4ff2e6ad5cc8e338faf33c4a7f2ee54e5976d23bd639a837684": { + "source": { + "path": "asset.0f311a5a9cf1d4ff2e6ad5cc8e338faf33c4a7f2ee54e5976d23bd639a837684", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "0f311a5a9cf1d4ff2e6ad5cc8e338faf33c4a7f2ee54e5976d23bd639a837684.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "27b2083b4131c590e0b4d22e3d3c89fcee23d169cb409d0a57cd07c45ece2710": { + "source": { + "path": "asset.27b2083b4131c590e0b4d22e3d3c89fcee23d169cb409d0a57cd07c45ece2710", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "27b2083b4131c590e0b4d22e3d3c89fcee23d169cb409d0a57cd07c45ece2710.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "dd7440548d85039b21ad5395bdfc6b62d17762b3a46b4db664a7051f011014c9": { + "source": { + "path": "asset.dd7440548d85039b21ad5395bdfc6b62d17762b3a46b4db664a7051f011014c9", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "dd7440548d85039b21ad5395bdfc6b62d17762b3a46b4db664a7051f011014c9.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "b9674d8cf39b951341a2d609a07272d0673d3fa9eec90ca4d1a8e46c41918416": { + "source": { + "path": "asset.b9674d8cf39b951341a2d609a07272d0673d3fa9eec90ca4d1a8e46c41918416", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b9674d8cf39b951341a2d609a07272d0673d3fa9eec90ca4d1a8e46c41918416.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5229b23937027d2d04e79cc15b60f173089f8b3cd504ce2d6de98d0549179da9": { "source": { "path": "integ-lambda-python-poetry.template.json", "packaging": "file" @@ -87,7 +152,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "531f02a0310a61f667b94d14b955adbdc98e5290659054cb1039dc4e3a147271.json", + "objectKey": "5229b23937027d2d04e79cc15b60f173089f8b3cd504ce2d6de98d0549179da9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.template.json index 572bc92550af7..ed5854db3bf83 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ-lambda-python-poetry.template.json @@ -38,7 +38,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "08c3ae261768dd649ee56933737731af6e347329cb3e1faae2d767714e16c4ca.zip" + "S3Key": "4f1c60ea53236f3b51047f358750768c203c18bf8a96f637477e41205671054a.zip" }, "Role": { "Fn::GetAtt": [ @@ -91,7 +91,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "14d630e3e802caab7154afce187aade52a56a39aa16c7e510afbfdd6e1e7594e.zip" + "S3Key": "1676e8f6ce596977ce658377e74033e19d8bde0ab07624a629b7d06fe65247a7.zip" }, "Role": { "Fn::GetAtt": [ @@ -144,7 +144,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "1b8c70cb81031c22ef2063a87fcf090a5ce97ad10dcd400e98b01d902760ed35.zip" + "S3Key": "4888c4716b0076d774aee118a3d18e956968da2de4ccd0fbe8f8c32218e65873.zip" }, "Role": { "Fn::GetAtt": [ @@ -197,7 +197,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "b973a843566f0b8fcccb1188a899a6ee551a5a57d9460ee11c6270226fa2c745.zip" + "S3Key": "d5ea1207bacefbceffeec7ca81f7c3d4dfe29a6ddad941c128a8068f3dccff17.zip" }, "Role": { "Fn::GetAtt": [ @@ -250,7 +250,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "65a6feb33ba221a1468300006b7fd9b123b8894e7eeb1be0e63ef23f6cf9b63e.zip" + "S3Key": "98dfac4193108bbc1a86f3e2579dd9537edd4896520ad70faefa913f156cceba.zip" }, "Role": { "Fn::GetAtt": [ @@ -303,7 +303,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "12b313bdc8543ea07689a76b42fb9faa74b6dfb6775de53df4e33d1041b8fe12.zip" + "S3Key": "93bc4017bed4959830121b1c93b7b9d4be293243966fac22561a1158b5760b17.zip" }, "Role": { "Fn::GetAtt": [ @@ -317,6 +317,271 @@ "DependsOn": [ "myhandlerpython37withhashesServiceRoleD9828997" ] + }, + "myhandlerinlineexcludesServiceRoleFF9028A3": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerinlineexcludes9ACF1422": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "6b80491454eeddb9d632f174e7ce9983ed75a439f5b29fec29558e2a4bfc5b4f.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerinlineexcludesServiceRoleFF9028A3", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.9" + }, + "DependsOn": [ + "myhandlerinlineexcludesServiceRoleFF9028A3" + ] + }, + "myhandlerpython38excludesServiceRole05CD433C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython38excludes1CEDD615": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "0f311a5a9cf1d4ff2e6ad5cc8e338faf33c4a7f2ee54e5976d23bd639a837684.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython38excludesServiceRole05CD433C", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.8" + }, + "DependsOn": [ + "myhandlerpython38excludesServiceRole05CD433C" + ] + }, + "myhandlerpython38withhashesexcludesServiceRole8D904BB8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython38withhashesexcludes46724D0B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "27b2083b4131c590e0b4d22e3d3c89fcee23d169cb409d0a57cd07c45ece2710.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython38withhashesexcludesServiceRole8D904BB8", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.8" + }, + "DependsOn": [ + "myhandlerpython38withhashesexcludesServiceRole8D904BB8" + ] + }, + "myhandlerpython37excludesServiceRole083BD595": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37excludes977F9CDF": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "dd7440548d85039b21ad5395bdfc6b62d17762b3a46b4db664a7051f011014c9.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37excludesServiceRole083BD595", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37excludesServiceRole083BD595" + ] + }, + "myhandlerpython37withhashesexcludesServiceRole3D0EC328": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "myhandlerpython37withhashesexcludes1C88AD13": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b9674d8cf39b951341a2d609a07272d0673d3fa9eec90ca4d1a8e46c41918416.zip" + }, + "Role": { + "Fn::GetAtt": [ + "myhandlerpython37withhashesexcludesServiceRole3D0EC328", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "python3.7" + }, + "DependsOn": [ + "myhandlerpython37withhashesexcludesServiceRole3D0EC328" + ] } }, "Outputs": { @@ -367,6 +632,46 @@ "Export": { "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" } + }, + "ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9": { + "Value": { + "Ref": "myhandlerinlineexcludes9ACF1422" + }, + "Export": { + "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + }, + "ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35": { + "Value": { + "Ref": "myhandlerpython38excludes1CEDD615" + }, + "Export": { + "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + }, + "ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D": { + "Value": { + "Ref": "myhandlerpython38withhashesexcludes46724D0B" + }, + "Export": { + "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D" + } + }, + "ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3": { + "Value": { + "Ref": "myhandlerpython37excludes977F9CDF" + }, + "Export": { + "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + }, + "ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09": { + "Value": { + "Ref": "myhandlerpython37withhashesexcludes1C88AD13" + }, + "Export": { + "Name": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09" + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ.json index 373db0c4530d7..23880dcaba239 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "testCases": { "poetry/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/manifest.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/manifest.json index 3ed278b19b21d..9854bb499a325 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "integ-lambda-python-poetry.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "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}/531f02a0310a61f667b94d14b955adbdc98e5290659054cb1039dc4e3a147271.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5229b23937027d2d04e79cc15b60f173089f8b3cd504ce2d6de98d0549179da9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -111,6 +105,66 @@ "data": "myhandlerpython37withhashesE95C48AC" } ], + "/integ-lambda-python-poetry/my_handler_inline_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlineexcludesServiceRoleFF9028A3" + } + ], + "/integ-lambda-python-poetry/my_handler_inline_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerinlineexcludes9ACF1422" + } + ], + "/integ-lambda-python-poetry/my_handler_python_38_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38excludesServiceRole05CD433C" + } + ], + "/integ-lambda-python-poetry/my_handler_python_38_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38excludes1CEDD615" + } + ], + "/integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38withhashesexcludesServiceRole8D904BB8" + } + ], + "/integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython38withhashesexcludes46724D0B" + } + ], + "/integ-lambda-python-poetry/my_handler_python_37_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37excludesServiceRole083BD595" + } + ], + "/integ-lambda-python-poetry/my_handler_python_37_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37excludes977F9CDF" + } + ], + "/integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37withhashesexcludesServiceRole3D0EC328" + } + ], + "/integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myhandlerpython37withhashesexcludes1C88AD13" + } + ], "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}": [ { "type": "aws:cdk:logicalId", @@ -147,70 +201,46 @@ "data": "ExportsOutputRefmyhandlerpython37withhashesE95C48AC15D1F7B4" } ], - "/integ-lambda-python-poetry/BootstrapVersion": [ + "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}": [ { "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/integ-lambda-python-poetry/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" + "data": "ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" } ], - "myhandlerinlinenohashesServiceRole792CBFEE": [ + "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerinlinenohashesServiceRole792CBFEE", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" } ], - "myhandlerinlinenohashes9F4AC298": [ + "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38withhashesexcludes46724D0B\"}": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerinlinenohashes9F4AC298", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D" } ], - "myhandlerpython38nohashesServiceRole95183D41": [ + "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerpython38nohashesServiceRole95183D41", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" } ], - "myhandlerpython38nohashesAC448740": [ + "/integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37withhashesexcludes1C88AD13\"}": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerpython38nohashesAC448740", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09" } ], - "myhandlerpython37nohashesServiceRoleCB0A268B": [ + "/integ-lambda-python-poetry/BootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerpython37nohashesServiceRoleCB0A268B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "BootstrapVersion" } ], - "myhandlerpython37nohashes751F0455": [ + "/integ-lambda-python-poetry/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "myhandlerpython37nohashes751F0455", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, @@ -232,7 +262,7 @@ "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}/01462ebb52e8f49b3e2b2706bba447690a46e44b6f000448dac39836d7ccdd8f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/058c58fd505683a76c8707c01d8058cc9c7b13a980cffbbe91b038e2383165a4.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -369,6 +399,96 @@ "data": "AssertionResultsLambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89" } ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36cInvoke7568F400" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7Invoke1AF08F67" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvokefbdb1fc975f2f372fd64335aa07b46b7" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4Invoke7F9FE784" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172Invoke5D442C14" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke26ce5a20d1ffee210d056cd2aa005172" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512Invoke20E8DC10" + } + ], + "/poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsLambdaInvoke6fd2d93b0d07a2b4220fae7c91786512" + } + ], "/poetry/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -383,6 +503,12 @@ ] }, "displayName": "poetry/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json index c1f5ffea39539..eee0404959223 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.assets.json @@ -1,20 +1,20 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { - "d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb": { + "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4": { "source": { - "path": "asset.d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.bundle", + "path": "asset.73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.zip", + "objectKey": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "01462ebb52e8f49b3e2b2706bba447690a46e44b6f000448dac39836d7ccdd8f": { + "058c58fd505683a76c8707c01d8058cc9c7b13a980cffbbe91b038e2383165a4": { "source": { "path": "poetryDefaultTestDeployAssertE9C9CB8F.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "01462ebb52e8f49b3e2b2706bba447690a46e44b6f000448dac39836d7ccdd8f.json", + "objectKey": "058c58fd505683a76c8707c01d8058cc9c7b13a980cffbbe91b038e2383165a4.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json index 14f2e1c399cea..3c7eceab71ef7 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/poetryDefaultTestDeployAssertE9C9CB8F.template.json @@ -18,7 +18,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703471" + "salt": "1676321196191" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -303,6 +303,206 @@ ] } ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + ] + ] + } + ] + }, + { + "Action": [ + "lambda:Invoke" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "lambda:InvokeFunction" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":lambda:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":function:", + { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09" + } + ] + ] + } + ] } ] } @@ -318,7 +518,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "d47f7e6772bfdf47ecbc070ffe204baf53bacbfbf7814eb407bd8ea108c1c1bb.zip" + "S3Key": "73c20a669c041469f7fc3fc03d574b093b5b97e7c716f76c1e8117e6163e4dc4.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -348,7 +548,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703472" + "salt": "1676321196192" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -386,7 +586,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703472" + "salt": "1676321196192" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -424,7 +624,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703472" + "salt": "1676321196192" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -462,7 +662,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703472" + "salt": "1676321196192" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -500,7 +700,7 @@ } }, "flattenResponse": "false", - "salt": "1665153703472" + "salt": "1676321196192" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -519,6 +719,196 @@ ] } } + }, + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + } + }, + "flattenResponse": "false", + "salt": "1676321196193" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36cInvoke7568F400": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerinlineexcludes9ACF1422FA94AAF9" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + } + }, + "flattenResponse": "false", + "salt": "1676321196193" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7Invoke1AF08F67": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38excludes1CEDD61508A85D35" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D" + } + }, + "flattenResponse": "false", + "salt": "1676321196193" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4Invoke7F9FE784": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython38withhashesexcludes46724D0BA6D5A35D" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + } + }, + "flattenResponse": "false", + "salt": "1676321196193" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172Invoke5D442C14": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37excludes977F9CDF40301DA3" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512": { + "Type": "Custom::DeployAssert@SdkCallLambdainvoke", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Lambda", + "api": "invoke", + "expected": "{\"$ObjectLike\":{\"Payload\":\"200\"}}", + "parameters": { + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09" + } + }, + "flattenResponse": "false", + "salt": "1676321196193" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512Invoke20E8DC10": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::ImportValue": "integ-lambda-python-poetry:ExportsOutputRefmyhandlerpython37withhashesexcludes1C88AD136E888C09" + }, + "Principal": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } } }, "Outputs": { @@ -569,6 +959,46 @@ "assertion" ] } + }, + "AssertionResultsLambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", + "assertion" + ] + } + }, + "AssertionResultsLambdaInvoke6fd2d93b0d07a2b4220fae7c91786512": { + "Value": { + "Fn::GetAtt": [ + "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512", + "assertion" + ] + } } }, "Parameters": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/tree.json b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/tree.json index 3d1428fb4d593..e9258dfb67908 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.123" - } - }, "integ-lambda-python-poetry": { "id": "integ-lambda-python-poetry", "path": "integ-lambda-python-poetry", @@ -24,6 +16,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_inline/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_inline/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_inline/ServiceRole/Resource", @@ -105,7 +105,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "08c3ae261768dd649ee56933737731af6e347329cb3e1faae2d767714e16c4ca.zip" + "s3Key": "4f1c60ea53236f3b51047f358750768c203c18bf8a96f637477e41205671054a.zip" }, "role": { "Fn::GetAtt": [ @@ -136,6 +136,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_inline_with_hashes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_inline_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_inline_with_hashes/ServiceRole/Resource", @@ -217,7 +225,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "14d630e3e802caab7154afce187aade52a56a39aa16c7e510afbfdd6e1e7594e.zip" + "s3Key": "1676e8f6ce596977ce658377e74033e19d8bde0ab07624a629b7d06fe65247a7.zip" }, "role": { "Fn::GetAtt": [ @@ -248,6 +256,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_python_38/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_python_38/ServiceRole/Resource", @@ -329,7 +345,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "1b8c70cb81031c22ef2063a87fcf090a5ce97ad10dcd400e98b01d902760ed35.zip" + "s3Key": "4888c4716b0076d774aee118a3d18e956968da2de4ccd0fbe8f8c32218e65873.zip" }, "role": { "Fn::GetAtt": [ @@ -360,6 +376,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes/ServiceRole/Resource", @@ -441,7 +465,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "b973a843566f0b8fcccb1188a899a6ee551a5a57d9460ee11c6270226fa2c745.zip" + "s3Key": "d5ea1207bacefbceffeec7ca81f7c3d4dfe29a6ddad941c128a8068f3dccff17.zip" }, "role": { "Fn::GetAtt": [ @@ -472,6 +496,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_python_37/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_python_37/ServiceRole/Resource", @@ -553,7 +585,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "65a6feb33ba221a1468300006b7fd9b123b8894e7eeb1be0e63ef23f6cf9b63e.zip" + "s3Key": "98dfac4193108bbc1a86f3e2579dd9537edd4896520ad70faefa913f156cceba.zip" }, "role": { "Fn::GetAtt": [ @@ -584,6 +616,14 @@ "id": "ServiceRole", "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes/ServiceRole", "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes/ServiceRole/Resource", @@ -665,7 +705,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "12b313bdc8543ea07689a76b42fb9faa74b6dfb6775de53df4e33d1041b8fe12.zip" + "s3Key": "93bc4017bed4959830121b1c93b7b9d4be293243966fac22561a1158b5760b17.zip" }, "role": { "Fn::GetAtt": [ @@ -688,84 +728,740 @@ "version": "0.0.0" } }, - "Exports": { - "id": "Exports", - "path": "integ-lambda-python-poetry/Exports", + "my_handler_inline_excludes": { + "id": "my_handler_inline_excludes", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes", "children": { - "Output{\"Ref\":\"myhandlerinline53D120C7\"}": { - "id": "Output{\"Ref\":\"myhandlerinline53D120C7\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}", + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-iam.Role", "version": "0.0.0" } }, - "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": { - "id": "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-s3-assets.Asset", "version": "0.0.0" } }, - "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": { - "id": "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_inline_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "6b80491454eeddb9d632f174e7ce9983ed75a439f5b29fec29558e2a4bfc5b4f.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerinlineexcludesServiceRoleFF9028A3", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.9" + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-lambda.CfnFunction", "version": "0.0.0" } - }, - "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": { - "id": "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_38_excludes": { + "id": "my_handler_python_38_excludes", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-iam.Role", "version": "0.0.0" } }, - "Output{\"Ref\":\"myhandlerpython37C34039A7\"}": { - "id": "Output{\"Ref\":\"myhandlerpython37C34039A7\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}", + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-s3-assets.Asset", "version": "0.0.0" } }, - "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": { - "id": "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", - "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_38_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "0f311a5a9cf1d4ff2e6ad5cc8e338faf33c4a7f2ee54e5976d23bd639a837684.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython38excludesServiceRole05CD433C", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.8" + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "@aws-cdk/aws-lambda.CfnFunction", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.123" + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "poetry": { - "id": "poetry", - "path": "poetry", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "poetry/DefaultTest", + }, + "my_handler_python_38_with_hashes_excludes": { + "id": "my_handler_python_38_with_hashes_excludes", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_38_with_hashes_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "27b2083b4131c590e0b4d22e3d3c89fcee23d169cb409d0a57cd07c45ece2710.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython38withhashesexcludesServiceRole8D904BB8", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.8" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_37_excludes": { + "id": "my_handler_python_37_excludes", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_37_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "dd7440548d85039b21ad5395bdfc6b62d17762b3a46b4db664a7051f011014c9.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37excludesServiceRole083BD595", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "my_handler_python_37_with_hashes_excludes": { + "id": "my_handler_python_37_with_hashes_excludes", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-lambda-python-poetry/my_handler_python_37_with_hashes_excludes/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "b9674d8cf39b951341a2d609a07272d0673d3fa9eec90ca4d1a8e46c41918416.zip" + }, + "role": { + "Fn::GetAtt": [ + "myhandlerpython37withhashesexcludesServiceRole3D0EC328", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "python3.7" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda-python.PythonFunction", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "integ-lambda-python-poetry/Exports", + "children": { + "Output{\"Ref\":\"myhandlerinline53D120C7\"}": { + "id": "Output{\"Ref\":\"myhandlerinline53D120C7\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinline53D120C7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}": { + "id": "Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinlinewithhashes352ED54D\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}": { + "id": "Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython384D62BBB5\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}": { + "id": "Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38withhashesF2275091\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37C34039A7\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37C34039A7\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37C34039A7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37withhashesE95C48AC\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}": { + "id": "Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerinlineexcludes9ACF1422\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}": { + "id": "Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38excludes1CEDD615\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython38withhashesexcludes46724D0B\"}": { + "id": "Output{\"Ref\":\"myhandlerpython38withhashesexcludes46724D0B\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython38withhashesexcludes46724D0B\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37excludes977F9CDF\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"myhandlerpython37withhashesexcludes1C88AD13\"}": { + "id": "Output{\"Ref\":\"myhandlerpython37withhashesexcludes1C88AD13\"}", + "path": "integ-lambda-python-poetry/Exports/Output{\"Ref\":\"myhandlerpython37withhashesexcludes1C88AD13\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-lambda-python-poetry/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-lambda-python-poetry/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "poetry": { + "id": "poetry", + "path": "poetry", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "poetry/DefaultTest", "children": { "Default": { "id": "Default", "path": "poetry/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } }, "DeployAssert": { @@ -778,14 +1474,172 @@ "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81": { + "id": "SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "children": { + "Staging": { + "id": "Staging", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + }, + "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { + "id": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { + "id": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -796,11 +1650,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -814,7 +1668,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -822,7 +1676,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke81c9998b1b428b309c8501e21b919d3d/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -834,54 +1688,206 @@ "version": "0.0.0" } }, - "SingletonFunction1488541a7b23466481b69b4408076b81": { - "id": "SingletonFunction1488541a7b23466481b69b4408076b81", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { + "id": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", "children": { - "Staging": { - "id": "Staging", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", "version": "0.0.0" } }, - "Role": { - "id": "Role", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } }, - "Handler": { - "id": "Handler", - "path": "poetry/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { + "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" + } + }, + "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { + "id": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default", + "children": { + "Default": { + "id": "Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.123" + "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", + "version": "0.0.0" } }, - "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8": { - "id": "LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8", + "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c": { + "id": "LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -892,11 +1898,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -910,7 +1916,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -918,7 +1924,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke82a73e0d5d0fdcb04565e4d81ef342b8/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fb5582f0ea96db4d3c0326fb42fe36c/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -930,20 +1936,20 @@ "version": "0.0.0" } }, - "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292": { - "id": "LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292", + "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7": { + "id": "LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -954,11 +1960,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -972,7 +1978,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -980,7 +1986,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke9a0beb4ea6cc38db92e9ff664c085292/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokefbdb1fc975f2f372fd64335aa07b46b7/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -992,20 +1998,20 @@ "version": "0.0.0" } }, - "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e": { - "id": "LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e", + "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4": { + "id": "LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -1016,11 +2022,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1034,7 +2040,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1042,7 +2048,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26497bb1c12c14ed3deada8d7d76b39e/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvokeead1d1e2cc2d2a843a514ffdc015b2c4/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -1054,20 +2060,20 @@ "version": "0.0.0" } }, - "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75": { - "id": "LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75", + "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172": { + "id": "LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -1078,11 +2084,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1096,7 +2102,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1104,7 +2110,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke631dde0680edf7d2f0eea8d9b9c06c75/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke26ce5a20d1ffee210d056cd2aa005172/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -1116,20 +2122,20 @@ "version": "0.0.0" } }, - "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89": { - "id": "LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89", + "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512": { + "id": "LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512", "children": { "SdkProvider": { "id": "SdkProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/SdkProvider", "children": { "AssertionsProvider": { "id": "AssertionsProvider", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/SdkProvider/AssertionsProvider", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/SdkProvider/AssertionsProvider", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.237" } } }, @@ -1140,11 +2146,11 @@ }, "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/Default", "children": { "Default": { "id": "Default", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Default/Default", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/Default/Default", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1158,7 +2164,7 @@ }, "Invoke": { "id": "Invoke", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/Invoke", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/Invoke", "constructInfo": { "fqn": "@aws-cdk/core.CfnResource", "version": "0.0.0" @@ -1166,7 +2172,7 @@ }, "AssertionResults": { "id": "AssertionResults", - "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke8cbaf98b5be6e4f6f81f5f10b5b8dc89/AssertionResults", + "path": "poetry/DefaultTest/DeployAssert/LambdaInvoke6fd2d93b0d07a2b4220fae7c91786512/AssertionResults", "constructInfo": { "fqn": "@aws-cdk/core.CfnOutput", "version": "0.0.0" @@ -1177,6 +2183,22 @@ "fqn": "@aws-cdk/integ-tests.LambdaInvokeFunction", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "poetry/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "poetry/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { @@ -1195,6 +2217,14 @@ "fqn": "@aws-cdk/integ-tests.IntegTest", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts index 64ef3a8da3a70..3f791886e8d7d 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.poetry.ts @@ -60,6 +60,53 @@ class TestStack extends Stack { }); this.functionNames.push(pythonFunction37WithHashes.functionName); + const pythonFunction39Excludes = new lambda.PythonFunction(this, 'my_handler_inline_excludes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_9, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction39Excludes.functionName); + + const pythonFunction38Excludes = new lambda.PythonFunction(this, 'my_handler_python_38_excludes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_8, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction38Excludes.functionName); + + const pythonFunction38WithHashesExcludes = new lambda.PythonFunction(this, 'my_handler_python_38_with_hashes_excludes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_8, + bundling: { + poetryIncludeHashes: true, + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction38WithHashesExcludes.functionName); + + const pythonFunction37Excludes = new lambda.PythonFunction(this, 'my_handler_python_37_excludes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_7, + bundling: { + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction37Excludes.functionName); + + const pythonFunction37WithHashesExcludes = new lambda.PythonFunction(this, 'my_handler_python_37_with_hashes_excludes', { + entry: path.join(__dirname, 'lambda-handler-poetry'), + runtime: Runtime.PYTHON_3_7, + bundling: { + poetryIncludeHashes: true, + assetExcludes: ['.ignorefile'], + }, + }); + this.functionNames.push(pythonFunction37WithHashesExcludes.functionName); + } } diff --git a/packages/@aws-cdk/aws-lambda-python/test/integ.function.ts b/packages/@aws-cdk/aws-lambda-python/test/integ.function.ts index e794c7afbb7a8..93e5b0d403b23 100644 --- a/packages/@aws-cdk/aws-lambda-python/test/integ.function.ts +++ b/packages/@aws-cdk/aws-lambda-python/test/integ.function.ts @@ -14,19 +14,33 @@ import * as lambda from '../lib'; */ class TestStack extends Stack { - public readonly functionName: string; + public readonly functionNames: string[] = []; constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); - const fn = new lambda.PythonFunction(this, 'my_handler', { + const defaultFunction = new lambda.PythonFunction(this, 'my_handler', { entry: path.join(__dirname, 'lambda-handler'), runtime: Runtime.PYTHON_3_9, }); - this.functionName = fn.functionName; + this.functionNames.push(defaultFunction.functionName); - new CfnOutput(this, 'FunctionArn', { - value: fn.functionArn, + new CfnOutput(this, 'DefaultFunctionArn', { + value: defaultFunction.functionArn, }); + + const functionWithExcludes = new lambda.PythonFunction(this, 'my_handler_excludes', { + entry: path.join(__dirname, 'lambda-handler'), + runtime: Runtime.PYTHON_3_9, + bundling: { + assetExcludes: ['.ignorefiles'], + }, + }); + this.functionNames.push(functionWithExcludes.functionName); + + new CfnOutput(this, 'FunctionArnWithExcludes', { + value: functionWithExcludes.functionArn, + }); + } } @@ -37,12 +51,14 @@ const integ = new IntegTest(app, 'lambda-python-function', { stackUpdateWorkflow: false, }); -const invoke = integ.assertions.invokeFunction({ - functionName: testCase.functionName, -}); +testCase.functionNames.forEach(functionName => { + const invoke = integ.assertions.invokeFunction({ + functionName: functionName, + }); -invoke.expect(ExpectedResult.objectLike({ - Payload: '200', -})); + invoke.expect(ExpectedResult.objectLike({ + Payload: '200', + })); +}); app.synth(); diff --git a/packages/@aws-cdk/aws-lambda-python/test/lambda-handler/.ignorelist b/packages/@aws-cdk/aws-lambda-python/test/lambda-handler/.ignorelist new file mode 100644 index 0000000000000..e69de29bb2d1d