From 08dced981559788559a3e69f288d51047aa64220 Mon Sep 17 00:00:00 2001
From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com>
Date: Thu, 19 Dec 2024 12:09:16 -0500
Subject: [PATCH] feat: Support
`serverlessv2_scaling_configuration.seconds_until_auto_pause` (#477)
* seconds_until_auto_pause
* revert
---
README.md | 4 ++--
examples/autoscaling/README.md | 4 ++--
examples/autoscaling/versions.tf | 2 +-
examples/global-cluster/README.md | 6 +++---
examples/global-cluster/versions.tf | 2 +-
examples/multi-az/README.md | 4 ++--
examples/multi-az/versions.tf | 2 +-
examples/mysql/README.md | 4 ++--
examples/mysql/versions.tf | 2 +-
examples/postgresql/README.md | 4 ++--
examples/postgresql/versions.tf | 2 +-
examples/s3-import/README.md | 4 ++--
examples/s3-import/versions.tf | 2 +-
examples/serverless/README.md | 4 ++--
examples/serverless/main.tf | 7 ++++---
examples/serverless/versions.tf | 2 +-
main.tf | 5 +++--
versions.tf | 2 +-
18 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/README.md b/README.md
index 8320160..af333a1 100644
--- a/README.md
+++ b/README.md
@@ -224,13 +224,13 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/autoscaling/README.md b/examples/autoscaling/README.md
index fe30dc9..673eae9 100644
--- a/examples/autoscaling/README.md
+++ b/examples/autoscaling/README.md
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/autoscaling/versions.tf b/examples/autoscaling/versions.tf
index 264f62f..4969d64 100644
--- a/examples/autoscaling/versions.tf
+++ b/examples/autoscaling/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}
diff --git a/examples/global-cluster/README.md b/examples/global-cluster/README.md
index 811f9e9..0f49a41 100644
--- a/examples/global-cluster/README.md
+++ b/examples/global-cluster/README.md
@@ -20,15 +20,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
| [random](#requirement\_random) | >= 2.2 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
-| [aws.secondary](#provider\_aws.secondary) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
+| [aws.secondary](#provider\_aws.secondary) | >= 5.81 |
| [random](#provider\_random) | >= 2.2 |
## Modules
diff --git a/examples/global-cluster/versions.tf b/examples/global-cluster/versions.tf
index f2a51a0..b4c052d 100644
--- a/examples/global-cluster/versions.tf
+++ b/examples/global-cluster/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
random = {
diff --git a/examples/multi-az/README.md b/examples/multi-az/README.md
index cba8c94..a8cf5a3 100644
--- a/examples/multi-az/README.md
+++ b/examples/multi-az/README.md
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/multi-az/versions.tf b/examples/multi-az/versions.tf
index 264f62f..4969d64 100644
--- a/examples/multi-az/versions.tf
+++ b/examples/multi-az/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}
diff --git a/examples/mysql/README.md b/examples/mysql/README.md
index a0329c5..5ef4789 100644
--- a/examples/mysql/README.md
+++ b/examples/mysql/README.md
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/mysql/versions.tf b/examples/mysql/versions.tf
index 264f62f..4969d64 100644
--- a/examples/mysql/versions.tf
+++ b/examples/mysql/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}
diff --git a/examples/postgresql/README.md b/examples/postgresql/README.md
index 5a0d1ee..c7ee6bf 100644
--- a/examples/postgresql/README.md
+++ b/examples/postgresql/README.md
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/postgresql/versions.tf b/examples/postgresql/versions.tf
index 264f62f..4969d64 100644
--- a/examples/postgresql/versions.tf
+++ b/examples/postgresql/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}
diff --git a/examples/s3-import/README.md b/examples/s3-import/README.md
index 7e7304b..8f65cf1 100644
--- a/examples/s3-import/README.md
+++ b/examples/s3-import/README.md
@@ -49,13 +49,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
## Modules
diff --git a/examples/s3-import/versions.tf b/examples/s3-import/versions.tf
index 264f62f..4969d64 100644
--- a/examples/s3-import/versions.tf
+++ b/examples/s3-import/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}
diff --git a/examples/serverless/README.md b/examples/serverless/README.md
index 5522317..9016a06 100644
--- a/examples/serverless/README.md
+++ b/examples/serverless/README.md
@@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0 |
-| [aws](#requirement\_aws) | >= 5.64 |
+| [aws](#requirement\_aws) | >= 5.81 |
| [random](#requirement\_random) | >= 3.5 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 5.64 |
+| [aws](#provider\_aws) | >= 5.81 |
| [random](#provider\_random) | >= 3.5 |
## Modules
diff --git a/examples/serverless/main.tf b/examples/serverless/main.tf
index f84d050..04ca33f 100644
--- a/examples/serverless/main.tf
+++ b/examples/serverless/main.tf
@@ -153,7 +153,7 @@ module "aurora_mysql_v2" {
data "aws_rds_engine_version" "postgresql" {
engine = "aurora-postgresql"
- version = "14.8"
+ version = "14.12"
}
module "aurora_postgresql_v2" {
@@ -182,8 +182,9 @@ module "aurora_postgresql_v2" {
enable_http_endpoint = true
serverlessv2_scaling_configuration = {
- min_capacity = 2
- max_capacity = 10
+ min_capacity = 0
+ max_capacity = 10
+ seconds_until_auto_pause = 3600
}
instance_class = "db.serverless"
diff --git a/examples/serverless/versions.tf b/examples/serverless/versions.tf
index a66be2a..d31e0c4 100644
--- a/examples/serverless/versions.tf
+++ b/examples/serverless/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
random = {
source = "hashicorp/random"
diff --git a/main.tf b/main.tf
index 364e1dc..1cb7442 100644
--- a/main.tf
+++ b/main.tf
@@ -127,8 +127,9 @@ resource "aws_rds_cluster" "this" {
for_each = length(var.serverlessv2_scaling_configuration) > 0 && var.engine_mode == "provisioned" ? [var.serverlessv2_scaling_configuration] : []
content {
- max_capacity = serverlessv2_scaling_configuration.value.max_capacity
- min_capacity = serverlessv2_scaling_configuration.value.min_capacity
+ max_capacity = serverlessv2_scaling_configuration.value.max_capacity
+ min_capacity = serverlessv2_scaling_configuration.value.min_capacity
+ seconds_until_auto_pause = try(serverlessv2_scaling_configuration.value.seconds_until_auto_pause, null)
}
}
diff --git a/versions.tf b/versions.tf
index 264f62f..4969d64 100644
--- a/versions.tf
+++ b/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 5.64"
+ version = ">= 5.81"
}
}
}