Skip to content

Commit 90a9ec4

Browse files
authored
[feature] support auto_minor_version_upgrade (#209)
Enable setting auto_minor_version_upgrade on aurora databases. We have been relying on the default of `true`. This allows you to disable it. ### Test Plan * CI ### References * https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html#auto_minor_version_upgrade
1 parent fe0d030 commit 90a9ec4

File tree

9 files changed

+31
-7
lines changed

9 files changed

+31
-7
lines changed

aws-aurora-mysql/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ No provider.
4646
| Name | Description | Type | Default | Required |
4747
|------|-------------|------|---------|:--------:|
4848
| apply\_immediately | If false changes will not be applied until next maintenance window. | `string` | `false` | no |
49+
| auto\_minor\_version\_upgrade | Set the databases to automatically upgrade minor versions. | `bool` | `true` | no |
4950
| backtrack\_window | Turns on Backgrack for this many seconds. [Doc](https://aws.amazon.com/blogs/aws/amazon-aurora-backtrack-turn-back-time/) | `string` | `0` | no |
5051
| ca\_cert\_identifier | Identifier for the certificate authority. rds-ca-2019 is the latest available version. | `string` | `"rds-ca-2019"` | no |
5152
| database\_name | The name of the database to be created in the cluster. | `string` | n/a | yes |

aws-aurora-mysql/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module "aurora" {
2020
performance_insights_enabled = var.performance_insights_enabled
2121
enabled_cloudwatch_logs_exports = ["audit", "error", "general", "slowquery"]
2222
ca_cert_identifier = var.ca_cert_identifier
23+
auto_minor_version_upgrade = var.auto_minor_version_upgrade
2324

2425
ingress_cidr_blocks = var.ingress_cidr_blocks
2526
ingress_security_groups = var.ingress_security_groups

aws-aurora-mysql/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,9 @@ variable ca_cert_identifier {
180180
description = "Identifier for the certificate authority. rds-ca-2019 is the latest available version."
181181
default = "rds-ca-2019"
182182
}
183+
184+
variable auto_minor_version_upgrade {
185+
type = bool
186+
description = "Set the databases to automatically upgrade minor versions."
187+
default = true
188+
}

aws-aurora-postgres/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ No provider.
4545
| Name | Description | Type | Default | Required |
4646
|------|-------------|------|---------|:--------:|
4747
| apply\_immediately | If false changes will not be applied until next maintenance window. | `string` | `false` | no |
48+
| auto\_minor\_version\_upgrade | Set the databases to automatically upgrade minor versions. | `bool` | `true` | no |
4849
| ca\_cert\_identifier | Identifier for the certificate authority. | `string` | `"rds-ca-2019"` | no |
4950
| database\_name | The name of the database to be created in the cluster. | `string` | n/a | yes |
5051
| database\_password | Password for user that will be created. | `string` | n/a | yes |

aws-aurora-postgres/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module "aurora" {
2727
iam_database_authentication_enabled = var.iam_database_authentication_enabled
2828
performance_insights_enabled = var.performance_insights_enabled
2929
ca_cert_identifier = var.ca_cert_identifier
30+
auto_minor_version_upgrade = var.auto_minor_version_upgrade
3031

3132
ingress_cidr_blocks = var.ingress_cidr_blocks
3233
ingress_security_groups = var.ingress_security_groups

aws-aurora-postgres/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,9 @@ variable ca_cert_identifier {
124124
description = "Identifier for the certificate authority."
125125
default = "rds-ca-2019"
126126
}
127+
128+
variable auto_minor_version_upgrade {
129+
type = bool
130+
description = "Set the databases to automatically upgrade minor versions."
131+
default = true
132+
}

aws-aurora/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This is a low-level module for creating AWS Aurora clusters. We strongly reccome
2020
| Name | Description | Type | Default | Required |
2121
|------|-------------|------|---------|:--------:|
2222
| apply\_immediately | n/a | `bool` | `false` | no |
23+
| auto\_minor\_version\_upgrade | Set the databases to automatically upgrade minor versions. | `bool` | `true` | no |
2324
| backtrack\_window | n/a | `number` | `0` | no |
2425
| ca\_cert\_identifier | Identifier for the certificate authority. Use rds-ca-2019 for anything new. | `string` | `"rds-ca-2019"` | no |
2526
| database\_name | n/a | `string` | n/a | yes |

aws-aurora/main.tf

+8-7
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ resource "aws_rds_cluster_instance" "db" {
7878
engine = var.engine
7979
engine_version = var.engine_version
8080

81-
count = var.instance_count
82-
identifier = "${local.name}-${count.index}"
83-
cluster_identifier = aws_rds_cluster.db.id
84-
instance_class = var.instance_class
85-
db_subnet_group_name = var.database_subnet_group
86-
db_parameter_group_name = aws_db_parameter_group.db.name
87-
ca_cert_identifier = var.ca_cert_identifier
81+
count = var.instance_count
82+
identifier = "${local.name}-${count.index}"
83+
cluster_identifier = aws_rds_cluster.db.id
84+
instance_class = var.instance_class
85+
db_subnet_group_name = var.database_subnet_group
86+
db_parameter_group_name = aws_db_parameter_group.db.name
87+
ca_cert_identifier = var.ca_cert_identifier
88+
auto_minor_version_upgrade = var.auto_minor_version_upgrade
8889

8990
publicly_accessible = var.publicly_accessible
9091
performance_insights_enabled = var.performance_insights_enabled

aws-aurora/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,9 @@ variable ca_cert_identifier {
135135
description = "Identifier for the certificate authority. Use rds-ca-2019 for anything new."
136136
default = "rds-ca-2019"
137137
}
138+
139+
variable auto_minor_version_upgrade {
140+
type = bool
141+
description = "Set the databases to automatically upgrade minor versions."
142+
default = true
143+
}

0 commit comments

Comments
 (0)