Skip to content

Commit 3f73565

Browse files
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 <[email protected]>
1 parent a4ae4a5 commit 3f73565

File tree

44 files changed

+118
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+118
-68
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.88.2
3+
rev: v1.92.2
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_workspace_remote'
2424
- id: terraform_validate
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.5.0
26+
rev: v4.6.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Users have the ability to:
210210
| Name | Version |
211211
|------|---------|
212212
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
213-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
213+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
214214

215215
## Providers
216216

@@ -308,11 +308,13 @@ No resources.
308308
| <a name="input_network_type"></a> [network\_type](#input\_network\_type) | The type of network stack to use | `string` | `null` | no |
309309
| <a name="input_option_group_description"></a> [option\_group\_description](#input\_option\_group\_description) | The description of the option group | `string` | `null` | no |
310310
| <a name="input_option_group_name"></a> [option\_group\_name](#input\_option\_group\_name) | Name of the option group | `string` | `null` | no |
311+
| <a name="input_option_group_skip_destroy"></a> [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 |
311312
| <a name="input_option_group_timeouts"></a> [option\_group\_timeouts](#input\_option\_group\_timeouts) | Define maximum timeout for deletion of `aws_db_option_group` resource | `map(string)` | `{}` | no |
312313
| <a name="input_option_group_use_name_prefix"></a> [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 |
313314
| <a name="input_options"></a> [options](#input\_options) | A list of Options to apply | `any` | `[]` | no |
314315
| <a name="input_parameter_group_description"></a> [parameter\_group\_description](#input\_parameter\_group\_description) | Description of the DB parameter group to create | `string` | `null` | no |
315316
| <a name="input_parameter_group_name"></a> [parameter\_group\_name](#input\_parameter\_group\_name) | Name of the DB parameter group to associate or create | `string` | `null` | no |
317+
| <a name="input_parameter_group_skip_destroy"></a> [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 |
316318
| <a name="input_parameter_group_use_name_prefix"></a> [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 |
317319
| <a name="input_parameters"></a> [parameters](#input\_parameters) | A list of DB parameters (map) to apply | `list(map(string))` | `[]` | no |
318320
| <a name="input_password"></a> [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.<br> 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.
335337
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no |
336338
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | `map(string)` | `{}` | no |
337339
| <a name="input_timezone"></a> [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 |
340+
| <a name="input_upgrade_storage_config"></a> [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 |
338341
| <a name="input_username"></a> [username](#input\_username) | Username for the master DB user | `string` | `null` | no |
339342
| <a name="input_vpc_security_group_ids"></a> [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security groups to associate | `list(string)` | `[]` | no |
340343

examples/blue-green-deployment/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Note that this example may create resources which cost money. Run `terraform des
2727
| Name | Version |
2828
|------|---------|
2929
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3737

3838
## Modules
3939

examples/blue-green-deployment/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/complete-mssql/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/complete-mssql/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/complete-mysql/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/complete-mysql/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/complete-oracle/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/complete-oracle/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/complete-postgres/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/complete-postgres/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/cross-region-replica-postgres/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/cross-region-replica-postgres/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/enhanced-monitoring/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Note that this example may create resources which cost money. Run `terraform des
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2626

2727
## Providers
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3232

3333
## Modules
3434

examples/enhanced-monitoring/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/groups/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

examples/groups/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/replica-mysql/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/replica-mysql/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/replica-postgres/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Note that this example may create resources which cost money. Run `terraform des
2020
| Name | Version |
2121
|------|---------|
2222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
23-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
23+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
2424

2525
## Providers
2626

2727
| Name | Version |
2828
|------|---------|
29-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
29+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
3030

3131
## Modules
3232

examples/replica-postgres/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/role-association-postgres/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Further database configurations for creating extension and invoking from postgre
1010
| Name | Version |
1111
|------|---------|
1212
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
13-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
13+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
1414

1515
## Providers
1616

1717
| Name | Version |
1818
|------|---------|
19-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
19+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
2020

2121
## Modules
2222

examples/role-association-postgres/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

examples/s3-import-mysql/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ Note that this example may create resources which cost money. Run `terraform des
4949
| Name | Version |
5050
|------|---------|
5151
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
52-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
52+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.62 |
5353

5454
## Providers
5555

5656
| Name | Version |
5757
|------|---------|
58-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
58+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.62 |
5959

6060
## Modules
6161

examples/s3-import-mysql/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.59"
7+
version = ">= 5.62"
88
}
99
}
1010
}

main.tf

+12-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ module "db_parameter_group" {
3333
description = var.parameter_group_description
3434
family = var.family
3535

36-
parameters = var.parameters
36+
parameters = var.parameters
37+
skip_destroy = var.parameter_group_skip_destroy
3738

3839
tags = merge(var.tags, var.db_parameter_group_tags)
3940
}
@@ -49,7 +50,8 @@ module "db_option_group" {
4950
engine_name = var.engine
5051
major_engine_version = var.major_engine_version
5152

52-
options = var.options
53+
options = var.options
54+
skip_destroy = var.option_group_skip_destroy
5355

5456
timeouts = var.option_group_timeouts
5557

@@ -100,13 +102,14 @@ module "db_instance" {
100102
option_group_name = var.engine != "postgres" ? local.option_group : null
101103
network_type = var.network_type
102104

103-
availability_zone = var.availability_zone
104-
multi_az = var.multi_az
105-
iops = var.iops
106-
storage_throughput = var.storage_throughput
107-
publicly_accessible = var.publicly_accessible
108-
ca_cert_identifier = var.ca_cert_identifier
109-
dedicated_log_volume = var.dedicated_log_volume
105+
availability_zone = var.availability_zone
106+
multi_az = var.multi_az
107+
iops = var.iops
108+
storage_throughput = var.storage_throughput
109+
publicly_accessible = var.publicly_accessible
110+
ca_cert_identifier = var.ca_cert_identifier
111+
dedicated_log_volume = var.dedicated_log_volume
112+
upgrade_storage_config = var.upgrade_storage_config
110113

111114
allow_major_version_upgrade = var.allow_major_version_upgrade
112115
auto_minor_version_upgrade = var.auto_minor_version_upgrade

0 commit comments

Comments
 (0)