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

Suppress partition resource changed for TF for total_bytes prop #508

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

Conversation

atishya-22
Copy link

@atishya-22 atishya-22 commented Apr 10, 2023

Always return true to ignore TF resource change(terraform plan) check on total_bytes field as it will keep changing with data ingested in partition.

Always return true to ignore TF resource change check on total_bytes field.
@atishya-22 atishya-22 marked this pull request as ready for review April 10, 2023 12:02
Comment on lines +53 to +55
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return true
},
Copy link
Author

Choose a reason for hiding this comment

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

@dagould @sumovishal What we are trying to achieve here is to not show that resource has changed during terraform plan if attribute total_bytes has changed.
I could see that always returning true using DiffSuppressFunc can be used to suppress this but not sure if there's better alternative that can be done.
Is there a way to smh ignore this during the serialization of the resource itself?

I can see some other alternatives like ignore_changes, customizeDiff but these doesn’t look like any different than to directly have inside resource schema.

Copy link
Collaborator

@sumovishal sumovishal Apr 12, 2023

Choose a reason for hiding this comment

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

DiffSuppressFunc is the right way to do it. ignore_changes applies to a resource block, not the provider.

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