Skip to content
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
| maintenance\_window | (RDS Only) The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi'. Eg: 'Mon:00:00-Mon:03:00' | `string` | `"Sun:04:00-Sun:05:00"` | no |
| major\_engine\_version | Specifies the major version of the engine that this option group should be associated with | `string` | `""` | no |
| max\_allocated\_storage | Argument higher than the allocated\_storage to enable Storage Autoscaling, size in GB. 0 to disable Storage Autoscaling | `number` | `0` | no |
| max\_capacity | The maximum capacity of the RDS Serverless v2 cluster. | `number` | `128` | no |
| min\_capacity | The minimum capacity of the RDS Serverless v2 cluster. | `number` | `1` | no |
| monitoring\_interval | The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance | `number` | `0` | no |
| multi\_az | Deploy multi-az instance database | `bool` | `false` | no |
| name | Name of this RDS Database | `string` | n/a | yes |
Expand All @@ -81,6 +83,7 @@
| publicly\_accessible | (Optional) Bool to control if instance is publicly accessible | `bool` | `false` | no |
| publicly\_accessible\_replica | (Optional) Bool to control if instance is publicly accessible | `bool` | `false` | no |
| retention | Snapshot retention period in days | `number` | n/a | yes |
| seconds\_until\_auto\_pause | The amount of time in seconds after which the RDS Serverless v2 cluster should automatically pause with no connections. | `number` | `3600` | no |
| secret\_method | Use ssm for SSM parameters store which is the default option, or secretsmanager for AWS Secrets Manager | `string` | `"ssm"` | no |
| skip\_final\_snapshot | Skips the final snapshot if the database is destroyed programatically | `bool` | `false` | no |
| snapshot\_identifier | Pass a snapshot identifier for the database to be created from this snapshot | `string` | `""` | no |
Expand Down
18 changes: 18 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,22 @@ variable "tags" {
description = "A map of tags to assign to the RDS"
type = map(string)
default = {}
}

variable "max_capacity" {
type = number
default = 128
description = "The maximum capacity of the RDS Serverless v2 cluster."
}

variable "min_capacity" {
type = number
default = 1
description = "The minimum capacity of the RDS Serverless v2 cluster."
}

variable "seconds_until_auto_pause" {
type = number
default = 3600
description = "The amount of time in seconds after which the RDS Serverless v2 cluster should automatically pause with no connections."
}
6 changes: 6 additions & 0 deletions aurora.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ resource "aws_rds_cluster" "aurora_cluster" {
skip_final_snapshot = var.skip_final_snapshot
deletion_protection = var.deletion_protection

serverlessv2_scaling_configuration {
max_capacity = var.max_capacity
min_capacity = var.min_capacity
seconds_until_auto_pause = var.seconds_until_auto_pause
}

}

resource "aws_rds_cluster_instance" "cluster_instances" {
Expand Down