Skip to content

Commit 555a243

Browse files
committed
specify version of pypgstac installed in bootstrapper
1 parent 34448b5 commit 555a243

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/database/bootstrapper_runtime/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION}
44
RUN echo "PYTHON_VERSION: ${PYTHON_VERSION}"
55

66
WORKDIR /tmp
7-
8-
RUN pip install httpx psycopg[binary,pool] pypgstac -t /asset
7+
ARG PGSTAC_VERSION
8+
RUN pip install httpx psycopg[binary,pool] pypgstac==${PGSTAC_VERSION} -t /asset
99

1010
COPY bootstrapper_runtime/handler.py /asset/handler.py
1111

lib/database/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class PgStacDatabase extends Construct {
6969
parameterGroup,
7070
...props,
7171
});
72-
72+
const pgstac_version = props.pgstacVersion || DEFAULT_PGSTAC_VERSION;
7373
const handler = new aws_lambda.Function(this, "lambda", {
7474
// defaults
7575
runtime: aws_lambda.Runtime.PYTHON_3_11,
@@ -81,6 +81,7 @@ export class PgStacDatabase extends Construct {
8181
file: "bootstrapper_runtime/Dockerfile",
8282
buildArgs: {
8383
PYTHON_VERSION: "3.11",
84+
PGSTAC_VERSION: pgstac_version,
8485
},
8586
}),
8687
vpc: hasVpc(this.db) ? this.db.vpc : props.vpc,
@@ -131,8 +132,7 @@ export class PgStacDatabase extends Construct {
131132

132133
// if props.lambdaFunctionOptions doesn't have 'code' defined, update pgstac_version (needed for default runtime)
133134
if (!props.bootstrapperLambdaFunctionOptions?.code) {
134-
customResourceProperties["pgstac_version"] =
135-
props.pgstacVersion || DEFAULT_PGSTAC_VERSION;
135+
customResourceProperties["pgstac_version"] = pgstac_version;
136136
}
137137

138138
// add timestamp to properties to ensure the Lambda gets re-executed on each deploy

0 commit comments

Comments
 (0)