Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Fetch upstream changes (#52)
Browse files Browse the repository at this point in the history
* Sync updates from upstream, add permissions boundary to created roles if needed (#8)

* Point README to veda-docs (NASA-IMPACT#171)

* Upgrade titiler and titiler-pgstac

* Fix br/gzip header test

* Remove factory (it's included in new titiler-pgstac version)
NASA-IMPACT#148 (comment)

* Remove pin on cramjam

* Load test data in container (actions not updated)

* fix actions tests

* adjust container strategy

* actions connections fix

* remove -it flag (it broke actions)

* re-enable lint, propagate test changes to other actions

* docker-compose -> docker compose

* Fix template import

* include private subnet config

* fix subnet type

* format changes

* pub accessible default true

* remove publicly accessible variable

* Add sql connection and execution abstraction

* Add sql logic to fix projection extension types

* add script to delete null stac_extensions

* Lint and move sql command scripts to support_scripts dir

* Use pythonic naming conventions

* pgstac readme change

* docker compose pgstac version

* pre-deploy action fix

* RDS Proxy initial implementation

* proxy secret + urlllib fix

* use pgstac 0.7.9

* Update set environment

* Add support for permissions boundary

* use titiler custom JSONResponse to handle NaN values

---------

Co-authored-by: Julia Signell <[email protected]>
Co-authored-by: ividito <[email protected]>
Co-authored-by: smohiudd <[email protected]>
Co-authored-by: Saadiq Mohiuddin <[email protected]>
Co-authored-by: Nathan Zimmerman <[email protected]>
Co-authored-by: Caden Helbling <[email protected]>
Co-authored-by: vincentsarago <[email protected]>
Co-authored-by: Alexandra Kirk <[email protected]>

* Update bootstrapper lambda timeout (#11)

* Fix order of db search path (#13)

* Fix order of db search path

* Remove environment from predeploy

* Make RDS instance type configurable (#18)

* Fix missing rds config update (#22)

* Update rds type example config value (#25)

* Fix missing rds config update

* Update rds type config example value

* update collection summaries methods to include max end datetime

* fix docker compose in pr action

* Add DB storage encryption configurability (#34)

* Only add storage_encrypted db config if true (#35)

* use NAT Gateway

* Add TMS route for tile matrices (#40)

* Optionally overwrite host param in stac api (#43)

* Update mappingvalue to custom

* Overwrite host header for both raster and stac apis (#46)

* Overwrite host header for both raster and stac apis

* Add docstrings

* Fix stac config env prefix

* Host param override for api gateway (#48)

* Fetch upstream changes (#51)

* Fix mangum db connection pool

* lint

* Point README to veda-docs (NASA-IMPACT#171)

* Upgrade titiler and titiler-pgstac

* Fix br/gzip header test

* Remove factory (it's included in new titiler-pgstac version)
NASA-IMPACT#148 (comment)

* Remove pin on cramjam

* Load test data in container (actions not updated)

* fix actions tests

* adjust container strategy

* actions connections fix

* remove -it flag (it broke actions)

* re-enable lint, propagate test changes to other actions

* docker-compose -> docker compose

* Fix template import

* include private subnet config

* fix subnet type

* format changes

* pub accessible default true

* remove publicly accessible variable

* Add sql connection and execution abstraction

* Add sql logic to fix projection extension types

* add script to delete null stac_extensions

* Lint and move sql command scripts to support_scripts dir

* Use pythonic naming conventions

* pgstac readme change

* pin to urllib3<2

* pin urllib3 in test

* format

* revert

* pin httpx

* revert

* docker compose pgstac version

* pre-deploy action fix

* RDS Proxy initial implementation

* proxy secret + urlllib fix

* use pgstac 0.7.4

* use titiler custom JSONResponse to handle NaN values

* change db search path

* hacky fix

* try exporting os env vars

* export os env vars

* lint

* comment

* move to APISettings check

* black changes

* hide route

* Pin pydantic for now

* put raster assume role config in lambda construct

* pass lambda env variable bool as string

* NAT SG rules

* order of operation

* remove implicity SGs

* black formatted

* fix invalid string in rule description

* updates to deployment docs in readme

* update pgstac version in docker compose

* use max/end datetime in periodic collection datetime summary

* correct table name typo

* use NAT Gateway instead of EC2 Instance as NAT

* aws_ec2 mistake

* use aws_ec2.SubnetType.PRIVATE_WITH_EGRESS

* add back in NAT count

* add rds subnet group manual removal step to instructions for destroying a stack

* Enable tilematrixsets

* feat(database): RDS Configurations (NASA-IMPACT#218)

* feat(database): RDS Configurations

* chore: string configurations

* feat(database): Configurable RDS Configurations

* consolidate configuration docs in readme

* update table header

---------

Co-authored-by: anayeaye <[email protected]>

* raster path prefix

* stac path prefix

* format

* config changes

* format

* Revert "format"

This reverts commit 3a26c1c.

* Revert "config changes"

This reverts commit 1425de6.

* feat: add configuration and github actions for python-semantic-release

* feat: lint conventional pr

* ci: cdk deploy should not require approval in github actions workflow

* docs: add contributing.md

* chore(ci): fix typo

* chore: explain versioning init choice

* chore: expalin automated version in setup.py

* chore: typo

Co-authored-by: Jamison French <[email protected]>

* docs: typos and improvements in contributing docs

* docs: typos in contributing

* ci: handle semantic version releases with tags only

* chore: add exclude commit patterns from release changelog

* cloudfront in veda backend

* format

* fix: if provided, apply permissions boundary to all roles created within a stack

* mypy, pydocstyle fixes

pydocstyle fixes

format

isort changes

optional config

format

config changes

format

config changes

construct change

* include apigateway parameter mapping

* remove unused import

* update readme

* remove unused config

* docs: s/veda-data-pipelines/veda-data-airflow/

I can't update the diagram b/c it's draw.io.

* include parameter mapping in raster api

* ci: branch specific pre-deploy check on pull request action

* ci: pre-deploy test against dev stack by default

* fix github var name in action

* typo

* include conditional param mapping

* change param mapping kwargs

* fix cloudfront subdomain

* incude missing argument

* formatting

* feat(raster)!: update titiler-pgstac from 0.2.3 to 0.8.0

* add dependencies

* add tests deps

* fix tests

* 🤦

* update handler

* pin pydantic to 1.* for cdk deployment

* fix deps

* fix(raster) use root path for prefixing and add to gateway base url in handler

* fix(stac) use root path for prefixing urls

* root path in fastapi app

* updates to for using a proxy

* lint

* only add additional servers to fast api if root path in config

* root path setting is optional

* cleanup

* cleanup

* do not configure alias for shared subdomain

* pr review cleanup

* fastapi additional servers not needed with apigw base path=app.root_path

* add custom colormap for EPA dataset

* Update raster_api/runtime/src/cmap_data/README.md

* rename cmap

* fix(apis)!: overwrite host in api integration if custom host provided

* fix(apis)!: overwrite host in api integration if custom host provided (p2)

* fix(routes)!: ingest api root path is /api/publish

* change ingestor api cf behavior

* format

* fix(domain)! only create custom api subdomains when configured

* improve config descriptions

* typo

* improve domain config docs

* account for custom staged url of veda-stac-ingestor

* do not run lint conventional pr

* merge duplicate corrected

* lint

* merge mismatched rds config naming

* merge inconsistencies

* merge inconsistencies

---------

Co-authored-by: Saadiq Mohiuddin <[email protected]>
Co-authored-by: ividito <[email protected]>
Co-authored-by: Julia Signell <[email protected]>
Co-authored-by: smohiudd <[email protected]>
Co-authored-by: Nathan Zimmerman <[email protected]>
Co-authored-by: vincentsarago <[email protected]>
Co-authored-by: ranchodeluxe <[email protected]>
Co-authored-by: sudobangbang <[email protected]>
Co-authored-by: Jamison French <[email protected]>
Co-authored-by: Pete Gadomski <[email protected]>

* Remove unnecessary remanants of merge

* Remove "host" config var

---------

Co-authored-by: Julia Signell <[email protected]>
Co-authored-by: ividito <[email protected]>
Co-authored-by: smohiudd <[email protected]>
Co-authored-by: Saadiq Mohiuddin <[email protected]>
Co-authored-by: Nathan Zimmerman <[email protected]>
Co-authored-by: Caden Helbling <[email protected]>
Co-authored-by: vincentsarago <[email protected]>
Co-authored-by: Alexandra Kirk <[email protected]>
Co-authored-by: Abdelhak Marouane <[email protected]>
Co-authored-by: ranchodeluxe <[email protected]>
Co-authored-by: sudobangbang <[email protected]>
Co-authored-by: Jamison French <[email protected]>
Co-authored-by: Pete Gadomski <[email protected]>
  • Loading branch information
14 people authored Nov 14, 2023
1 parent 9534279 commit 1133e0e
Show file tree
Hide file tree
Showing 40 changed files with 801 additions and 404 deletions.
15 changes: 11 additions & 4 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ VEDA_DOMAIN_ALT_HOSTED_ZONE_ID=[OPTIONAL SECOND HOSTED ZONE]
VEDA_DOMAIN_ALT_HOSTED_ZONE_NAME=[OPTIONAL SECOND DOMAIN]

VEDA_RASTER_ENABLE_MOSAIC_SEARCH=TRUE
VEDA_RASTER_DATA_ACCESS_ROLE_ARN=[OPTIONAL ARN OF IAM ROLE TO BE ASSUMED BY RASTER API]
VEDA_RASTER_DATA_ACCESS_ROLE_ARN=[OPTIONAL ARN OF IAM ROLE TO BE ASSUMED BY RASTER API]
VEDA_RASTER_EXPORT_ASSUME_ROLE_CREDS_AS_ENVS=False

VEDA_RASTER_PATH_PREFIX=[OPTIONAL PATH PREFIX TO ADD TO TITILER ENDPOINTS]
VEDA_STAC_PATH_PREFIX=[OPTIONAL PATH PREFIX TO ADD TO TITILER ENDPOINTS]
VEDA_DB_PUBLICLY_ACCESSIBLE=TRUE

VEDA_RASTER_ROOT_PATH=
VEDA_STAC_ROOT_PATH=

VEDA_HOST=[OPTIONAL HOST/DOMAIN_NAME TO PROPAGATE TO STAC AND RASTER APIS]
STAC_BROWSER_BUCKET=
STAC_URL=
CERT_ARN=
VEDA_CLOUDFRONT=
VEDA_CUSTOM_HOST=
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
with:
python-version: '3.9'


- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
Expand All @@ -69,7 +70,7 @@ jobs:
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev,deploy,test]
python -m pip install -e .[dev,deploy,test]
- name: Launch services
run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker compose up --build -d
Expand All @@ -82,6 +83,7 @@ jobs:
run: sleep 10s
shell: bash


- name: Integrations tests
run: python -m pytest .github/workflows/tests/ -vv -s

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def test_mosaic_api():
assert list(resp.json()[0]) == ["id", "bbox", "assets", "collection"]
assert resp.json()[0]["id"] == "20200307aC0853900w361030"

resp = httpx.get(f"{raster_endpoint}/mosaic/{searchid}/15/8589/12849/assets")
resp = httpx.get(f"{raster_endpoint}/mosaic/{searchid}/tiles/15/8589/12849/assets")
assert resp.status_code == 200
assert len(resp.json()) == 1
assert list(resp.json()[0]) == ["id", "bbox", "assets", "collection"]
assert resp.json()[0]["id"] == "20200307aC0853900w361030"

z, x, y = 15, 8589, 12849
resp = httpx.get(
f"{raster_endpoint}/mosaic/tiles/{searchid}/{z}/{x}/{y}",
f"{raster_endpoint}/mosaic/{searchid}/tiles/{z}/{x}/{y}",
params={"assets": "cog"},
headers={"Accept-Encoding": "br, gzip"},
timeout=10.0,
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
language_version: python

- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
rev: 6.1.0
hooks:
- id: flake8
language_version: python
Expand Down
4 changes: 2 additions & 2 deletions .readme/veda-backend.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 111 additions & 2 deletions .readme/veda-backend.drawio.xml

Large diffs are not rendered by default.

45 changes: 37 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,42 @@ To retrieve the variables for a stage that has been previously deployed, the sec
| `VEDA_DB_PGSTAC_VERSION` | **REQUIRED** version of PgStac database, i.e. 0.7.9 |
| `VEDA_DB_SCHEMA_VERSION` | **REQUIRED** The version of the custom veda-backend schema, i.e. 0.1.1 |
| `VEDA_DB_SNAPSHOT_ID` | **Once used always REQUIRED** Optional RDS snapshot identifier to initialize RDS from a snapshot |
> **Note** See [Advanced Configuration](docs/advanced_configuration.md) for details about custom configuration options.

### Advanced configuration
The constructs and applications in this project are configured using pydantic. The settings are defined in config.py files stored alongside the associated construct or application--for example the settings for the RDS PostgreSQL construct are defined in database/infrastructure/config.py. For custom configuration, use environment variables to override the pydantic defaults.

| Construct | Env Prefix | Configuration |
| --- | --- | --- |
| Database | `VEDA_DB` | [database/infrastructure/config.py](database/infrastructure/config.py) |
| Domain | `VEDA_DOMAIN` | [domain/infrastructure/config.py](domain/infrastructure/config.py) |
| Network | `N/A` | [network/infrastructure/config.py](network/infrastructure/config.py) |
| Raster API (TiTiler) | `VEDA_RASTER` | [raster_api/infrastructure/config.py](raster_-_api/infrastructure/config.py) |
| STAC API | `VEDA` | [stac_api/infrastructure/config.py](stac_api/infrastructure/config.py) |
| Routes | `VEDA` | [routes/infrastructure/config.py](routes/infrastructure/config.py) |

### Deploying to the cloud

#### Install pre-requisites
#### Install deployment pre-requisites
- [Node](https://nodejs.org/)
- [NVM](https://github.com/nvm-sh/nvm#node-version-manager---)
- [jq](https://jqlang.github.io/jq/) (used for exporting environment variable secrets to `.env` in [scripts/sync-env-local.sh](/scripts/sync-env-local.sh))

These can be installed with [homebrew](https://brew.sh/) on MacOS
```
brew install node
brew install nvm
brew install jq
```

#### Virtual environment example
```
python3 -m venv .venv
source .venv/bin/activate
```

#### Install requirements
```bash
nvm install 17
nvm use 17
node --version
nvm use --lts
npm install --location=global aws-cdk
python3 -m pip install --upgrade pip
python3 -m pip install -e ".[dev,deploy,test]"
Expand All @@ -72,8 +98,9 @@ cdk deploy
If this is a development stack that is safe to delete, you can delete the stack in CloudFormation console or via `cdk destroy`, however, the additional manual steps were required to completely delete the stack resources:

1. You will need to disable deletion protection of the RDS database and delete the database.
2. Detach the Internet Gateway (IGW) from the VPC and delete it.
3. If this stack created a new VPC, delete the VPC (this should delete a subnet and security group too).
2. Identify and delete the RDS subnet group associated with the RDS database you just deleted (it will not be automatically removed because of the RDS deletion protection in place when the group was created).
3. If this stack created a new VPC, detach the Internet Gateway (IGW) from the VPC and delete it.
4. If this stack created a new VPC, delete the VPC (this should delete a subnet and security group too).

## Custom deployments

Expand All @@ -98,7 +125,7 @@ docker compose down

> **Warning** PgSTAC records should be loaded in the database using [pypgstac](https://github.com/stac-utils/pgstac#pypgstac) for proper indexing and partitioning.
The VEDA ecosystem includes tools specifially created for loading PgSTAC records and optimizing data assets. The [veda-data-pipelines](https://github.com/NASA-IMPACT/veda-data-pipelines) project provides examples of cloud pipelines that transform data to cloud optimized formats, generate STAC metadata, and submit records for publication to the veda-backend database using the [veda-stac-ingestor](https://github.com/NASA-IMPACT/veda-stac-ingestor).
The VEDA ecosystem includes tools specifially created for loading PgSTAC records and optimizing data assets. The [veda-data-airflow](https://github.com/NASA-IMPACT/veda-data-airflow) project provides examples of cloud pipelines that transform data to cloud optimized formats, generate STAC metadata, and submit records for publication to the veda-backend database using the [veda-stac-ingestor](https://github.com/NASA-IMPACT/veda-stac-ingestor).

## Support scripts
Support scripts are provided for manual system operations.
Expand All @@ -118,6 +145,7 @@ Support scripts are provided for manual system operations.

## VEDA usage examples

### [VEDA documentation](https://nasa-impact.github.io/veda-docs)
### [VEDA documentation](https://nasa-impact.github.io/veda-docs)

### [VEDA dashboard](https://www.earthdata.nasa.gov/dashboard)
Expand All @@ -129,3 +157,4 @@ Radiant Earth's [stac-browser](https://github.com/radiantearth/stac-browser) is

# License
This project is licensed under **Apache 2**, see the [LICENSE](LICENSE) file for more details.

20 changes: 17 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from domain.infrastructure.construct import DomainConstruct
from network.infrastructure.construct import VpcConstruct
from raster_api.infrastructure.construct import RasterApiLambdaConstruct
from routes.infrastructure.construct import CloudfrontDistributionConstruct
from stac_api.infrastructure.construct import StacApiLambdaConstruct

app = App()
Expand All @@ -24,7 +25,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
if veda_app_settings.permissions_boundary_policy_name:
permission_boundary_policy = aws_iam.ManagedPolicy.from_managed_policy_name(
self,
"permission-boundary",
"permissions-boundary",
veda_app_settings.permissions_boundary_policy_name,
)
aws_iam.PermissionsBoundary.of(self).apply(permission_boundary_policy)
Expand Down Expand Up @@ -59,18 +60,29 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
raster_api = RasterApiLambdaConstruct(
veda_stack,
"raster-api",
stage=veda_app_settings.stage_name(),
vpc=vpc.vpc,
database=database,
domain_name=domain.raster_domain_name,
domain=domain,
)

stac_api = StacApiLambdaConstruct(
veda_stack,
"stac-api",
stage=veda_app_settings.stage_name(),
vpc=vpc.vpc,
database=database,
raster_api=raster_api,
domain_name=domain.stac_domain_name,
domain=domain,
)

veda_routes = CloudfrontDistributionConstruct(
veda_stack,
"routes",
stage=veda_app_settings.stage_name(),
raster_api_id=raster_api.raster_api.api_id,
stac_api_id=stac_api.stac_api.api_id,
region=veda_app_settings.cdk_default_region,
)

# TODO this conditional supports deploying a second set of APIs to a separate custom domain and should be removed if no longer necessary
Expand All @@ -85,6 +97,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
alt_raster_api = RasterApiLambdaConstruct(
veda_stack,
"alt-raster-api",
stage=veda_app_settings.stage_name(),
vpc=vpc.vpc,
database=database,
domain_name=alt_domain.raster_domain_name,
Expand All @@ -93,6 +106,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
alt_stac_api = StacApiLambdaConstruct(
veda_stack,
"alt-stac-api",
stage=veda_app_settings.stage_name(),
vpc=vpc.vpc,
database=database,
raster_api=raster_api,
Expand Down
36 changes: 31 additions & 5 deletions database/infrastructure/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Veda-backend database construct configuration."""
from typing import Optional

from aws_cdk import aws_ec2, aws_rds
from pydantic import BaseSettings, Field


Expand Down Expand Up @@ -57,12 +58,37 @@ class vedaDBSettings(BaseSettings):
False,
description="Boolean if the RDS should be accessed through a proxy",
)
rds_type: str = Field(
"t3.small",
description="Postgres database type",
rds_instance_class: Optional[str] = Field(
aws_ec2.InstanceClass.BURSTABLE3.value,
description=(
"The instance class of the RDS instance "
"https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/InstanceClass.html"
),
)
rds_instance_size: Optional[str] = Field(
aws_ec2.InstanceSize.SMALL.value,
description=(
"The size of the RDS instance "
"https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/InstanceSize.html"
),
)
rds_engine_full_version: Optional[str] = Field(
aws_rds.PostgresEngineVersion.VER_14.postgres_full_version,
description=(
"The version of the RDS Postgres engine "
"https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_rds/PostgresEngineVersion.html"
),
)
rds_engine_major_version: Optional[str] = Field(
aws_rds.PostgresEngineVersion.VER_14.postgres_major_version,
description=(
"The version of the RDS Postgres engine "
"https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_rds/PostgresEngineVersion.html"
),
)
storage_encrypted: bool = Field(
False, description="Boolean if the RDS should be storage encrypted"
rds_encryption: Optional[bool] = Field(
False,
description="Boolean if the RDS should be encrypted",
)

class Config:
Expand Down
27 changes: 18 additions & 9 deletions database/infrastructure/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,19 @@ def __init__(

# Custom parameter group
engine = aws_rds.DatabaseInstanceEngine.postgres(
version=aws_rds.PostgresEngineVersion.VER_14
version=aws_rds.PostgresEngineVersion.of(
veda_db_settings.rds_engine_full_version,
veda_db_settings.rds_engine_major_version,
)
)

# RDS Instance Type
rds_instance_type = aws_ec2.InstanceType.of(
aws_ec2.InstanceClass[veda_db_settings.rds_instance_class],
aws_ec2.InstanceSize[veda_db_settings.rds_instance_size],
)

# version=aws_rds.PostgresEngineVersion.postgres_major_version(veda_db_settings.rds_engine_version)
parameter_group = aws_rds.ParameterGroup(
self,
"parameter-group",
Expand All @@ -152,35 +163,33 @@ def __init__(
},
)

# Database Configurations
database_config = {
"id": "rds",
"instance_identifier": f"{stack_name}-postgres",
"vpc": vpc,
"engine": engine,
"instance_type": aws_ec2.InstanceType(
instance_type_identifier=veda_db_settings.rds_type
),
"instance_type": rds_instance_type,
"vpc_subnets": aws_ec2.SubnetSelection(subnet_type=subnet_type),
"deletion_protection": True,
"removal_policy": RemovalPolicy.RETAIN,
"publicly_accessible": veda_db_settings.publicly_accessible,
"parameter_group": parameter_group,
}

if storage_encrypted := veda_db_settings.storage_encrypted:
database_config["storage_encrypted"] = storage_encrypted
if veda_db_settings.rds_encryption:
database_config["storage_encrypted"] = veda_db_settings.rds_encryption

# Create a new database instance from snapshot if provided
if veda_db_settings.snapshot_id:
# For the database from snapshot we will need a new master secret
credentials = aws_rds.SnapshotCredentials.from_generated_secret(
snapshot_credentials = aws_rds.SnapshotCredentials.from_generated_secret(
username=veda_db_settings.admin_user
)

database = aws_rds.DatabaseInstanceFromSnapshot(
self,
snapshot_identifier=veda_db_settings.snapshot_id,
credentials=credentials,
credentials=snapshot_credentials,
**database_config,
)
# Or create/update RDS Resource
Expand Down
7 changes: 1 addition & 6 deletions database/runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ RUN echo "Using PGSTAC Version ${PGSTAC_VERSION}"

WORKDIR /tmp

COPY database/runtime/requirements.txt /tmp/requirements.txt

RUN pip install --upgrade pip
RUN pip install -r /tmp/requirements.txt -t /asset

RUN pip install pypgstac==${PGSTAC_VERSION} -t /asset
RUN pip install requests "urllib3<2" psycopg[binary,pool] pypgstac==${PGSTAC_VERSION} -t /asset

COPY database/runtime/handler.py /asset/handler.py

Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ services:
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
# API Config
- VEDA_RASTER_ENABLE_MOSAIC_SEARCH=TRUE
- VEDA_RASTER_EXPORT_ASSUME_ROLE_CREDS_AS_ENVS=TRUE


depends_on:
- database
Expand All @@ -95,7 +97,7 @@ services:
database:
container_name: veda.db
platform: linux/amd64
image: ghcr.io/stac-utils/pgstac:v0.7.9
image: ghcr.io/stac-utils/pgstac:v0.7.10
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
Expand Down
25 changes: 0 additions & 25 deletions docs/advanced_configuration.md

This file was deleted.

Loading

0 comments on commit 1133e0e

Please sign in to comment.