berenddeboer / cdk-rds-sql

A CDK construct that allows creating roles and databases an on Aurora Serverless Postgresql cluster.
Apache License 2.0
23 stars 11 forks source link

Provider Lambda timeout no set from functionProps.timeout #41

Open mikel67 opened 1 week ago

mikel67 commented 1 week ago

When setting function properties for the provider the timeout is not applied and always uses the default of 5 minutes.

e.g. const rdsProvider = new Provider(this, "Provider", { vpc: vpc, cluster: cluster, vpcSubnets: vpc.selectSubnets({ subnetType: SubnetType.PUBLIC }), // eslint-disable-next-line @typescript-eslint/no-non-null-assertion secret: cluster.secret!, functionProps: { allowPublicSubnet: true, timeout: Duration.minutes(15), } });

Investigated and see that the issue is with newCustomResourceHandler (line 136)

current code: timeout: props.timeout ?? Duration.seconds(300),

fixed code: timeout: props.functionProps?.timeout ?? Duration.seconds(300),

I have tested on a local clone and the change results in the Lambda function having the expected timeout of 15 minutes. Once I get a chance to familiarise myself with the codebase and tests, will submit a PR.