Skip to content

Commit a2d4582

Browse files
Merge pull request #130 from ncx-co/db-instance-size
add a config parameter for db instance size
2 parents 7f9ee49 + 4902447 commit a2d4582

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

docs/src/deployment.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ The example commands here will deploy a CloudFormation stack called `eoAPI-stagi
4040

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

43+
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).
44+
The default size is `SMALL`.
45+
4346
**Important**:
4447

4548
- `CDK_EOAPI_DB_PGSTAC_VERSION` is a required env (see https://github.com/stac-utils/pgstac/tags for the latest version)

infrastructure/aws/cdk/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def __init__( # noqa: C901
160160
vpc=vpc,
161161
engine=rds.DatabaseInstanceEngine.POSTGRES,
162162
instance_type=ec2.InstanceType.of(
163-
ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL
163+
ec2.InstanceClass.BURSTABLE3,
164+
ec2.InstanceSize(eodb_settings.instance_size),
164165
),
165166
database_name="postgres",
166167
vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC),

infrastructure/aws/cdk/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class eoDBSettings(pydantic.BaseSettings):
3939

4040
# Define PGSTAC VERSION
4141
pgstac_version: str
42+
instance_size: str = "SMALL"
4243
context: bool = True
4344
mosaic_index: bool = True
4445

0 commit comments

Comments
 (0)