From 3f73565f673d38bffac3c339f436782cd79f01fb Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:37:11 -0400 Subject: [PATCH] feat: Support `skip_destroy` for option and param groups and add `upgrade_storage_config` for replicas (#559) * support skip_destroy and upgrade_storage_config * default null * fix: Use `null` for optional arguments --------- Co-authored-by: Bryant Biggs --- .pre-commit-config.yaml | 4 ++-- README.md | 5 ++++- examples/blue-green-deployment/README.md | 4 ++-- examples/blue-green-deployment/versions.tf | 2 +- examples/complete-mssql/README.md | 4 ++-- examples/complete-mssql/versions.tf | 2 +- examples/complete-mysql/README.md | 4 ++-- examples/complete-mysql/versions.tf | 2 +- examples/complete-oracle/README.md | 4 ++-- examples/complete-oracle/versions.tf | 2 +- examples/complete-postgres/README.md | 4 ++-- examples/complete-postgres/versions.tf | 2 +- .../cross-region-replica-postgres/README.md | 4 ++-- .../cross-region-replica-postgres/versions.tf | 2 +- examples/enhanced-monitoring/README.md | 4 ++-- examples/enhanced-monitoring/versions.tf | 2 +- examples/groups/README.md | 2 +- examples/groups/versions.tf | 2 +- examples/replica-mysql/README.md | 4 ++-- examples/replica-mysql/versions.tf | 2 +- examples/replica-postgres/README.md | 4 ++-- examples/replica-postgres/versions.tf | 2 +- examples/role-association-postgres/README.md | 4 ++-- .../role-association-postgres/versions.tf | 2 +- examples/s3-import-mysql/README.md | 4 ++-- examples/s3-import-mysql/versions.tf | 2 +- main.tf | 21 +++++++++++-------- modules/db_instance/README.md | 5 +++-- modules/db_instance/main.tf | 15 ++++++------- modules/db_instance/variables.tf | 6 ++++++ modules/db_instance/versions.tf | 2 +- .../versions.tf | 2 +- .../db_instance_role_association/README.md | 4 ++-- .../db_instance_role_association/versions.tf | 2 +- modules/db_option_group/README.md | 5 +++-- modules/db_option_group/main.tf | 2 ++ modules/db_option_group/variables.tf | 6 ++++++ modules/db_option_group/versions.tf | 2 +- modules/db_parameter_group/README.md | 5 +++-- modules/db_parameter_group/main.tf | 2 ++ modules/db_parameter_group/variables.tf | 6 ++++++ modules/db_parameter_group/versions.tf | 2 +- variables.tf | 18 ++++++++++++++++ versions.tf | 2 +- 44 files changed, 118 insertions(+), 68 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c67ffe84..131bd1a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.88.2 + rev: v1.92.2 hooks: - id: terraform_fmt - id: terraform_docs @@ -23,7 +23,7 @@ repos: - '--args=--only=terraform_workspace_remote' - id: terraform_validate - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer diff --git a/README.md b/README.md index e70f0be6..ce209478 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ Users have the ability to: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers @@ -308,11 +308,13 @@ No resources. | [network\_type](#input\_network\_type) | The type of network stack to use | `string` | `null` | no | | [option\_group\_description](#input\_option\_group\_description) | The description of the option group | `string` | `null` | no | | [option\_group\_name](#input\_option\_group\_name) | Name of the option group | `string` | `null` | no | +| [option\_group\_skip\_destroy](#input\_option\_group\_skip\_destroy) | Set to true if you do not wish the option group to be deleted at destroy time, and instead just remove the option group from the Terraform state | `bool` | `null` | no | | [option\_group\_timeouts](#input\_option\_group\_timeouts) | Define maximum timeout for deletion of `aws_db_option_group` resource | `map(string)` | `{}` | no | | [option\_group\_use\_name\_prefix](#input\_option\_group\_use\_name\_prefix) | Determines whether to use `option_group_name` as is or create a unique name beginning with the `option_group_name` as the prefix | `bool` | `true` | no | | [options](#input\_options) | A list of Options to apply | `any` | `[]` | no | | [parameter\_group\_description](#input\_parameter\_group\_description) | Description of the DB parameter group to create | `string` | `null` | no | | [parameter\_group\_name](#input\_parameter\_group\_name) | Name of the DB parameter group to associate or create | `string` | `null` | no | +| [parameter\_group\_skip\_destroy](#input\_parameter\_group\_skip\_destroy) | Set to true if you do not wish the parameter group to be deleted at destroy time, and instead just remove the parameter group from the Terraform state | `bool` | `null` | no | | [parameter\_group\_use\_name\_prefix](#input\_parameter\_group\_use\_name\_prefix) | Determines whether to use `parameter_group_name` as is or create a unique name beginning with the `parameter_group_name` as the prefix | `bool` | `true` | no | | [parameters](#input\_parameters) | A list of DB parameters (map) to apply | `list(map(string))` | `[]` | no | | [password](#input\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file.
The password provided will not be used if `manage_master_user_password` is set to true. | `string` | `null` | no | @@ -335,6 +337,7 @@ No resources. | [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no | | [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no | | [timezone](#input\_timezone) | Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information | `string` | `null` | no | +| [upgrade\_storage\_config](#input\_upgrade\_storage\_config) | Whether to upgrade the storage file system configuration on the read replica. Can only be set with replicate\_source\_db. | `bool` | `null` | no | | [username](#input\_username) | Username for the master DB user | `string` | `null` | no | | [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security groups to associate | `list(string)` | `[]` | no | diff --git a/examples/blue-green-deployment/README.md b/examples/blue-green-deployment/README.md index 741496eb..0f73e77e 100644 --- a/examples/blue-green-deployment/README.md +++ b/examples/blue-green-deployment/README.md @@ -27,13 +27,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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/blue-green-deployment/versions.tf b/examples/blue-green-deployment/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/blue-green-deployment/versions.tf +++ b/examples/blue-green-deployment/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/complete-mssql/README.md b/examples/complete-mssql/README.md index ddc2a408..4919337f 100644 --- a/examples/complete-mssql/README.md +++ b/examples/complete-mssql/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/complete-mssql/versions.tf b/examples/complete-mssql/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/complete-mssql/versions.tf +++ b/examples/complete-mssql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/complete-mysql/README.md b/examples/complete-mysql/README.md index 4714e26a..25c6c12a 100644 --- a/examples/complete-mysql/README.md +++ b/examples/complete-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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/complete-mysql/versions.tf b/examples/complete-mysql/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/complete-mysql/versions.tf +++ b/examples/complete-mysql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/complete-oracle/README.md b/examples/complete-oracle/README.md index 1df6f4c9..c9465179 100644 --- a/examples/complete-oracle/README.md +++ b/examples/complete-oracle/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/complete-oracle/versions.tf b/examples/complete-oracle/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/complete-oracle/versions.tf +++ b/examples/complete-oracle/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/complete-postgres/README.md b/examples/complete-postgres/README.md index eb7588b0..8190933b 100644 --- a/examples/complete-postgres/README.md +++ b/examples/complete-postgres/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/complete-postgres/versions.tf b/examples/complete-postgres/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/complete-postgres/versions.tf +++ b/examples/complete-postgres/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/cross-region-replica-postgres/README.md b/examples/cross-region-replica-postgres/README.md index 85488b9e..5897457c 100644 --- a/examples/cross-region-replica-postgres/README.md +++ b/examples/cross-region-replica-postgres/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/cross-region-replica-postgres/versions.tf b/examples/cross-region-replica-postgres/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/cross-region-replica-postgres/versions.tf +++ b/examples/cross-region-replica-postgres/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/enhanced-monitoring/README.md b/examples/enhanced-monitoring/README.md index b496d777..ee369fd3 100644 --- a/examples/enhanced-monitoring/README.md +++ b/examples/enhanced-monitoring/README.md @@ -22,13 +22,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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/enhanced-monitoring/versions.tf b/examples/enhanced-monitoring/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/enhanced-monitoring/versions.tf +++ b/examples/enhanced-monitoring/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/groups/README.md b/examples/groups/README.md index 604d6668..9e9d7983 100644 --- a/examples/groups/README.md +++ b/examples/groups/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers diff --git a/examples/groups/versions.tf b/examples/groups/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/groups/versions.tf +++ b/examples/groups/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/replica-mysql/README.md b/examples/replica-mysql/README.md index 6ab0aadb..cb017b0b 100644 --- a/examples/replica-mysql/README.md +++ b/examples/replica-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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/replica-mysql/versions.tf b/examples/replica-mysql/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/replica-mysql/versions.tf +++ b/examples/replica-mysql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/replica-postgres/README.md b/examples/replica-postgres/README.md index beb32e5f..45d226a7 100644 --- a/examples/replica-postgres/README.md +++ b/examples/replica-postgres/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/replica-postgres/versions.tf b/examples/replica-postgres/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/replica-postgres/versions.tf +++ b/examples/replica-postgres/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/role-association-postgres/README.md b/examples/role-association-postgres/README.md index 3bccb098..6df22793 100644 --- a/examples/role-association-postgres/README.md +++ b/examples/role-association-postgres/README.md @@ -10,13 +10,13 @@ Further database configurations for creating extension and invoking from postgre | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/role-association-postgres/versions.tf b/examples/role-association-postgres/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/role-association-postgres/versions.tf +++ b/examples/role-association-postgres/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/examples/s3-import-mysql/README.md b/examples/s3-import-mysql/README.md index ea5c284c..8d3cc24b 100644 --- a/examples/s3-import-mysql/README.md +++ b/examples/s3-import-mysql/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.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/examples/s3-import-mysql/versions.tf b/examples/s3-import-mysql/versions.tf index 7ea01589..53040bf6 100644 --- a/examples/s3-import-mysql/versions.tf +++ b/examples/s3-import-mysql/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/main.tf b/main.tf index 2687bf08..b9897a98 100644 --- a/main.tf +++ b/main.tf @@ -33,7 +33,8 @@ module "db_parameter_group" { description = var.parameter_group_description family = var.family - parameters = var.parameters + parameters = var.parameters + skip_destroy = var.parameter_group_skip_destroy tags = merge(var.tags, var.db_parameter_group_tags) } @@ -49,7 +50,8 @@ module "db_option_group" { engine_name = var.engine major_engine_version = var.major_engine_version - options = var.options + options = var.options + skip_destroy = var.option_group_skip_destroy timeouts = var.option_group_timeouts @@ -100,13 +102,14 @@ module "db_instance" { option_group_name = var.engine != "postgres" ? local.option_group : null network_type = var.network_type - availability_zone = var.availability_zone - multi_az = var.multi_az - iops = var.iops - storage_throughput = var.storage_throughput - publicly_accessible = var.publicly_accessible - ca_cert_identifier = var.ca_cert_identifier - dedicated_log_volume = var.dedicated_log_volume + availability_zone = var.availability_zone + multi_az = var.multi_az + iops = var.iops + storage_throughput = var.storage_throughput + publicly_accessible = var.publicly_accessible + ca_cert_identifier = var.ca_cert_identifier + dedicated_log_volume = var.dedicated_log_volume + upgrade_storage_config = var.upgrade_storage_config allow_major_version_upgrade = var.allow_major_version_upgrade auto_minor_version_upgrade = var.auto_minor_version_upgrade diff --git a/modules/db_instance/README.md b/modules/db_instance/README.md index 6f2b8549..78815666 100644 --- a/modules/db_instance/README.md +++ b/modules/db_instance/README.md @@ -6,14 +6,14 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | | [random](#requirement\_random) | >= 3.1 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | | [random](#provider\_random) | >= 3.1 | ## Modules @@ -117,6 +117,7 @@ No modules. | [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no | | [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no | | [timezone](#input\_timezone) | Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information. | `string` | `null` | no | +| [upgrade\_storage\_config](#input\_upgrade\_storage\_config) | Whether to upgrade the storage file system configuration on the read replica. Can only be set with replicate\_source\_db. | `bool` | `null` | no | | [use\_identifier\_prefix](#input\_use\_identifier\_prefix) | Determines whether to use `identifier` as is or create a unique identifier beginning with `identifier` as the specified prefix | `bool` | `false` | no | | [username](#input\_username) | Username for the master DB user | `string` | `null` | no | | [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security groups to associate | `list(string)` | `[]` | no | diff --git a/modules/db_instance/main.tf b/modules/db_instance/main.tf index d19d41e1..e503722d 100644 --- a/modules/db_instance/main.tf +++ b/modules/db_instance/main.tf @@ -63,13 +63,14 @@ resource "aws_db_instance" "this" { option_group_name = var.option_group_name network_type = var.network_type - availability_zone = var.availability_zone - multi_az = var.multi_az - iops = var.iops - storage_throughput = var.storage_throughput - publicly_accessible = var.publicly_accessible - ca_cert_identifier = var.ca_cert_identifier - dedicated_log_volume = var.dedicated_log_volume + availability_zone = var.availability_zone + multi_az = var.multi_az + iops = var.iops + storage_throughput = var.storage_throughput + publicly_accessible = var.publicly_accessible + ca_cert_identifier = var.ca_cert_identifier + dedicated_log_volume = var.dedicated_log_volume + upgrade_storage_config = var.upgrade_storage_config allow_major_version_upgrade = var.allow_major_version_upgrade auto_minor_version_upgrade = var.auto_minor_version_upgrade diff --git a/modules/db_instance/variables.tf b/modules/db_instance/variables.tf index 9338d21f..9975bad1 100644 --- a/modules/db_instance/variables.tf +++ b/modules/db_instance/variables.tf @@ -438,6 +438,12 @@ variable "dedicated_log_volume" { default = false } +variable "upgrade_storage_config" { + description = "Whether to upgrade the storage file system configuration on the read replica. Can only be set with replicate_source_db." + type = bool + default = null +} + ################################################################################ # CloudWatch Log Group ################################################################################ diff --git a/modules/db_instance/versions.tf b/modules/db_instance/versions.tf index bbc916c8..7c522cc9 100644 --- a/modules/db_instance/versions.tf +++ b/modules/db_instance/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } random = { diff --git a/modules/db_instance_automated_backups_replication/versions.tf b/modules/db_instance_automated_backups_replication/versions.tf index 7ea01589..53040bf6 100644 --- a/modules/db_instance_automated_backups_replication/versions.tf +++ b/modules/db_instance_automated_backups_replication/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/modules/db_instance_role_association/README.md b/modules/db_instance_role_association/README.md index a111587e..8669de3c 100644 --- a/modules/db_instance_role_association/README.md +++ b/modules/db_instance_role_association/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules diff --git a/modules/db_instance_role_association/versions.tf b/modules/db_instance_role_association/versions.tf index 7ea01589..53040bf6 100644 --- a/modules/db_instance_role_association/versions.tf +++ b/modules/db_instance_role_association/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/modules/db_option_group/README.md b/modules/db_option_group/README.md index 2121e328..e216be06 100644 --- a/modules/db_option_group/README.md +++ b/modules/db_option_group/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules @@ -34,6 +34,7 @@ No modules. | [name](#input\_name) | The name of the option group | `string` | `""` | no | | [option\_group\_description](#input\_option\_group\_description) | The description of the option group | `string` | `null` | no | | [options](#input\_options) | A list of Options to apply | `any` | `[]` | no | +| [skip\_destroy](#input\_skip\_destroy) | Set to true if you do not wish the option group to be deleted at destroy time, and instead just remove the option group from the Terraform state | `bool` | `null` | no | | [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | | [timeouts](#input\_timeouts) | Define maximum timeout for deletion of `aws_db_option_group` resource | `map(string)` | `{}` | no | | [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix | `bool` | `true` | no | diff --git a/modules/db_option_group/main.tf b/modules/db_option_group/main.tf index 6ae35840..88fa554b 100644 --- a/modules/db_option_group/main.tf +++ b/modules/db_option_group/main.tf @@ -33,6 +33,8 @@ resource "aws_db_option_group" "this" { } } + skip_destroy = var.skip_destroy + tags = merge( var.tags, { diff --git a/modules/db_option_group/variables.tf b/modules/db_option_group/variables.tf index de4be194..e990529b 100644 --- a/modules/db_option_group/variables.tf +++ b/modules/db_option_group/variables.tf @@ -40,6 +40,12 @@ variable "options" { default = [] } +variable "skip_destroy" { + description = "Set to true if you do not wish the option group to be deleted at destroy time, and instead just remove the option group from the Terraform state" + type = bool + default = null +} + variable "timeouts" { description = "Define maximum timeout for deletion of `aws_db_option_group` resource" type = map(string) diff --git a/modules/db_option_group/versions.tf b/modules/db_option_group/versions.tf index 7ea01589..53040bf6 100644 --- a/modules/db_option_group/versions.tf +++ b/modules/db_option_group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/modules/db_parameter_group/README.md b/modules/db_parameter_group/README.md index 01e60281..2e006eb5 100644 --- a/modules/db_parameter_group/README.md +++ b/modules/db_parameter_group/README.md @@ -6,13 +6,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.59 | +| [aws](#requirement\_aws) | >= 5.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.59 | +| [aws](#provider\_aws) | >= 5.62 | ## Modules @@ -33,6 +33,7 @@ No modules. | [family](#input\_family) | The family of the DB parameter group | `string` | `null` | no | | [name](#input\_name) | The name of the DB parameter group | `string` | `""` | no | | [parameters](#input\_parameters) | A list of DB parameter maps to apply | `list(map(string))` | `[]` | no | +| [skip\_destroy](#input\_skip\_destroy) | Set to true if you do not wish the parameter group to be deleted at destroy time, and instead just remove the parameter group from the Terraform state | `bool` | `null` | no | | [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | | [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether to use `name` as is or create a unique name beginning with `name` as the specified prefix | `bool` | `true` | no | diff --git a/modules/db_parameter_group/main.tf b/modules/db_parameter_group/main.tf index 94acbe5e..19ce380c 100644 --- a/modules/db_parameter_group/main.tf +++ b/modules/db_parameter_group/main.tf @@ -22,6 +22,8 @@ resource "aws_db_parameter_group" "this" { } } + skip_destroy = var.skip_destroy + tags = merge( var.tags, { diff --git a/modules/db_parameter_group/variables.tf b/modules/db_parameter_group/variables.tf index b7b7af9f..702a11f9 100644 --- a/modules/db_parameter_group/variables.tf +++ b/modules/db_parameter_group/variables.tf @@ -34,6 +34,12 @@ variable "parameters" { default = [] } +variable "skip_destroy" { + description = "Set to true if you do not wish the parameter group to be deleted at destroy time, and instead just remove the parameter group from the Terraform state" + type = bool + default = null +} + variable "tags" { description = "A mapping of tags to assign to the resource" type = map(string) diff --git a/modules/db_parameter_group/versions.tf b/modules/db_parameter_group/versions.tf index 7ea01589..53040bf6 100644 --- a/modules/db_parameter_group/versions.tf +++ b/modules/db_parameter_group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } } diff --git a/variables.tf b/variables.tf index 39b6350a..76475c31 100644 --- a/variables.tf +++ b/variables.tf @@ -426,6 +426,12 @@ variable "parameters" { default = [] } +variable "parameter_group_skip_destroy" { + description = "Set to true if you do not wish the parameter group to be deleted at destroy time, and instead just remove the parameter group from the Terraform state" + type = bool + default = null +} + # DB option group variable "create_db_option_group" { description = "Create a database option group" @@ -463,6 +469,12 @@ variable "options" { default = [] } +variable "option_group_skip_destroy" { + description = "Set to true if you do not wish the option group to be deleted at destroy time, and instead just remove the option group from the Terraform state" + type = bool + default = null +} + variable "create_db_instance" { description = "Whether to create a database instance" type = bool @@ -553,6 +565,12 @@ variable "network_type" { default = null } +variable "upgrade_storage_config" { + description = "Whether to upgrade the storage file system configuration on the read replica. Can only be set with replicate_source_db." + type = bool + default = null +} + ################################################################################ # CloudWatch Log Group ################################################################################ diff --git a/versions.tf b/versions.tf index 7ea01589..53040bf6 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.59" + version = ">= 5.62" } } }