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

Implement PlanResourceChange on Destroy Support #364

Closed
bflad opened this issue Jun 8, 2022 · 2 comments · Fixed by #409
Closed

Implement PlanResourceChange on Destroy Support #364

bflad opened this issue Jun 8, 2022 · 2 comments · Fixed by #409
Assignees
Labels
breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Member

bflad commented Jun 8, 2022

Module version

v0.8.0

Use-cases

The provider protocol may soon support enabling destroy plans that call the PlanResourceChange RPC. This will enable providers to return warning or error diagnostics when resources are destroy planned.

This framework can opt into the new capability and support it via the existing ResourceWithModifyPlan interface ModifyPlan methods. Technically this is already enabled in the framework logic, however there are no protections if providers do something unexpected, such as modifying the response planned state from being empty, which should have guardrails to prevent unexpected behaviors.

Proposal

  • When implemented in the protocol, upgrade to terraform-plugin-go version which supports the feature.
  • Enable the capability for the framework server (e.g. in the current proposal, enable GetProviderSchema > Capabilities > PlanDestroy).
  • Ensure the framework server implements an error if the response plan has any values set (refer to TODOs in server_planresourcechange_test.go unit testing)
  • Announce as a potentially breaking change, as providers using this framework can implement support via the existing ResourceWithModifyPlan interface ModifyPlan (future provider capabilities closer or after 1.0 should likely be surfaced as opt-in flags)
@bflad bflad added enhancement New feature or request breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. labels Jun 8, 2022
@bflad
Copy link
Member Author

bflad commented Jul 7, 2022

Depends on hashicorp/terraform-plugin-go#204, which will need to be reviewed, merged, and released, before this functionality can be enabled in this module.

@bflad bflad self-assigned this Jul 7, 2022
@bflad bflad added this to the v1.0.0 milestone Jul 7, 2022
bflad added a commit that referenced this issue Jul 8, 2022
…ource destruction with Terraform 1.3 and later

Reference: #364
bflad added a commit that referenced this issue Jul 8, 2022
…ource destruction with Terraform 1.3 and later

Reference: #364
bflad added a commit that referenced this issue Jul 11, 2022
…ource destruction with Terraform 1.3 and later (#409)

Reference: #364
@bflad bflad modified the milestones: v1.0.0, v0.10.0 Jul 11, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change This PR introduces a breaking change or the resolution of this issue may require a breaking change. enhancement New feature or request
Projects
None yet
1 participant