@@ -2,7 +2,7 @@ import * as crypto from 'crypto';
22import { existsSync , writeFileSync } from 'fs' ;
33import * as os from 'os' ;
44import * as path from 'path' ;
5- import { Aws , Duration , RemovalPolicy , Stack } from 'aws-cdk-lib' ;
5+ import { Aws , Duration , RemovalPolicy , Stack , Tags } from 'aws-cdk-lib' ;
66import * as cf from 'aws-cdk-lib/aws-cloudfront' ;
77import * as iam from 'aws-cdk-lib/aws-iam' ;
88import * as lambda from 'aws-cdk-lib/aws-lambda' ;
@@ -292,12 +292,19 @@ replaceHostHeader: ${props.replaceHostHeader}`;
292292
293293 // EdgeFunction has a bug where it will generate the same parameter
294294 // name across multiple stacks in the same region if the id param is constant
295- return new cf . experimental . EdgeFunction ( this , `edge-to-apigwy-func-${ this . hashStackName ( ) } ` , {
296- stackId : `microapps-edge-to-origin-${ this . hashStackName ( ) } ` ,
297- code : lambda . Code . fromAsset ( distPath ) ,
298- functionName : `microapps-edge-to-origin-${ this . hashStackName ( ) } ` ,
299- handler : 'index.handler' ,
300- ...edgeToOriginFuncProps ,
301- } ) ;
295+ const edge = new cf . experimental . EdgeFunction (
296+ this ,
297+ `edge-to-apigwy-func-${ this . hashStackName ( ) } ` ,
298+ {
299+ stackId : `microapps-edge-to-origin-${ this . hashStackName ( ) } ` ,
300+ code : lambda . Code . fromAsset ( distPath ) ,
301+ functionName : `microapps-edge-to-origin-${ this . hashStackName ( ) } ` ,
302+ handler : 'index.handler' ,
303+ ...edgeToOriginFuncProps ,
304+ } ,
305+ ) ;
306+ Tags . of ( edge ) . add ( 'Name' , Stack . of ( this ) . stackName ) ;
307+
308+ return edge ;
302309 }
303310}
0 commit comments