Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a config parameter for db instance size #130

Merged
merged 1 commit into from
Aug 24, 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
3 changes: 3 additions & 0 deletions docs/src/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ The example commands here will deploy a CloudFormation stack called `eoAPI-stagi

Set environment variable or hard code in `infrastructure/aws/.env` file (e.g `CDK_EOAPI_DB_PGSTAC_VERSION=0.7.1`).

To modify the size of the burstable database instance, modify `CDK_EOAPI_DB_INSTANCE_SIZE` to one of the values of [`aws_cdk.aws_ec2.InstanceSize`](https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/InstanceSize.html#instancesize).
The default size is `SMALL`.

**Important**:

- `CDK_EOAPI_DB_PGSTAC_VERSION` is a required env (see https://github.com/stac-utils/pgstac/tags for the latest version)
Expand Down
3 changes: 2 additions & 1 deletion infrastructure/aws/cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def __init__( # noqa: C901
vpc=vpc,
engine=rds.DatabaseInstanceEngine.POSTGRES,
instance_type=ec2.InstanceType.of(
ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL
ec2.InstanceClass.BURSTABLE3,
ec2.InstanceSize(eodb_settings.instance_size),
),
database_name="postgres",
vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC),
Expand Down
1 change: 1 addition & 0 deletions infrastructure/aws/cdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class eoDBSettings(pydantic.BaseSettings):

# Define PGSTAC VERSION
pgstac_version: str
instance_size: str = "SMALL"
context: bool = True
mosaic_index: bool = True

Expand Down