diff --git a/README.md b/README.md index 2823936..f251be9 100644 --- a/README.md +++ b/README.md @@ -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 | @@ -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 | diff --git a/_variables.tf b/_variables.tf index abbd99a..482609c 100644 --- a/_variables.tf +++ b/_variables.tf @@ -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." } \ No newline at end of file diff --git a/aurora.tf b/aurora.tf index 27830d9..8bdf3e2 100644 --- a/aurora.tf +++ b/aurora.tf @@ -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" {