Open luchees opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
In your steps to reproduce, you are importing using the ARN:
terraform import aws_rds_cluster_instance.rds_instance1 arn:aws:rds:eu-west-1:xxxxxxxxx:db:wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1
But according to the v5.1.0 provider documentation, import requires the identifier i.e. the wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1
part only. Without the logs it's hard to tell if the import has failed, but that might explain why it's trying to delete using the ARN and not the DBInstanceIdentifier.
Terraform Core Version
1.5.1
AWS Provider Version
5.1.0
Affected Resource(s)
aws_rds_cluster_instance
Expected Behavior
aws_rds_cluster_instance is deleted by using DbClusterIdentifier
Actual Behavior
aws_rds_cluster_instance is trying to be deleted by using the ARN.
This causes the RDS DeleteInstance of an imported by ARN instance to fail because there the id is the ARN and not the Identifier.
Relevant Error/Panic Output Snippet
Steps to Reproduce
terraform apply
Apply the template and deploy the cluster with the instancesterraform state rm aws_rds_cluster_instance.rds_instance1
Remove the instance from the stateterraform import aws_rds_cluster_instance.rds_instance1 arn:aws:rds:eu-west-1:xxxxxxxxx:db:wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1
Add the instance from the state by using the ARNChange the suffix in the locals block
terraform apply
Run terraform apply againDebug Output
It is using the ARN to delete instead of the ID wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1
This is because the state is using the
id": "arn:aws:rds:eu-west-1:xxxxx:db:wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1",
instead ofid": "wancloud-eu-west-1devops-acceptance-devops-acceptance-1-az1-1",
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No