Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to database bootstrapper Lambda do not re-trigger the function #113

Open
hrodmn opened this issue Dec 12, 2024 · 0 comments
Open

Comments

@hrodmn
Copy link
Contributor

hrodmn commented Dec 12, 2024

I recently deployed a PgstacDatabase and discovered that even though the bootstrapper code had changed, the bootstrap script did not get re-triggered like I expected. I think this is because the CustomResource that triggers the function will only run if one of its properties changes.

let customResourceProperties : { [key: string]: any} = props.customResourceProperties ? { ...defaultPgSTACCustomOptions, ...props.customResourceProperties } : defaultPgSTACCustomOptions;
// update properties
customResourceProperties["conn_secret_arn"] = this.db.secret!.secretArn;
customResourceProperties["new_user_secret_arn"] = this.pgstacSecret.secretArn;
// if props.lambdaFunctionOptions doesn't have 'code' defined, update pgstac_version (needed for default runtime)
if (!props.bootstrapperLambdaFunctionOptions?.code) {
customResourceProperties["pgstac_version"] = DEFAULT_PGSTAC_VERSION;
}

Maybe we could add a property with a hash from the contents of the bootstrapper_runtime that would force the bootstrapper to run again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant