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

migrate api_shield_operation to framework #4894

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BrendanBall
Copy link

This PR migrates cloudflare_api_shield_operation to the terraform-plugin-framework to fix a bug caused by the API returning a normalized version of a specified attribute that causes mismatches between resource config and state, resulting in the resource having to be recreated on every terraform apply. This is due to not following the expectations of terraform mentioned in https://github.com/hashicorp/terraform/blob/main/docs/resource-instance-change-lifecycle.md:

Normalization: the remote API has returned some data in a different form than was recorded in the Previous Run State, but the meaning is unchanged.
In this case, the provider should return the exact value from the Previous Run State, thereby preserving the value as it was written by the user in the configuration and thus avoiding unwanted cascading changes to elsewhere in the configuration.

Migrating to the framework is necessary to implement semantic equality between the unnormalized config and the normalized state returned from the API which is used during terraform plan/apply.

Copy link
Contributor

Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/contributing/changelog-process.md.

Example:

```release-note:TYPE
Release note
```

If you do not require a release note to be included and you have permission, please add the workflow/skip-changelog-entry label. Otherwise, a maintainer will add the label or ask you for one when they review the PR.

@BrendanBall BrendanBall force-pushed the api-shield-operation-framework-migration branch from 23e3a5e to d7c2be0 Compare January 16, 2025 08:26
Copy link

@maciej maciej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left one comment, though.

(I can't approve because of lack access)

@BrendanBall BrendanBall force-pushed the api-shield-operation-framework-migration branch from d7c2be0 to 595774b Compare January 16, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants