[Bug]: aws_rds_cluster with engine_mode = "serverless", cloning a provisioned cluster with restore_to_point_in_time creates a provisioned cluster #31769
aws_rds_cluster with engine_mode = "serverless" and restore_to_point_in_time with restore_type = "copy-on-write" should always create an Aurora Serverless v1 cluster.
Actual Behavior
If restore_to_point_in_time.source_cluster_identifier points to a provisioned, regional cluster, the aws_rds_cluster resource attempts to create a provisioned, regional cluster instead.
The creation will fail with an InvalidParameterCombination: You can only specify scaling configuration for an Aurora Serverless v1 cluster.
Future applies will always try to replace the resource and set the engine_mode from "provisioned" to "serverless".
Relevant Error/Panic Output Snippet
╷
│ Error: updating RDS Cluster (staging-postgres-cluster): InvalidParameterCombination: You can only specify scaling configuration for an Aurora Serverless v1 cluster.
│ status code: 400, request id: 40c4a45c-85a7-4ae0-a277-f88091d220da
│
│ with module.this["postgres"].aws_rds_cluster.this[0],
│ on .terraform/modules/this/main.tf line 39, in resource "aws_rds_cluster" "this":
│ 39: resource "aws_rds_cluster" "this" {
│
╵
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.4.6
AWS Provider Version
5.1.0
Affected Resource(s)
Expected Behavior
aws_rds_cluster with engine_mode = "serverless" and restore_to_point_in_time with restore_type = "copy-on-write" should always create an Aurora Serverless v1 cluster.
Actual Behavior
If restore_to_point_in_time.source_cluster_identifier points to a provisioned, regional cluster, the aws_rds_cluster resource attempts to create a provisioned, regional cluster instead.
The creation will fail with an
InvalidParameterCombination: You can only specify scaling configuration for an Aurora Serverless v1 cluster.
Future applies will always try to replace the resource and set the engine_mode from "provisioned" to "serverless".
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
https://gist.github.com/draoncc/cc2ecbef90ba3466f37ba36116ce31d0
Panic Output
No response
Important Factoids
References
No response
Would you like to implement a fix?
None