Skip to content

Commit 8ccebe7

Browse files
committed
export bootstrapping-lambda's function name as CfnOutput (extracted as #226 to untangle/unblock #312)
1 parent 0327dfb commit 8ccebe7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

cdk/lib/__snapshots__/stack.test.ts.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ Object {
2929
"gu:cdk:version": "49.5.0",
3030
},
3131
"Outputs": Object {
32+
"BootstrappingLambdaFunctionName": Object {
33+
"Description": "pinboard-bootstrapping-lambda-TEST function name",
34+
"Export": Object {
35+
"Name": "pinboard-bootstrapping-lambda-TEST-function-name",
36+
},
37+
"Value": Object {
38+
"Ref": "pinboardbootstrappinglambdaD2C487DA",
39+
},
40+
},
3241
"pinboardbootstrappinglambdaapiEndpoint4DE1E032": Object {
3342
"Value": Object {
3443
"Fn::Join": Array [

cdk/lib/stack.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ export class PinBoardStack extends GuStack {
635635

636636
const bootstrappingLambdaBasename = "pinboard-bootstrapping-lambda";
637637
const bootstrappingLambdaApiBaseName = `${bootstrappingLambdaBasename}-api`;
638+
const bootstrappingLambdaFunctionName = `${bootstrappingLambdaBasename}-${this.stage}`;
638639

639640
const bootstrappingLambdaFunction = new lambda.Function(
640641
this,
@@ -656,7 +657,7 @@ export class PinBoardStack extends GuStack {
656657
"/pinboard/sentryDSN"
657658
),
658659
},
659-
functionName: `${bootstrappingLambdaBasename}-${this.stage}`,
660+
functionName: bootstrappingLambdaFunctionName,
660661
code: lambda.Code.fromBucket(
661662
deployBucket,
662663
`${this.stack}/${this.stage}/${bootstrappingLambdaApiBaseName}/${bootstrappingLambdaApiBaseName}.zip`
@@ -731,5 +732,11 @@ export class PinBoardStack extends GuStack {
731732
description: `${bootstrappingLambdaApiBaseName}-hostname`,
732733
value: `${bootstrappingApiDomainName.domainNameAliasDomainName}`,
733734
});
735+
736+
new CfnOutput(this, `BootstrappingLambdaFunctionName`, {
737+
exportName: `${bootstrappingLambdaFunctionName}-function-name`,
738+
description: `${bootstrappingLambdaFunctionName} function name`,
739+
value: `${bootstrappingLambdaFunction.functionName}`,
740+
});
734741
}
735742
}

0 commit comments

Comments
 (0)