❯ terraform plan
aws_redshiftserverless_namespace.test: Refreshing state... [id=test]
aws_redshiftserverless_workgroup.test: Refreshing state... [id=test]
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply" which may have affected this plan:
# aws_redshiftserverless_namespace.test has changed
~ resource "aws_redshiftserverless_namespace" "test" {
+ db_name = "dev"
id = "test"
# (10 unchanged attributes hidden)
}
Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or
respond to these changes.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
resource "aws_redshiftserverless_namespace" "test" {
namespace_name = "test"
}
resource "aws_redshiftserverless_workgroup" "test" {
namespace_name = aws_redshiftserverless_namespace.test.namespace_name
workgroup_name = "test"
}
output "db_name" { value = aws_redshiftserverless_namespace.test.db_name}
### Steps to Reproduce
1. Terraform apply the above config
2. Run `terraform plan` and see the non-empty plan
### Debug Output
_No response_
### Panic Output
_No response_
### Important Factoids
The cause of the issue is suboptimal implementation of Redshift APIs. If namespace is created without dbName, then the default "dev" is used however, GetNamespace does not return this value.
Workgroup creation modifies the namespace in a way that changes the dbName from empty to "dev" creating the drift. It never should happen that creation of one resource mutates another. It is possible to mitigate the issue in the provider
### References
_No response_
### Would you like to implement a fix?
Yes
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.9.5
AWS Provider Version
5.66.0
Affected Resource(s)
Expected Behavior
Empty plan after apply
Actual Behavior
Non-empty plan after apply:
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files