Skip to content

Commit

Permalink
feat: Support `serverlessv2_scaling_configuration.seconds_until_auto_…
Browse files Browse the repository at this point in the history
…pause` (#477)

* seconds_until_auto_pause

* revert
  • Loading branch information
magreenbaum authored Dec 19, 2024
1 parent e6b5d79 commit 08dced9
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ Terraform documentation is generated automatically using [pre-commit hooks](http
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/autoscaling/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}
6 changes: 3 additions & 3 deletions examples/global-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.2 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws.secondary"></a> [aws.secondary](#provider\_aws.secondary) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |
| <a name="provider_aws.secondary"></a> [aws.secondary](#provider\_aws.secondary) | >= 5.81 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.2 |

## Modules
Expand Down
2 changes: 1 addition & 1 deletion examples/global-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}

random = {
Expand Down
4 changes: 2 additions & 2 deletions examples/multi-az/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/multi-az/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}
4 changes: 2 additions & 2 deletions examples/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/mysql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}
4 changes: 2 additions & 2 deletions examples/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}
4 changes: 2 additions & 2 deletions examples/s3-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/s3-import/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}
4 changes: 2 additions & 2 deletions examples/serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.64 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.81 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.5 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.64 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.81 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.5 |

## Modules
Expand Down
7 changes: 4 additions & 3 deletions examples/serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/serverless/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
random = {
source = "hashicorp/random"
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.64"
version = ">= 5.81"
}
}
}

0 comments on commit 08dced9

Please sign in to comment.