Skip to content

Commit a29ea21

Browse files
feat: configure pgstac version in custom properties (#123)
1 parent b222426 commit a29ea21

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/database/bootstrapper_runtime/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
ARG PYTHON_VERSION
22
FROM --platform=linux/amd64 public.ecr.aws/lambda/python:${PYTHON_VERSION}
33

4-
ARG PGSTAC_VERSION
5-
RUN echo "PGSTAC_VERSION: ${PGSTAC_VERSION}"
64
RUN echo "PYTHON_VERSION: ${PYTHON_VERSION}"
75

86
WORKDIR /tmp
97

10-
RUN pip install httpx psycopg[binary,pool] pypgstac==${PGSTAC_VERSION} -t /asset
8+
RUN pip install httpx psycopg[binary,pool] pypgstac -t /asset
119

1210
COPY bootstrapper_runtime/handler.py /asset/handler.py
1311

lib/database/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ export class PgStacDatabase extends Construct {
7979
code: aws_lambda.Code.fromDockerBuild(__dirname, {
8080
file: "bootstrapper_runtime/Dockerfile",
8181
buildArgs: {
82-
PGSTAC_VERSION: DEFAULT_PGSTAC_VERSION,
83-
PYTHON_VERSION: "3.11",
82+
PYTHON_VERSION: "3.11"
8483
},
8584
}),
8685
vpc: hasVpc(this.db) ? this.db.vpc : props.vpc,
@@ -131,7 +130,7 @@ export class PgStacDatabase extends Construct {
131130

132131
// if props.lambdaFunctionOptions doesn't have 'code' defined, update pgstac_version (needed for default runtime)
133132
if (!props.bootstrapperLambdaFunctionOptions?.code) {
134-
customResourceProperties["pgstac_version"] = DEFAULT_PGSTAC_VERSION;
133+
customResourceProperties["pgstac_version"] = props.pgstacVersion || DEFAULT_PGSTAC_VERSION;
135134
}
136135
// this.connections = props.database.connections;
137136
const bootstrapper = new CustomResource(this, "bootstrapper", {
@@ -226,6 +225,13 @@ export interface PgStacDatabaseProps extends rds.DatabaseInstanceProps {
226225
*/
227226
readonly pgstacDbName?: string;
228227

228+
/**
229+
* Version of pgstac to install on the database
230+
*
231+
* @default 0.8.5
232+
*/
233+
readonly pgstacVersion?: string;
234+
229235
/**
230236
* Prefix to assign to the generated `secrets_manager.Secret`
231237
*

0 commit comments

Comments
 (0)