diff --git a/libs/wingsdk/src/cloud/function.ts b/libs/wingsdk/src/cloud/function.ts index 084e715c7a3..1ab7495b7b8 100644 --- a/libs/wingsdk/src/cloud/function.ts +++ b/libs/wingsdk/src/cloud/function.ts @@ -2,7 +2,6 @@ import { mkdirSync, writeFileSync } from "fs"; import { join } from "path"; import { Construct } from "constructs"; import { fqnForType } from "../constants"; -import { Code } from "../core"; import { App } from "../core/app"; import { CaseConventions, ResourceNames } from "../shared/resource-names"; import { Duration } from "../std/duration"; @@ -84,7 +83,11 @@ export abstract class Function extends Resource implements IInflightHost { handler._registerBind(this, ["handle", "$inflight_init"]); const inflightClient = handler._toInflight(); - const lines = this._generateLines(inflightClient); + const lines = new Array(); + + lines.push("exports.handler = async function(event) {"); + lines.push(` return await (${inflightClient.text}).handle(event);`); + lines.push("};"); const assetName = ResourceNames.generateName(this, { // Avoid characters that may cause path issues @@ -107,22 +110,6 @@ export abstract class Function extends Resource implements IInflightHost { } } - /** - * Generates the code lines for the cloud function, can be overridden by the targets - * @param inflightClient inflight client code - * @returns cloud function code string - * @internal - */ - protected _generateLines(inflightClient: Code): string[] { - const lines = new Array(); - - lines.push("exports.handler = async function(event) {"); - lines.push(` return await (${inflightClient.text}).handle(event);`); - lines.push("};"); - - return lines; - } - /** * Add an environment variable to the function. */ diff --git a/libs/wingsdk/src/shared-aws/function.inflight.ts b/libs/wingsdk/src/shared-aws/function.inflight.ts index 223aa189e66..48cd17bddd4 100644 --- a/libs/wingsdk/src/shared-aws/function.inflight.ts +++ b/libs/wingsdk/src/shared-aws/function.inflight.ts @@ -1,8 +1,7 @@ -import { InvokeCommand, LambdaClient } from "@aws-sdk/client-lambda"; +import { InvokeCommand, LambdaClient, LogType } from "@aws-sdk/client-lambda"; import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Context } from "aws-lambda"; import { IFunctionClient } from "../cloud"; -import { Trace } from "../std"; +import { Trace, TraceType } from "../std"; export class FunctionClient implements IFunctionClient { constructor( @@ -12,69 +11,13 @@ export class FunctionClient implements IFunctionClient { ) {} /** - * Reading the function's logs, - * along with any logs of a function that was called by the parent function - * - * @param logGroupName function's context logGroupName - * @param logStreamName function's context logGroupName - * @param constructPath cdk's path to construct - * @returns a list of Traces - */ - - private readLogs(logs: Trace[]): Trace[] { - const logsCollector: Trace[] = []; - - for (const log of logs) { - const invocationLog = log.data.message?.match(/Invoking .*:/gm); - - if (invocationLog) { - const logData = log.data.message.split("\t") ?? []; - const parsedLogs: Trace[] = - JSON.parse( - Buffer.from(logData[logData.length - 1], "base64").toString( - "binary" - ) - )?.logs ?? []; - - logsCollector.push(...this.readLogs(parsedLogs)); - } else { - logsCollector.push(log); - } - } - - return logsCollector; - } - - /** - * Verify the function's return payload - * - * @returns the function's return payload, if verified - */ - private verify(value: { context?: Context; payload: string }): string { - if (typeof value.payload !== "string") { - throw new Error( - `function returned value of type ${typeof value.payload}, not string` - ); - } - return value.payload; - } - - /** - * Invoke the function + * Invoke the function, passing the given payload as an argument. + * @returns the function returned payload only */ - private async executeFunction(payload: string): Promise<{ - context?: Context & { - logs: Trace[]; - }; - payload: string; - }> { + public async invoke(payload: string): Promise { const command = new InvokeCommand({ FunctionName: this.functionArn, Payload: fromUtf8(JSON.stringify(payload)), - ClientContext: Buffer.from( - JSON.stringify({ constructPath: this.constructPath }), - "binary" - ).toString("base64"), }); const response = await this.lambdaClient.send(command); @@ -86,47 +29,80 @@ export class FunctionClient implements IFunctionClient { ); } if (!response.Payload) { - return { payload: "" }; + return ""; } const value = JSON.parse(toUtf8(response.Payload)) ?? ""; + if (typeof value !== "string") { + throw new Error( + `function returned value of type ${typeof value}, not string` + ); + } return value; } - /** - * Invoke the function, passing the given payload as an argument. - * @returns the function returned payload only - */ - public async invoke(payload: string): Promise { - const value = await this.executeFunction(payload); - const functionName = value?.context?.functionName; - - // kind of hacky, but this is the most convenient way to pass those arguments to the calling function - console.log( - `Invoking ${functionName}:\t${Buffer.from( - JSON.stringify({ - logs: value?.context?.logs, - }), - "binary" - ).toString("base64")}` - ); - - return this.verify(value); - } - /** * Invoke the function, passing the given payload as an argument. * * @returns the function returned payload and logs */ public async invokeWithLogs(payload: string): Promise<[string, Trace[]]> { - const traces: Trace[] = []; + const command = new InvokeCommand({ + FunctionName: this.functionArn, + Payload: fromUtf8(JSON.stringify(payload)), + LogType: LogType.Tail, + }); + const response = await this.lambdaClient.send(command); - const value = await this.executeFunction(payload); + const logs = Buffer.from(response.LogResult ?? "", "base64").toString(); + const traces = parseLogs(logs, this.constructPath); - if (value.context?.logs) { - traces.push(...this.readLogs(value.context.logs)); + if (response.FunctionError) { + throw new Error( + `Invoke failed with message: "${ + response.FunctionError + }". Full error: "${toUtf8(response.Payload!)}"` + ); + } + if (!response.Payload) { + return ["", traces]; + } + const value = JSON.parse(toUtf8(response.Payload)) ?? ""; + if (typeof value !== "string") { + throw new Error( + `function returned value of type ${typeof value}, not string` + ); } + return ["", traces]; + } +} - return [this.verify(value), traces]; +export function parseLogs(logs: string, sourcePath: string) { + const lines = logs.split("\n"); + const traces: Trace[] = []; + for (const line of lines) { + const parts = line.split("\t"); + // 2023-08-04T16:40:47.309Z 6beb7628-d0c3-4fe9-bf5a-d64c559aa25f INFO hello + // 2023-08-04T16:40:47.309Z 6beb7628-d0c3-4fe9-bf5a-d64c559aa25f Task timed out after 3.0 seconds + if ( + parts.length >= 3 && + parts[0].match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/) !== + null && + parts[1].match(/^[0-9a-fA-F-]{36}$/) !== null + ) { + const timestamp = parts[0]; + if (parts.slice(2).join(" ").startsWith("Task timed out after")) { + continue; + } + const message = parts.slice(3).join(" "); + const trace: Trace = { + data: { message }, + timestamp, + sourceType: "wingsdk.cloud.Function", + sourcePath, + type: TraceType.LOG, + }; + traces.push(trace); + } } + return traces; } diff --git a/libs/wingsdk/src/shared-aws/function.ts b/libs/wingsdk/src/shared-aws/function.ts index 71a77f4538b..d5466056690 100644 --- a/libs/wingsdk/src/shared-aws/function.ts +++ b/libs/wingsdk/src/shared-aws/function.ts @@ -1,7 +1,5 @@ import { PolicyStatement } from "./types"; -import { Code } from "../core"; -import { IInflightHost, TraceType } from "../std"; -import { FUNCTION_TYPE } from "../target-sim/schema-resources"; +import { IInflightHost } from "../std"; import { Function as TfAwsFunction } from "../target-tf-aws"; /** @@ -39,41 +37,3 @@ export class Function { return undefined; } } - -/** - * Generates the code lines for the cloud function, - * overridden by the aws targets to have the function context too, - * as well as collecting the logs as Traces and keeping them in context.logs for later use. - * Eventually, this enables us displaying user defined logs, called in aws lambdas, - * in the user's terminal while testing. - * @param inflightClient inflight client code - * @returns cloud function code string - * @internal - */ -export function _generateAwsFunctionLines(inflightClient: Code): string[] { - const lines = new Array(); - - lines.push("exports.handler = async function(event, context) {"); - lines.push(` -const $originalLog = console.log.bind({}); - -console.log = (...args) => { -const logs = args.map(item => ({ - data: { message: item }, - sourceType: "${FUNCTION_TYPE}", - sourcePath: context?.clientContext?.constructPath, - type: "${TraceType.LOG}", - timestamp: new Date().toISOString() -})); -!context.logs ? context.logs = [...logs] : context.logs.push(...logs); - -$originalLog(args); -};`); - - lines.push( - ` return { payload: (await (${inflightClient.text}).handle(event)) ?? "", context };` - ); - lines.push("};"); - - return lines; -} diff --git a/libs/wingsdk/src/target-awscdk/function.ts b/libs/wingsdk/src/target-awscdk/function.ts index 1362e6fc163..67ff0cc2e45 100644 --- a/libs/wingsdk/src/target-awscdk/function.ts +++ b/libs/wingsdk/src/target-awscdk/function.ts @@ -11,7 +11,7 @@ import { Construct } from "constructs"; import * as cloud from "../cloud"; import * as core from "../core"; import { createBundle } from "../shared/bundling"; -import { PolicyStatement, _generateAwsFunctionLines } from "../shared-aws"; +import { PolicyStatement } from "../shared-aws"; import { IInflightHost } from "../std"; /** @@ -71,17 +71,6 @@ export class Function extends cloud.Function { super._bind(host, ops); } - /** - * Generates the code lines for the cloud function, - * overridden by the awscdk target to have the function context too - * @param inflightClient inflight client code - * @returns cloud function code string - * @internal - */ - protected _generateLines(inflightClient: core.Code): string[] { - return _generateAwsFunctionLines(inflightClient); - } - /** @internal */ public _toInflight(): core.Code { return core.InflightClient.for( diff --git a/libs/wingsdk/src/target-tf-aws/function.ts b/libs/wingsdk/src/target-tf-aws/function.ts index 40d71488c9d..33afca1253d 100644 --- a/libs/wingsdk/src/target-tf-aws/function.ts +++ b/libs/wingsdk/src/target-tf-aws/function.ts @@ -12,11 +12,7 @@ import * as cloud from "../cloud"; import * as core from "../core"; import { createBundle } from "../shared/bundling"; import { NameOptions, ResourceNames } from "../shared/resource-names"; -import { - IAwsFunction, - PolicyStatement, - _generateAwsFunctionLines, -} from "../shared-aws"; +import { IAwsFunction, PolicyStatement } from "../shared-aws"; import { IInflightHost, Resource } from "../std"; import { Duration } from "../std/duration"; @@ -226,17 +222,6 @@ export class Function extends cloud.Function implements IAwsFunction { return this.function.functionName; } - /** - * Generates the code lines for the cloud function, - * overridden by the tf-aws target to have the function context too - * @param inflightClient inflight client code - * @returns cloud function code string - * @internal - */ - protected _generateLines(inflightClient: core.Code): string[] { - return _generateAwsFunctionLines(inflightClient); - } - /** @internal */ public _bind(host: IInflightHost, ops: string[]): void { if (!(host instanceof Function)) { diff --git a/libs/wingsdk/test/shared-aws/function.inflight.test.ts b/libs/wingsdk/test/shared-aws/function.inflight.test.ts index 8529a39c22c..223c9e5f153 100644 --- a/libs/wingsdk/test/shared-aws/function.inflight.test.ts +++ b/libs/wingsdk/test/shared-aws/function.inflight.test.ts @@ -2,7 +2,10 @@ import { InvokeCommand, LambdaClient } from "@aws-sdk/client-lambda"; import { fromUtf8 } from "@aws-sdk/util-utf8-node"; import { mockClient } from "aws-sdk-client-mock"; import { test, expect, beforeEach } from "vitest"; -import { FunctionClient } from "../../src/shared-aws/function.inflight"; +import { + FunctionClient, + parseLogs, +} from "../../src/shared-aws/function.inflight"; const lambdaMock = mockClient(LambdaClient); @@ -22,7 +25,7 @@ test("invoke - happy path", async () => { }) .resolves({ StatusCode: 200, - Payload: fromUtf8(JSON.stringify({ payload: RESPONSE, context: {} })), + Payload: fromUtf8(JSON.stringify(RESPONSE)), }); // WHEN @@ -54,9 +57,7 @@ test("invoke - sad path", async () => { .resolves({ StatusCode: 200, FunctionError: "Unhandled", - Payload: fromUtf8( - JSON.stringify({ payload: RESPONSE_PAYLOAD, context: {} }) - ), + Payload: fromUtf8(JSON.stringify(RESPONSE_PAYLOAD)), }); // THEN @@ -65,3 +66,26 @@ test("invoke - sad path", async () => { /Invoke failed with message: "Unhandled". Full error:/ ); }); + +test("parse logs", () => { + const traces = parseLogs( + "START RequestId: 6beb7628-d0c3-4fe9-bf5a-d64c559aa25f Version: $LATEST\n2023-08-04T16:40:47.309Z\t6beb7628-d0c3-4fe9-bf5a-d64c559aa25f\tINFO\thello world\n2023-08-04T16:40:50.691Z\t6beb7628-d0c3-4fe9-bf5a-d64c559aa25f\tINFO\thello world\nEND RequestId: 6beb7628-d0c3-4fe9-bf5a-d64c559aa25f\nREPORT RequestId: 6beb7628-d0c3-4fe9-bf5a-d64c559aa25f\tDuration: 4958.93 ms\tBilled Duration: 4959 ms\tMemory Size: 128 MB\tMax Memory Used: 82 MB\tInit Duration: 249.40 ms\t\n", + "fake-source" + ); + expect(traces).toEqual([ + { + data: { message: "hello world" }, + timestamp: "2023-08-04T16:40:47.309Z", + sourceType: "wingsdk.cloud.Function", + sourcePath: "fake-source", + type: "log", + }, + { + data: { message: "hello world" }, + timestamp: "2023-08-04T16:40:50.691Z", + sourceType: "wingsdk.cloud.Function", + sourcePath: "fake-source", + type: "log", + }, + ]); +}); diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/bucket.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/bucket.test.ts.snap index f2cf3b0c260..f83c3e099fa 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/bucket.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/bucket.test.ts.snap @@ -371,7 +371,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "94f83f95c4960169698da21182aa43322e26febd1dd436ba66b7aa8bee22bf6c.zip", + "S3Key": "b9deba0f7dc17e61cf9f7e0fa901af6e57ec811a13882b7048ee9aa75797378d.zip", }, "Handler": "index.handler", "Role": { @@ -722,7 +722,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "94f83f95c4960169698da21182aa43322e26febd1dd436ba66b7aa8bee22bf6c.zip", + "S3Key": "b9deba0f7dc17e61cf9f7e0fa901af6e57ec811a13882b7048ee9aa75797378d.zip", }, "Handler": "index.handler", "Role": { @@ -1095,7 +1095,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "94f83f95c4960169698da21182aa43322e26febd1dd436ba66b7aa8bee22bf6c.zip", + "S3Key": "b9deba0f7dc17e61cf9f7e0fa901af6e57ec811a13882b7048ee9aa75797378d.zip", }, "Handler": "index.handler", "Role": { @@ -1446,7 +1446,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "94f83f95c4960169698da21182aa43322e26febd1dd436ba66b7aa8bee22bf6c.zip", + "S3Key": "b9deba0f7dc17e61cf9f7e0fa901af6e57ec811a13882b7048ee9aa75797378d.zip", }, "Handler": "index.handler", "Role": { diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/counter.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/counter.test.ts.snap index 405b918db3b..53d605226de 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/counter.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/counter.test.ts.snap @@ -129,7 +129,7 @@ exports[`dec() policy statement 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "3d34b0c68022ff68d2bdd3daab60be3e559875a3e8c238db011de0aea5bc42ff.zip", + "S3Key": "f3738bcfd58c05cf71242945f065454f27590bcdafb0ccd96150f36963676a16.zip", }, "Environment": { "Variables": { @@ -367,7 +367,7 @@ exports[`function with a counter binding 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "74e01d6a60f1ddd45dae1f1a8d3fc1aa448f89ad96871c62bc263e8bd152f742.zip", + "S3Key": "b03ff20bc0f7d7c4d3c6ac541eb138884f06868c5412ad8414d7913bebca1b6d.zip", }, "Environment": { "Variables": { @@ -539,7 +539,7 @@ exports[`inc() policy statement 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "74e01d6a60f1ddd45dae1f1a8d3fc1aa448f89ad96871c62bc263e8bd152f742.zip", + "S3Key": "b03ff20bc0f7d7c4d3c6ac541eb138884f06868c5412ad8414d7913bebca1b6d.zip", }, "Environment": { "Variables": { @@ -711,7 +711,7 @@ exports[`peek() policy statement 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "b02b0abb81862f51e55fe90bda0b88a268562450426bafb29bcd4965d5c137bf.zip", + "S3Key": "9189a03759b8a966a3e4efb03da3bf6b2546b25b85ccf726d3240bbc1b86e272.zip", }, "Environment": { "Variables": { @@ -883,7 +883,7 @@ exports[`set() policy statement 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "af2b813920861aadbfe984c8d0b127af03f8239cbe33dba2722640a2d5f20f0b.zip", + "S3Key": "0da3747a941f72aa30762d828c78b18e9f513c3801f61711ae0fd3ff29a218b5.zip", }, "Environment": { "Variables": { diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/function.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/function.test.ts.snap index 65841c50183..12cab60f6c9 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/function.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/function.test.ts.snap @@ -24,7 +24,7 @@ exports[`basic function 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "38a9ff14245d92554df153366cf2d2a9d28ef2881f7ffb2b54f6485ef1320ff1.zip", + "S3Key": "34031e10a718327bb9ec731d7b54025eebeef68c03bb4f5a3d8e6ad5262a0517.zip", }, "Handler": "index.handler", "Role": { @@ -124,7 +124,7 @@ exports[`basic function with environment variables 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "38a9ff14245d92554df153366cf2d2a9d28ef2881f7ffb2b54f6485ef1320ff1.zip", + "S3Key": "34031e10a718327bb9ec731d7b54025eebeef68c03bb4f5a3d8e6ad5262a0517.zip", }, "Environment": { "Variables": { @@ -230,7 +230,7 @@ exports[`basic function with memory size specified 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "38a9ff14245d92554df153366cf2d2a9d28ef2881f7ffb2b54f6485ef1320ff1.zip", + "S3Key": "34031e10a718327bb9ec731d7b54025eebeef68c03bb4f5a3d8e6ad5262a0517.zip", }, "Handler": "index.handler", "MemorySize": 512, @@ -331,7 +331,7 @@ exports[`basic function with timeout explicitly set 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "38a9ff14245d92554df153366cf2d2a9d28ef2881f7ffb2b54f6485ef1320ff1.zip", + "S3Key": "34031e10a718327bb9ec731d7b54025eebeef68c03bb4f5a3d8e6ad5262a0517.zip", }, "Handler": "index.handler", "Role": { diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/queue.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/queue.test.ts.snap index 675087888ba..f514f07893e 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/queue.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/queue.test.ts.snap @@ -86,7 +86,7 @@ exports[`queue with a consumer function 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "9fc1382c2a0178a4c77bf96086cf131f385709aaaae569d88f8933aa0ac72daf.zip", + "S3Key": "a028d8321beb7aea3bd17a266a795b276daefdce58f7b21e35e64db6463e08bc.zip", }, "Handler": "index.handler", "Role": { diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/schedule.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/schedule.test.ts.snap index 242c56b57a2..401eb906ee7 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/schedule.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/schedule.test.ts.snap @@ -61,7 +61,7 @@ exports[`schedule behavior with cron 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "afe05269ea630b6a33d85bc3ad16cfdd1422d9e4224c1966f3b664baebcca1c3.zip", + "S3Key": "99cc55258c346f62db746a74a3b335f909d0326a46c142758fdf8f8d189b2678.zip", }, "Handler": "index.handler", "Role": { @@ -198,7 +198,7 @@ exports[`schedule behavior with rate 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "afe05269ea630b6a33d85bc3ad16cfdd1422d9e4224c1966f3b664baebcca1c3.zip", + "S3Key": "99cc55258c346f62db746a74a3b335f909d0326a46c142758fdf8f8d189b2678.zip", }, "Handler": "index.handler", "Role": { @@ -363,7 +363,7 @@ exports[`schedule with two functions 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "afe05269ea630b6a33d85bc3ad16cfdd1422d9e4224c1966f3b664baebcca1c3.zip", + "S3Key": "99cc55258c346f62db746a74a3b335f909d0326a46c142758fdf8f8d189b2678.zip", }, "Handler": "index.handler", "Role": { @@ -417,7 +417,7 @@ exports[`schedule with two functions 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "afe05269ea630b6a33d85bc3ad16cfdd1422d9e4224c1966f3b664baebcca1c3.zip", + "S3Key": "99cc55258c346f62db746a74a3b335f909d0326a46c142758fdf8f8d189b2678.zip", }, "Handler": "index.handler", "Role": { diff --git a/libs/wingsdk/test/target-awscdk/__snapshots__/topic.test.ts.snap b/libs/wingsdk/test/target-awscdk/__snapshots__/topic.test.ts.snap index 51607ae5139..d87fad3af5d 100644 --- a/libs/wingsdk/test/target-awscdk/__snapshots__/topic.test.ts.snap +++ b/libs/wingsdk/test/target-awscdk/__snapshots__/topic.test.ts.snap @@ -106,7 +106,7 @@ exports[`topic with multiple subscribers 3`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "11ca6e50b19d67cc0384225dfc640e5f6333d2aed875fe12aa9c517bde39740c.zip", + "S3Key": "4ab62cb5f98ad2f9b2b3dd82c783136bb4211456f7f49afad99a73e6c40a7e6a.zip", }, "Handler": "index.handler", "Role": { @@ -191,7 +191,7 @@ exports[`topic with multiple subscribers 3`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "9e4bbeacac1fa631705a6f11c8112c95c304a704af2ee5bf9642e5831afdc694.zip", + "S3Key": "f13044b492c96c95c553740c33ce68a00d453711d947fd68ff5ed4ac51e58c34.zip", }, "Handler": "index.handler", "Role": { @@ -340,7 +340,7 @@ exports[`topic with subscriber function 2`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6a7bd7a896baf5ae1b05de3dbd1651bb4b7f702e418250016a73cf395de687a5.zip", + "S3Key": "2ec978de802295e114de200ac50fa06d9a5236c445ecf719650e5f86f9ba6c87.zip", }, "Handler": "index.handler", "Role": {