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

Skip ValidateResourceConfig when the resource is only being destroyed #33908

Open
vladimirtiukhtin opened this issue Sep 19, 2023 · 1 comment

Comments

@vladimirtiukhtin
Copy link

Terraform Version

Terraform v1.5.1
on linux_amd64

Terraform Configuration Files

...terraform config...

Debug Output

│ Error: versioning_configuration.status cannot be updated from 'Enabled' to 'Disabled'

Expected Behavior

When destroy is called terraform should not perform any validation and just delete target objects

Actual Behavior

Checks are done as it seems

Steps to Reproduce

  1. Create an S3 bucket link aws_s3_bucket_versioning resource to it
  2. Modify aws_s3_bucket_versioning (only code)
  3. Run terraform destroy

Additional Context

No response

References

No response

@vladimirtiukhtin vladimirtiukhtin added bug new new issue not yet triaged labels Sep 19, 2023
@jbardin
Copy link
Member

jbardin commented Sep 19, 2023

Hi @vladimirtiukhtin,

Thanks for filing the issue. This is currently expected, since there are elements of the configuration which do come into play even during a destroy operation. We also need to take into account that providers expect all resources to be read before they are destroyed, which currently requires a normal plan to be executed internally before the destroy plan is constructed.

Because the validation and destroy plan happen in different phases of execution it makes the change a bit more difficult, but I'm going to update this to an enhancement request to see if that change can be made at all.

Thanks!

@jbardin jbardin added enhancement core and removed bug new new issue not yet triaged labels Sep 19, 2023
@jbardin jbardin changed the title Destroy operation still performs validation checks Skip ValidateResourceConfig when the resource is only being destroyed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants