Skip to content

Commit 42508d9

Browse files
committed
use human-readable function name for lambda
1 parent 632d4be commit 42508d9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ab-testing/cdk/lib/__snapshots__/notificationLambda.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ exports[`The AB testing notification lambda stack > matches the CODE snapshot 1`
317317
"APP": "ab-testing-notification-lambda"
318318
}
319319
},
320+
"FunctionName": "ABTestingNotifications-CODE",
320321
"Handler": "index.handler",
321322
"LoggingConfig": {
322323
"LogFormat": "JSON"
@@ -827,6 +828,7 @@ exports[`The AB testing notification lambda stack > matches the PROD snapshot 1`
827828
"APP": "ab-testing-notification-lambda"
828829
}
829830
},
831+
"FunctionName": "ABTestingNotifications-PROD",
830832
"Handler": "index.handler",
831833
"LoggingConfig": {
832834
"LogFormat": "JSON"

ab-testing/cdk/lib/notificationLambda.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
1010
import { Runtime } from "aws-cdk-lib/aws-lambda";
1111
import { Subscription, SubscriptionProtocol, Topic } from "aws-cdk-lib/aws-sns";
1212

13-
const lambdaFunctionName = "ab-testing-notification-lambda";
13+
const appName = "ab-testing-notification-lambda";
1414

1515
const getEmailDomain = (stage: GuStackProps["stage"]) => {
1616
switch (stage) {
@@ -33,7 +33,7 @@ export class AbTestingNotificationLambda extends GuStack {
3333
};
3434

3535
const emailIdentity = new GuEmailIdentity(this, "EmailIdentity", {
36-
app: lambdaFunctionName,
36+
app: appName,
3737
domainName: getEmailDomain(props.stage),
3838
});
3939

@@ -53,7 +53,8 @@ export class AbTestingNotificationLambda extends GuStack {
5353
this,
5454
"AbTestingNotificationLambda",
5555
{
56-
app: lambdaFunctionName,
56+
functionName: `ABTestingNotifications-${props.stage}`,
57+
app: appName,
5758
fileName: "lambda.zip",
5859
handler: "index.handler",
5960
rules: this.stage === "PROD" ? [runDailyRule] : [],

0 commit comments

Comments
 (0)