Skip to content
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

backport 35262 #35272

Merged
merged 1 commit into from
May 31, 2024
Merged

backport 35262 #35272

merged 1 commit into from
May 31, 2024

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented May 31, 2024

Manual backport of #35262


Don't attempt to import during a destroy operation

A full destroy requires Terraform to refresh everything beforehand, but if an instance is missing from the state and has an import block, Terraform was attempting to re-import that resource before destroy. The most common reason this could happen would be when resuming a partially completed destroy, where some of the state has already been deleted. In that case the import will fail with an error because the resource no longer exists, and end up blocking the rest of the operation.

A full destroy requires Terraform to refresh everything beforehand, but
if an instance is missing from the state and has an `import` block,
Terraform was attempting to re-import that resource before destroy. The
most common reason this could happen would be when resuming a partially
completed destroy, where some of the state has already been deleted. In
that case the import will fail with an error because the resource no
longer exists, and end up blocking the rest of the operation.
@jbardin jbardin merged commit 9da5015 into v1.9 May 31, 2024
10 checks passed
@jbardin jbardin deleted the backport-35262 branch May 31, 2024 21:43
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link

github-actions bot commented Jul 1, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant