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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support rds cluster serverless v2 #3022

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion infracost-usage-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ resource_usage:

aws_rds_cluster_instance.my_cluster:
monthly_cpu_credit_hrs: 24 # Number of hours in a month, where you expect to burst the baseline credit balance of a "t3" instance type.
vcpu_count: 2 # # (DEPRECATED this is now calculated automatically) Number of virtual CPUs allocated to your "t3" instance type. Currently instances with 2 vCPUs are available.
vcpu_count: 2 # Number of virtual CPUs allocated to your "t3" instance type. Currently instances with 2 vCPUs are available.
monthly_additional_performance_insights_requests: 10000 # Monthly Performance Insights API requests above the 1000000 requests included in the free tier.
reserved_instance_term: 1_year # Term for Reserved Instances, can be: 1_year, 3_year.
reserved_instance_payment_option: partial_upfront # Payment option for Reserved Instances, can be: no_upfront (only for 1_year term), partial_upfront, all_upfront.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,26 @@ resource "aws_rds_cluster_instance" "extended_support" {
engine_version = each.value.version
instance_class = "db.t3.large"
}

resource "aws_rds_cluster" "serverless_v2" {
cluster_identifier = "serverless-v2"
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = "13.6"
database_name = "test"
master_username = "test"
master_password = "must_be_eight_characters"
storage_encrypted = true

serverlessv2_scaling_configuration {
max_capacity = 1.0
min_capacity = 0.5
}
}

resource "aws_rds_cluster_instance" "serverless_v2_instance" {
cluster_identifier = aws_rds_cluster.serverless_v2.id
instance_class = "db.serverless"
engine = aws_rds_cluster.serverless_v2.engine
engine_version = aws_rds_cluster.serverless_v2.engine_version
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ resource_usage:
aws_rds_cluster_instance.cluster_instance_3yr_all_upfront:
reserved_instance_term: 3_year
reserved_instance_payment_option: all_upfront
aws_rds_cluster_instance.serverless_v2_instance:
vcpu_count: 2
2 changes: 1 addition & 1 deletion internal/resources/aws/rds_cluster_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (r *RDSClusterInstance) BuildResource() *schema.Resource {
// VCPU count has been set explicitly
instanceVCPUCount = decimal.NewFromInt(*r.VCPUCount)
} else if count, ok := InstanceTypeToVCPU[strings.TrimPrefix(r.InstanceClass, "db.")]; ok {
// We were able to lookup thing VCPU count
// We were able to lookup the VCPU count
instanceVCPUCount = decimal.NewFromInt(count)
}

Expand Down