-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data sources not refreshed on destroy #27172
Comments
Did some more testing. When using a data source from the same terraform run it also doesn't refresh. provider "kubernetes" {
load_config_file = false
host = aws_eks_cluster.default.endpoint
cluster_ca_certificate = base64decode(aws_eks_cluster.default.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.default_auth.token
} |
Our full test street is depending on this bug. Would love to see it fixed. 👍 |
Hello, For any that aren't aware, the workaround of refreshing, or applying an empty plan immediately before a destroy will update the data source in the state. The I think we can re-introduce a sort of "data refresh" into the destroy-plan graph, and in the process also take care of some other outstanding issues, like locals and outputs not being usable in provider configurations during destroy. |
@jbardin Thank you for the workaround, this seems to help us with the issue we have. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform Configuration Files
Debug Information
Expected Behavior
That the destroy run refreshes the data from the
terraform_remote_state
and use it in the provider block.Actual Behavior
When the destroy is run the data
terraform_remote_state
is not refreshed when a plan is created. When the plan is executed the provider fails as there is no data from the remote state.Additional Context
We use one terraform run to create a Kubernetes cluster. Then use a second one to create Kubernetes resources on the cluster. The
terraform_remote_state
data resource is used to get the hostname from the cluster from the state of the first run. When running a destroy theterraform_remote_state
is not refreshed and the Kubernetes provider fails.The text was updated successfully, but these errors were encountered: