File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
typescript/postgres-lambda/lib Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export class PostgresLambdaStack extends cdk.Stack {
4646 'cp -r . /asset-output/'
4747 ] . join ( ' && ' )
4848 ] ,
49+ user : '1000' ,
4950 } ,
5051 } ) ,
5152 vpc,
@@ -69,7 +70,20 @@ export class PostgresLambdaStack extends cdk.Stack {
6970 const postgresFunction = new lambda . Function ( this , 'PostgresFunction' , {
7071 runtime : lambda . Runtime . NODEJS_LATEST ,
7172 handler : 'index.handler' ,
72- code : lambda . Code . fromAsset ( path . join ( __dirname , '../lambda/postgres-to-lambda' ) ) ,
73+ code : lambda . Code . fromAsset ( path . join ( __dirname , '../lambda/postgres-to-lambda' ) , {
74+ bundling : {
75+ image : cdk . DockerImage . fromRegistry ( 'public.ecr.aws/sam/build-nodejs18.x' ) ,
76+ command : [
77+ 'bash' , '-c' , [
78+ 'cp -r . /tmp' ,
79+ 'cd /tmp' ,
80+ 'npm init -y' ,
81+ 'cp -r . /asset-output/'
82+ ] . join ( ' && ' )
83+ ] ,
84+ user : '1000' ,
85+ } ,
86+ } ) ,
7387 environment : {
7488 FUNCTION_NAME : 'PostgresFunction' ,
7589 } ,
@@ -114,6 +128,7 @@ export class PostgresLambdaStack extends cdk.Stack {
114128 'cp -r . /asset-output/'
115129 ] . join ( ' && ' )
116130 ] ,
131+ user : '1000' ,
117132 } ,
118133 } ) ,
119134 vpc,
You can’t perform that action at this time.
0 commit comments