Problem
When a resource is created or updated, a race condition may occur if the remote service fails to complete the creation or update in time for the final read operation. However, if queried after a certain interval, the read operation would succeed.
As a workaround, some resources implement extra logic to retry the read operation. When a retry has not been implemented, however, you may encounter the error below.
Error: Provider produced inconsistent result after apply
When applying changes to
aws_network_acl_rule.this,
provider "registry.terraform.io/hashicorp/aws" produced an unexpected new value:
Root resource was present, but now absent.
Solutions
The long-term solution is to request a fix by opening a GitHub issue directly with the provider maintainers.
In the short-term, you can import the affected resource into the Terraform state file, and rerun the apply operation. If the affected resource is not critical, you may also manually delete it in the remote service, and rerun the apply operation.