@@ -17,6 +17,8 @@ function hasVpc(
1717 return ( instance as aws_rds . DatabaseInstance ) . vpc !== undefined ;
1818}
1919
20+ const DEFAULT_PGSTAC_VERSION = "0.6.8" ;
21+
2022/**
2123 * Bootstraps a database instance, installing pgSTAC onto the database.
2224 */
@@ -26,12 +28,13 @@ export class BootstrapPgStac extends Construct {
2628 constructor ( scope : Construct , id : string , props : BootstrapPgStacProps ) {
2729 super ( scope , id ) ;
2830
31+ const { pgstacVersion = DEFAULT_PGSTAC_VERSION } = props ;
2932 const handler = new aws_lambda . Function ( this , "lambda" , {
3033 handler : "handler.handler" ,
3134 runtime : aws_lambda . Runtime . PYTHON_3_8 ,
3235 code : aws_lambda . Code . fromDockerBuild ( __dirname , {
3336 file : "runtime/Dockerfile" ,
34- buildArgs : { PGSTAC_VERSION : props . pgstacVersion || "0.6.8" } ,
37+ buildArgs : { PGSTAC_VERSION : pgstacVersion } ,
3538 } ) ,
3639 timeout : Duration . minutes ( 2 ) ,
3740 vpc : hasVpc ( props . database ) ? props . database . vpc : props . vpc ,
@@ -74,7 +77,7 @@ export class BootstrapPgStac extends Construct {
7477 properties : {
7578 // By setting pgstac_version in the properties assures
7679 // that Create/Update events will be passed to the service token
77- pgstac_version : props . pgstacVersion ,
80+ pgstac_version : pgstacVersion ,
7881 conn_secret_arn : props . dbSecret . secretArn ,
7982 new_user_secret_arn : this . secret . secretArn ,
8083 } ,
0 commit comments