From 8c6039e9e0cf4d357b7f2af72c6551e5239e9f76 Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:54:12 -0400 Subject: [PATCH] feat: Support for `enable_local_write_forwarding` (#441) --- README.md | 5 +++-- 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/versions.tf | 2 +- main.tf | 1 + variables.tf | 6 ++++++ versions.tf | 2 +- 18 files changed, 33 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a8ba29d..a3a27aa 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.37 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.37 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules @@ -316,6 +316,7 @@ No modules. | [domain\_iam\_role\_name](#input\_domain\_iam\_role\_name) | (Required if domain is provided) The name of the IAM role to be used when making API calls to the Directory Service | `string` | `null` | no | | [enable\_global\_write\_forwarding](#input\_enable\_global\_write\_forwarding) | Whether cluster should forward writes to an associated global cluster. Applied to secondary clusters to enable them to forward writes to an `aws_rds_global_cluster`'s primary cluster | `bool` | `null` | no | | [enable\_http\_endpoint](#input\_enable\_http\_endpoint) | Enable HTTP endpoint (data API). Only valid when engine\_mode is set to `serverless` | `bool` | `null` | no | +| [enable\_local\_write\_forwarding](#input\_enable\_local\_write\_forwarding) | Whether read replicas can forward write operations to the writer DB instance in the DB cluster. By default, write operations aren't allowed on reader DB instances. | `bool` | `null` | no | | [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` | `list(string)` | `[]` | no | | [endpoints](#input\_endpoints) | Map of additional cluster endpoints and their attributes to be created | `any` | `{}` | no | | [engine](#input\_engine) | The name of the database engine to be used for this DB cluster. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql` | `string` | `null` | no | diff --git a/examples/autoscaling/README.md b/examples/autoscaling/README.md index 6736ff8..0520010 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules diff --git a/examples/autoscaling/versions.tf b/examples/autoscaling/versions.tf index 34a8016..4cda07e 100644 --- a/examples/autoscaling/versions.tf +++ b/examples/autoscaling/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.26" + version = ">= 5.42" } } } diff --git a/examples/global-cluster/README.md b/examples/global-cluster/README.md index c6fcc87..4e81f24 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | | [random](#requirement\_random) | >= 2.2 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | -| [aws.secondary](#provider\_aws.secondary) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | +| [aws.secondary](#provider\_aws.secondary) | >= 5.42 | | [random](#provider\_random) | >= 2.2 | ## Modules diff --git a/examples/global-cluster/versions.tf b/examples/global-cluster/versions.tf index 51e007d..954c03a 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.26" + version = ">= 5.42" } random = { diff --git a/examples/multi-az/README.md b/examples/multi-az/README.md index 2d03c4e..83f95e4 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules diff --git a/examples/multi-az/versions.tf b/examples/multi-az/versions.tf index 34a8016..4cda07e 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.26" + version = ">= 5.42" } } } diff --git a/examples/mysql/README.md b/examples/mysql/README.md index b081cf0..0a14403 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules diff --git a/examples/mysql/versions.tf b/examples/mysql/versions.tf index 34a8016..4cda07e 100644 --- a/examples/mysql/versions.tf +++ b/examples/mysql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.26" + version = ">= 5.42" } } } diff --git a/examples/postgresql/README.md b/examples/postgresql/README.md index 1c41ad6..5708aca 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules diff --git a/examples/postgresql/versions.tf b/examples/postgresql/versions.tf index 34a8016..4cda07e 100644 --- a/examples/postgresql/versions.tf +++ b/examples/postgresql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.26" + version = ">= 5.42" } } } diff --git a/examples/s3-import/README.md b/examples/s3-import/README.md index e451984..3582f9b 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | ## Modules diff --git a/examples/s3-import/versions.tf b/examples/s3-import/versions.tf index 34a8016..4cda07e 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.26" + version = ">= 5.42" } } } diff --git a/examples/serverless/README.md b/examples/serverless/README.md index 70d1788..b3a6ba1 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.26 | +| [aws](#requirement\_aws) | >= 5.42 | | [random](#requirement\_random) | >= 3.5 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26 | +| [aws](#provider\_aws) | >= 5.42 | | [random](#provider\_random) | >= 3.5 | ## Modules diff --git a/examples/serverless/versions.tf b/examples/serverless/versions.tf index 7f63c45..9f1d544 100644 --- a/examples/serverless/versions.tf +++ b/examples/serverless/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.26" + version = ">= 5.42" } random = { source = "hashicorp/random" diff --git a/main.tf b/main.tf index c1b6fda..6220a8b 100644 --- a/main.tf +++ b/main.tf @@ -57,6 +57,7 @@ resource "aws_rds_cluster" "this" { delete_automated_backups = var.delete_automated_backups deletion_protection = var.deletion_protection enable_global_write_forwarding = var.enable_global_write_forwarding + enable_local_write_forwarding = var.enable_local_write_forwarding enabled_cloudwatch_logs_exports = var.enabled_cloudwatch_logs_exports enable_http_endpoint = var.enable_http_endpoint engine = var.engine diff --git a/variables.tf b/variables.tf index 68d8cd8..0370658 100644 --- a/variables.tf +++ b/variables.tf @@ -138,6 +138,12 @@ variable "enable_global_write_forwarding" { default = null } +variable "enable_local_write_forwarding" { + description = "Whether read replicas can forward write operations to the writer DB instance in the DB cluster. By default, write operations aren't allowed on reader DB instances." + type = bool + default = null +} + variable "enabled_cloudwatch_logs_exports" { description = "Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql`" type = list(string) diff --git a/versions.tf b/versions.tf index 0b1e951..4cda07e 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.37" + version = ">= 5.42" } } }