44import {
55 Duration ,
66 CfnOutput ,
7+ CfnParameter ,
78 Stack ,
89 StackProps ,
910 RemovalPolicy ,
@@ -19,7 +20,13 @@ export class SsrStack extends Stack {
1920 constructor ( scope : Construct , id : string , props ?: StackProps ) {
2021 super ( scope , id , props ) ;
2122
23+ const mySiteBucketName = new CfnParameter ( this , "mySiteBucketName" , {
24+ type : "String" ,
25+ description : "The name of S3 bucket to upload react application"
26+ } ) ;
27+
2228 const mySiteBucket = new s3 . Bucket ( this , "ssr-site" , {
29+ bucketName : mySiteBucketName . valueAsString ,
2330 websiteIndexDocument : "index.html" ,
2431 websiteErrorDocument : "error.html" ,
2532 publicReadAccess : false ,
@@ -40,15 +47,15 @@ export class SsrStack extends Stack {
4047 } ) ;
4148
4249 const ssrFunction = new lambda . Function ( this , "ssrHandler" , {
43- runtime : lambda . Runtime . NODEJS_12_X ,
50+ runtime : lambda . Runtime . NODEJS_16_X ,
4451 code : lambda . Code . fromAsset ( "../simple-ssr/server-build" ) ,
4552 memorySize : 128 ,
4653 timeout : Duration . seconds ( 5 ) ,
4754 handler : "index.handler" ,
4855 } ) ;
4956
5057 const ssrEdgeFunction = new lambda . Function ( this , "ssrEdgeHandler" , {
51- runtime : lambda . Runtime . NODEJS_12_X ,
58+ runtime : lambda . Runtime . NODEJS_16_X ,
5259 code : lambda . Code . fromAsset ( "../simple-ssr/edge-build" ) ,
5360 memorySize : 128 ,
5461 timeout : Duration . seconds ( 5 ) ,
0 commit comments