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

Merge to main #19

Merged
merged 5 commits into from
Aug 4, 2023
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
2 changes: 2 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ VEDA_DB_PUBLICLY_ACCESSIBLE=TRUE

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_RDS_TYPE=[OPTIONAL RDS database type]
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:

predeploy:
needs: [test]
environment: development
runs-on: ubuntu-latest
steps:

Expand Down
4 changes: 4 additions & 0 deletions database/infrastructure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class vedaDBSettings(BaseSettings):
False,
description="Boolean if the RDS should be accessed through a proxy",
)
rds_type: str = Field(
"db.t3.small",
description="Postgres database type",
)

class Config:
"""model config."""
Expand Down
5 changes: 2 additions & 3 deletions database/infrastructure/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def __init__(
instance_identifier=f"{stack_name}-postgres",
vpc=vpc,
engine=engine,
instance_type=aws_ec2.InstanceType.of(
aws_ec2.InstanceClass.BURSTABLE3, aws_ec2.InstanceSize.SMALL
instance_type=aws_ec2.InstanceType(
instance_type_identifier=veda_db_settings.rds_type
),
vpc_subnets=aws_ec2.SubnetSelection(subnet_type=subnet_type),
deletion_protection=True,
Expand All @@ -176,7 +176,6 @@ def __init__(
credentials=credentials,
parameter_group=parameter_group,
)

# Or create/update RDS Resource
else:
database = aws_rds.DatabaseInstance(
Expand Down
2 changes: 1 addition & 1 deletion database/runtime/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def create_dashboard_schema(cursor, username: str) -> None:
sql.SQL(
"CREATE SCHEMA IF NOT EXISTS dashboard;"
"GRANT ALL ON SCHEMA dashboard TO {username};"
"ALTER ROLE {username} SET SEARCH_PATH TO dashboard, pgstac, public;"
"ALTER ROLE {username} SET SEARCH_PATH TO pgstac, dashboard, public;"
).format(username=sql.Identifier(username))
)

Expand Down
Loading