Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions infrastructure/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ def __init__(
path=os.path.abspath(context_dir),
file="infrastructure/dockerfiles/Dockerfile.raster",
build_args={
"PYTHON_VERSION": "3.11",
"PYTHON_VERSION": "3.12",
},
platform="linux/amd64",
),
"handler": "handler.handler",
"runtime": aws_lambda.Runtime.PYTHON_3_11,
"runtime": aws_lambda.Runtime.PYTHON_3_12,
},
)

Expand Down Expand Up @@ -224,12 +224,12 @@ def __init__(
path=os.path.abspath(context_dir),
file="infrastructure/dockerfiles/Dockerfile.stac",
build_args={
"PYTHON_VERSION": "3.11",
"PYTHON_VERSION": "3.12",
},
platform="linux/amd64",
),
"handler": "handler.handler",
"runtime": aws_lambda.Runtime.PYTHON_3_11,
"runtime": aws_lambda.Runtime.PYTHON_3_12,
},
)

Expand Down Expand Up @@ -271,12 +271,12 @@ def __init__(
path=os.path.abspath(context_dir),
file="infrastructure/dockerfiles/Dockerfile.vector",
build_args={
"PYTHON_VERSION": "3.11",
"PYTHON_VERSION": "3.12",
},
platform="linux/amd64",
),
"handler": "handler.handler",
"runtime": aws_lambda.Runtime.PYTHON_3_11,
"runtime": aws_lambda.Runtime.PYTHON_3_12,
},
)

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/dockerfiles/Dockerfile.raster
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12

FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/dockerfiles/Dockerfile.stac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12

FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/dockerfiles/Dockerfile.vector
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12

FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}

Expand Down
10 changes: 8 additions & 2 deletions infrastructure/handlers/stac_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
import os

from eoapi.stac.app import app
from eoapi.stac.config import PostgresSettings
from eoapi.stac.config import PostgresSettings, Settings
from mangum import Mangum
from stac_fastapi.pgstac.db import connect_to_db

logging.getLogger("mangum.lifespan").setLevel(logging.ERROR)
logging.getLogger("mangum.http").setLevel(logging.ERROR)

settings = Settings()


@app.on_event("startup")
async def startup_event() -> None:
"""Connect to database on startup."""
await connect_to_db(app, postgres_settings=PostgresSettings())
await connect_to_db(
app,
postgres_settings=PostgresSettings(),
add_write_connection_pool=settings.enable_transaction,
)


handler = Mangum(app, lifespan="off")
Expand Down
Loading