Open yamazoon0207 opened 3 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @yamazoon0207 👋 Thank you for taking the time to raise this! Can you provide debug logging (redacted as needed)? I'm not sure I follow what you're describing, and that may help clear things up.
@justinretzolk 👋 I have uploaded the debug log.
This is a blog in Japanese, but the details are also described in this article.
https://blog.serverworks.co.jp/terraform-restore-aurora-cluster#%E7%95%99%E6%84%8F%E4%BA%8B%E9%A0%85
We are also running into this with Terraform v1.5.2
and AWS Provider 5.60.0
, but in our case we are seeing this error whenever we make a change to an existing Terraform aws_rds_cluster
resource (so import
isn't relevant for us).
The problem also shows up for enable_local_write_forwarding
.
How to reproduce
resource "aws_rds_cluster" "abc" {
engine
to aurora-postgresql
enable_global_write_forwarding
Terraform will perform the following actions:
# aws_rds_cluster.airflow_datalake will be updated in-place
~ resource "aws_rds_cluster" "abc" {
+ enable_global_write_forwarding = false
+ enable_local_write_forwarding = false
id = "abc"
When I run aws rds describe-db-clusters \ --query '*[].{DBClusterIdentifier:DBClusterIdentifier,LocalWriteForwardingStatus:LocalWriteForwardingStatus}'
to check the write forwarding status on our clusters, I see
{
"DBClusterIdentifier": "abc",
"LocalWriteForwardingStatus": null
},
The docs at https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-write-forwarding.html indicate that a value of null
means Write forwarding isn't available for this DB cluster.
So it looks like Terraform is getting confused since it keeps trying to set a "False" value for a resource which only supports null
in its current configuration?
I think the issue is that both those parameters are defined as Booleans with a default value of False
even though they can actually be set to 'null'. So Terraform keeps trying to set a value of False on a resource that doesn't support it
Terraform Core Version
Terraform v1.7.4
AWS Provider Version
v5.40.0
Affected Resource(s)
Expected Behavior
I have an Aurora cluster with enable_global_write_forwarding = false. When I try to import it to terraform, "changes" do not appear in the terraform plan.
Actual Behavior
I have an Aurora cluster with enable_global_write_forwarding = false. When I try to import it to terraform, "changes" appears in the terraform plan. Change to enable_global_write_forwarding = false. When I run terraform apply, no changes are made, but change succeeds.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Debug Output
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None