Skip to content

Commit bf3376e

Browse files
feat: Remove ServerlessV2 configuration (#13)
* feat: We have removed the ServerlessV2 feature as it is still too young to be released. There are also a few pitfalls in its use and proper configuration. * terraform-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent cb3c123 commit bf3376e

File tree

6 files changed

+11
-35
lines changed

6 files changed

+11
-35
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ such as extended backups, user management, and autoscaling.
9090
| <a name="input_port"></a> [port](#input\_port) | The port on which the DB accepts connections. | `number` | `3306` | no |
9191
| <a name="input_preferred_backup_window"></a> [preferred\_backup\_window](#input\_preferred\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled. | `string` | `"00:00-02:30"` | no |
9292
| <a name="input_preferred_maintenance_window"></a> [preferred\_maintenance\_window](#input\_preferred\_maintenance\_window) | The weekly time range during which system maintenance can occur, in (UTC). | `string` | `"Mon:03:00-Mon:04:30"` | no |
93-
| <a name="input_serverlessv2_scaling_configuration"></a> [serverlessv2\_scaling\_configuration](#input\_serverlessv2\_scaling\_configuration) | The scaling configuration of the Aurora Serverless DB cluster. | <pre>object({<br> max_capacity = number<br> min_capacity = number<br> })</pre> | <pre>{<br> "max_capacity": null,<br> "min_capacity": null<br>}</pre> | no |
9493
| <a name="input_storage_type"></a> [storage\_type](#input\_storage\_type) | Storage type. | `string` | `"aurora"` | no |
9594
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to add to the AWS RDS Cluster Instance. | `map(any)` | `{}` | no |
9695
| <a name="input_vpc_security_group_ids_rds_cluster"></a> [vpc\_security\_group\_ids\_rds\_cluster](#input\_vpc\_security\_group\_ids\_rds\_cluster) | List of VPC security groups to associate with the RDS Proxy. | `list(string)` | `null` | no |

main.tf

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ module "rds_cluster" {
3737
engine_mode = var.engine_mode
3838
database_name = var.database_name
3939

40-
# Serverless
41-
serverlessv2_scaling_configuration = var.serverlessv2_scaling_configuration
42-
4340
# Network
4441
db_subnet_group_name = var.database_subnet_group_name
4542
vpc_security_group_ids = var.vpc_security_group_ids_rds_cluster

modules/rds_cluster/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | If the DB instance should have deletion protection enabled. | `bool` | `false` | no |
2222
| <a name="input_enabled_cloudwatch_logs_exports"></a> [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | Set of log types to enable for exporting to CloudWatch logs. | `list(string)` | n/a | yes |
2323
| <a name="input_engine"></a> [engine](#input\_engine) | The engine to use. | `string` | `"aurora-mysql"` | no |
24-
| <a name="input_engine_mode"></a> [engine\_mode](#input\_engine\_mode) | The database engine mode. | `string` | n/a | yes |
24+
| <a name="input_engine_mode"></a> [engine\_mode](#input\_engine\_mode) | The database engine mode. | `string` | `"provisioned"` | no |
2525
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | The engine version to use. | `string` | n/a | yes |
2626
| <a name="input_final_snapshot_identifier"></a> [final\_snapshot\_identifier](#input\_final\_snapshot\_identifier) | The name of your final DB snapshot when this DB cluster is deleted. | `string` | `"final-snapshot"` | no |
2727
| <a name="input_iam_database_authentication_enabled"></a> [iam\_database\_authentication\_enabled](#input\_iam\_database\_authentication\_enabled) | Specifies whether or not mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. | `bool` | `false` | no |
@@ -31,7 +31,6 @@
3131
| <a name="input_preferred_backup_window"></a> [preferred\_backup\_window](#input\_preferred\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled. | `string` | `"00:00-02:30"` | no |
3232
| <a name="input_preferred_maintenance_window"></a> [preferred\_maintenance\_window](#input\_preferred\_maintenance\_window) | The weekly time range during which system maintenance can occur, in (UTC). | `string` | `"Mon:03:00-Mon:04:30"` | no |
3333
| <a name="input_replication_source_identifier"></a> [replication\_source\_identifier](#input\_replication\_source\_identifier) | ARN of the source DB cluster or DB instance if this DB cluster is created as a Read Replica. | `string` | `null` | no |
34-
| <a name="input_serverlessv2_scaling_configuration"></a> [serverlessv2\_scaling\_configuration](#input\_serverlessv2\_scaling\_configuration) | The scaling configuration of the Aurora Serverless DB cluster. | <pre>object({<br> max_capacity = optional(number)<br> min_capacity = optional(number)<br> })</pre> | n/a | yes |
3534
| <a name="input_skip_final_snapshot"></a> [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Determines whether a final DB snapshot is created before the DB cluster is deleted. | `bool` | `false` | no |
3635
| <a name="input_source_region"></a> [source\_region](#input\_source\_region) | The source region for an encrypted replica DB cluster. | `string` | `null` | no |
3736
| <a name="input_storage_encrypted"></a> [storage\_encrypted](#input\_storage\_encrypted) | Specifies whether the DB cluster is encrypted. | `bool` | `true` | no |

modules/rds_cluster/main.tf

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@ resource "aws_rds_cluster" "main" {
6363
# Security
6464
deletion_protection = var.deletion_protection
6565

66-
# Serverless
67-
dynamic "serverlessv2_scaling_configuration" {
68-
for_each = var.serverlessv2_scaling_configuration == null ? [] : [1]
69-
content {
70-
max_capacity = var.serverlessv2_scaling_configuration.max_capacity
71-
min_capacity = var.serverlessv2_scaling_configuration.min_capacity
72-
}
73-
}
74-
7566
# Tags
7667
tags = merge(
7768
var.tags,
@@ -80,6 +71,15 @@ resource "aws_rds_cluster" "main" {
8071
"ServiceType" = "cluster"
8172
}
8273
)
74+
75+
# Once you start the Aurora cluster as "provisioned", then change it to ServerlessV2, then change it back to
76+
# "provisioned", then according to AWS Support it is no longer possible to remove this setting - it is just
77+
# no longer used. If this has happened to you, too: this is why we ignore changes to this setting.
78+
lifecycle {
79+
ignore_changes = [
80+
serverlessv2_scaling_configuration
81+
]
82+
}
8383
}
8484

8585
module "autoscaling" {

modules/rds_cluster/variables.tf

+1-8
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ variable "engine" {
100100
}
101101

102102
variable "engine_mode" {
103+
default = "provisioned"
103104
description = "The database engine mode."
104105
type = string
105106
}
@@ -157,14 +158,6 @@ variable "replication_source_identifier" {
157158
type = string
158159
}
159160

160-
variable "serverlessv2_scaling_configuration" {
161-
description = "The scaling configuration of the Aurora Serverless DB cluster."
162-
type = object({
163-
max_capacity = optional(number)
164-
min_capacity = optional(number)
165-
})
166-
}
167-
168161
variable "source_region" {
169162
default = null
170163
description = "The source region for an encrypted replica DB cluster."

variables.tf

-12
Original file line numberDiff line numberDiff line change
@@ -199,18 +199,6 @@ variable "port" {
199199
type = number
200200
}
201201

202-
variable "serverlessv2_scaling_configuration" {
203-
default = {
204-
max_capacity = null
205-
min_capacity = null
206-
}
207-
description = "The scaling configuration of the Aurora Serverless DB cluster."
208-
type = object({
209-
max_capacity = number
210-
min_capacity = number
211-
})
212-
}
213-
214202
variable "storage_type" {
215203
default = "aurora"
216204
description = "Storage type."

0 commit comments

Comments
 (0)