Skip to content

Commit

Permalink
revert!: "DBTP-958 Straighten up Postgres plans (#112)" (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillGibson authored May 23, 2024
1 parent 15abc7b commit 3df7ab9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 92 deletions.
2 changes: 1 addition & 1 deletion environment-pipelines/stage_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ apply:
provider: "CodeBuild"
input_artifacts: ["build_output", "terraform_plan"]
output_artifacts: []
version: "1"
version: "1"
101 changes: 30 additions & 71 deletions extensions/plans.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# t-shirt sizes for extensions that support configurable storage/CPU/etc. such as RDS, OpenSearch and ElastiCache Redis
# t-shirt sizes for addons that support configurable storage/cpu etc. such as RDS, Opensearch and Elasticache Redis

redis:
# 0.5GB RAM, single node, no failover.
Expand Down Expand Up @@ -126,11 +126,10 @@ opensearch:
instance: m6g.2xlarge.search

# RDS/Postgres Instances
# Aligned with the instance types from https://aws.amazon.com/rds/instance-types/
postgres:
# 2v CPU, 1GB RAM, 100GB Storage
# 2v CPU, 1GB RAM, 20GB Storage
tiny:
volume_size: 100
volume_size: 20
multi_az: false
instance: db.t3.micro

Expand All @@ -146,112 +145,72 @@ postgres:
multi_az: true
instance: db.t3.small

# 2v CPU, 2GB RAM, 100GB Storage, multi AZ, high IOPS
# 2v CPU, 2GB RAM, 100GB Storage, multi AZ
small-high-io:
volume_size: 100
multi_az: true
instance: db.t3.small
storage_type: io2
iops: 40000

# # 2v CPU, 4GB RAM, 100GB Storage
medium:
volume_size: 100
multi_az: false
instance: db.t3.medium

# # 2v CPU, 4GB RAM, 100GB Storage, multi AZ
medium-ha:
volume_size: 100
multi_az: true
instance: db.t3.medium

# 2v CPU, 4GB RAM, 100GB Storage, multi AZ, high IOPS
medium-high-io:
volume_size: 100
multi_az: true
instance: db.t3.medium
storage_type: io2
storage_type: io1
iops: 40000

# 2v CPU, 8GB RAM, 100GB Storage
large:
medium:
volume_size: 100
multi_az: false
instance: db.m5.large

# 2v CPU, 8GB RAM, 100GB Storage, multi AZ
large-ha:
medium-ha:
volume_size: 100
multi_az: true
instance: db.m5.large

# 2v CPU, 8GB RAM, 100GB Storage, multi AZ, high IOPS
large-high-io:
# 2v CPU, 8GB RAM, 100GB Storage, multi AZ
medium-high-io:
volume_size: 100
multi_az: true
instance: db.m5.large
storage_type: io2
storage_type: io1
iops: 40000

# 4v CPU, 16GB RAM, 100GB Storage
x-large:
volume_size: 100
multi_az: false
instance: db.m5.xlarge

# 4v CPU, 16GB RAM, 100GB Storage, multi AZ
x-large-ha:
volume_size: 100
multi_az: true
instance: db.m5.xlarge

# 4v CPU, 16GB RAM, 100GB Storage, multi AZ, high IOPS
x-large-high-io:
volume_size: 100
multi_az: true
instance: db.m5.xlarge
storage_type: io2
iops: 40000

# 8v CPU, 32GB RAM, 100GB Storage
2x-large:
volume_size: 100
# 8v CPU, 32GB RAM, 564GB Storage
large:
volume_size: 564
multi_az: false
instance: db.m5.2xlarge

# 8v CPU, 32GB RAM, 100GB Storage, multi AZ
2x-large-ha:
volume_size: 100
# 8v CPU, 32GB RAM, 564GB Storage, multi AZ
large-ha:
volume_size: 564
multi_az: true
instance: db.m5.2xlarge

# 8v CPU, 32GB RAM, 100GB Storage, multi AZ, high IOPS
2x-large-high-io:
volume_size: 100
# 8v CPU, 32GB RAM, 564GB Storage, multi AZ
large-high-io:
volume_size: 564
multi_az: true
instance: db.m5.2xlarge
storage_type: io2
storage_type: io1
iops: 40000

# 16v CPU, 64GB RAM, 100GB Storage
4x-large:
volume_size: 100
# 16v CPU, 64GB RAM, 2000GB Storage
x-large:
volume_size: 2000
multi_az: false
instance: db.m5.4xlarge

# 16v CPU, 64GB RAM, 100GB Storage, multi AZ
4x-large-ha:
volume_size: 100
# 16v CPU, 64GB RAM, 2000GB Storage, multi AZ
x-large-ha:
volume_size: 2000
multi_az: true
instance: db.m5.4xlarge

# 16v CPU, 64GB RAM, 100GB Storage, multi AZ, high IOPS
4x-large-high-io:
volume_size: 100
# 16v CPU, 64GB RAM, 2000GB Storage, multi AZ
x-large-high-io:
volume_size: 2000
multi_az: true
instance: db.m5.4xlarge
storage_type: io2
storage_type: io1
iops: 40000

s3: {}
Expand Down
2 changes: 0 additions & 2 deletions postgres/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ locals {
deletion_protection = coalesce(var.config.deletion_protection, true)

instance_class = coalesce(var.config.instance, "db.t3.micro")
storage_type = coalesce(var.config.storage_type, "gp3")
iops = var.config.iops != null && local.storage_type != "gp3" ? var.config.iops : null

secret_prefix = upper(replace(var.name, "-", "_"))
rds_master_secret_name = "${local.secret_prefix}_RDS_MASTER_ARN"
Expand Down
2 changes: 0 additions & 2 deletions postgres/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ resource "aws_db_instance" "default" {
allocated_storage = local.volume_size
storage_encrypted = true
kms_key_id = aws_kms_key.default.arn
storage_type = local.storage_type
iops = local.iops

parameter_group_name = aws_db_parameter_group.default.name
db_subnet_group_name = aws_db_subnet_group.default.name
Expand Down
16 changes: 0 additions & 16 deletions postgres/tests/unit.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@ run "aws_db_instance_unit_test" {
error_message = "Should be: mon:00:00-mon:03:00"
}

assert {
condition = aws_db_instance.default.storage_type == "gp3"
error_message = "Should be: gp3"
}

# aws_db_instance.default.iops cannot be tested on a plan
}

run "aws_db_instance_unit_test_set_to_non_defaults" {
Expand Down Expand Up @@ -312,21 +306,11 @@ run "aws_db_instance_unit_test_set_to_non_defaults" {
error_message = "Should be: 20"
}

assert {
condition = aws_db_instance.default.iops == 3000
error_message = "Should be: 20"
}

assert {
condition = aws_db_instance.default.instance_class == "db.t3.small"
error_message = "Should be: db.t3.small"
}

assert {
condition = aws_db_instance.default.storage_type == "io2"
error_message = "Should be: io2"
}

}

run "aws_iam_role_unit_test" {
Expand Down

0 comments on commit 3df7ab9

Please sign in to comment.