File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
platform/src/components/aws Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2509,6 +2509,17 @@ export class Function extends Component implements Link.Linkable {
25092509 } ,
25102510 { parent } ,
25112511 ) ;
2512+ if ( url . authorization === "none" ) {
2513+ new lambda . Permission (
2514+ `${ name } InvokeFunction` ,
2515+ {
2516+ action : "lambda:InvokeFunction" ,
2517+ function : fn . name ,
2518+ principal : "*" ,
2519+ } ,
2520+ { parent } ,
2521+ ) ;
2522+ }
25122523 if ( ! url . route ) return fnUrl . functionUrl ;
25132524
25142525 // add router route
Original file line number Diff line number Diff line change @@ -1064,6 +1064,16 @@ async function handler(event) {
10641064 } ,
10651065 { provider, parent : self } ,
10661066 ) ;
1067+ new lambda . Permission (
1068+ `${ name } CloudFrontInvokeFunction${ logicalName ( region ) } ` ,
1069+ {
1070+ action : "lambda:InvokeFunction" ,
1071+ function : server . nodes . function . name ,
1072+ principal : "cloudfront.amazonaws.com" ,
1073+ sourceArn : dist . nodes . distribution . arn ,
1074+ } ,
1075+ { provider, parent : self } ,
1076+ ) ;
10671077 }
10681078 } ) ;
10691079
@@ -1094,6 +1104,16 @@ async function handler(event) {
10941104 } ,
10951105 { parent : self } ,
10961106 ) ;
1107+ new lambda . Permission (
1108+ `${ name } ImageOptimizerCloudFrontInvokeFunction` ,
1109+ {
1110+ action : "lambda:InvokeFunction" ,
1111+ function : imgOptimizer . nodes . function . name ,
1112+ principal : "cloudfront.amazonaws.com" ,
1113+ sourceArn : dist . nodes . distribution . arn ,
1114+ } ,
1115+ { parent : self } ,
1116+ ) ;
10971117 }
10981118 }
10991119 } ,
You can’t perform that action at this time.
0 commit comments