Provider produced inconsistent result after apply error when changing SNS topic resource name #22275
Labels
bug
Addresses a defect in current functionality.
service/sns
Issues and PRs that pertain to the sns service.
service/sqs
Issues and PRs that pertain to the sqs service.
Milestone
Community Note
Terraform CLI and Terraform AWS Provider Version
terraform v1.1.1 on linux_amd64
hashicorp/aws v3.70.0
Affected Resource(s)
Steps to Reproduce
terraform apply
to create the infrastructureold_sns_topic
tonew_sns_topic
on lines 12, 17, and 40.terraform apply
again to get the error messageTerraform Configuration Files
Actual Behavior
The "old" SNS topic is destroyed, and terraform fails to create the "new" one.
Expected Behavior
Only the terraform resource name is changing, so in the real world, one should probably manually remove and re-import their resources. But the fact that the apply command fails and leaves your infrastructure in a non-functional state is pretty annoying.
It'd be nice if Terraform could either execute the plan to completion, or detect that the underlying infrastructure has not changed and only the state needs to be updated to account for the new resource name (I'm sure the latter is probably a harder ask).
The text was updated successfully, but these errors were encountered: