File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11import "source-map-support/register.js" ;
22import { GuRoot } from "@guardian/cdk/lib/constructs/root.js" ;
3- import { DeploymentLambda } from "../lib/deploymentLambda.ts" ;
3+ import { AbTestingDeploymentLambda } from "../lib/deploymentLambda.ts" ;
44
55const app = new GuRoot ( { outdir : "cdk.out/deployment-lambda" } ) ;
66
7- new DeploymentLambda ( app , "AbTestingDeploymentLambdaCode" , {
7+ new AbTestingDeploymentLambda ( app , "AbTestingDeploymentLambdaCode" , {
88 stack : "frontend" ,
99 stage : "CODE" ,
1010 env : {
1111 region : "eu-west-1" ,
1212 } ,
1313} ) ;
1414
15- new DeploymentLambda ( app , "AbTestingDeploymentLambdaProd" , {
15+ new AbTestingDeploymentLambda ( app , "AbTestingDeploymentLambdaProd" , {
1616 stack : "frontend" ,
1717 stage : "PROD" ,
1818 env : {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { GuStack } from "@guardian/cdk/lib/constructs/core/stack.js";
33import type { App } from "aws-cdk-lib" ;
44import { CustomResource , Duration } from "aws-cdk-lib" ;
55import { Function } from "aws-cdk-lib/aws-lambda" ;
6+ import { lambdaFunctionName } from "./deploymentLambda.ts" ;
67
78export class AbTestingConfig extends GuStack {
89 constructor ( scope : App , id : string , props : GuStackProps ) {
@@ -11,7 +12,7 @@ export class AbTestingConfig extends GuStack {
1112 const lambda = Function . fromFunctionName (
1213 this ,
1314 "DeploymentLambdaFunction" ,
14- `${ props . app } -${ this . stage } ` ,
15+ `${ lambdaFunctionName } -${ this . stage } ` ,
1516 ) ;
1617
1718 // Trigger the Lambda to run upon deployment
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import type { App } from "aws-cdk-lib";
66import { Runtime } from "aws-cdk-lib/aws-lambda" ;
77import { StringParameter } from "aws-cdk-lib/aws-ssm" ;
88
9- export class DeploymentLambda extends GuStack {
9+ export const lambdaFunctionName = "ab-testing-deployment-lambda" ;
10+
11+ export class AbTestingDeploymentLambda extends GuStack {
1012 constructor ( scope : App , id : string , props : GuStackProps ) {
1113 super ( scope , id , props ) ;
1214
@@ -38,10 +40,10 @@ export class DeploymentLambda extends GuStack {
3840 ) ;
3941
4042 const lambda = new GuLambdaFunction ( this , "AbTestingDeploymentLambda" , {
41- functionName : `ab-testing-deployment -${ this . stage } ` ,
43+ functionName : `${ lambdaFunctionName } -${ this . stage } ` ,
4244 fileName : "lambda.zip" ,
4345 handler : "index.handler" ,
44- app : "ab-testing-deployment- lambda" ,
46+ app : ` ${ lambdaFunctionName } - lambda` ,
4547 runtime : Runtime . NODEJS_22_X ,
4648 memorySize : 256 ,
4749 environment : {
You can’t perform that action at this time.
0 commit comments