-
Notifications
You must be signed in to change notification settings - Fork 427
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
External Volume - Terraform not reading privileges properly #2533
Comments
@caseywhoop , I experienced the same issue (see comment in my part), however for our use-case we don't have a need to limit privileges on EXTERNAL VOLUMES yet and therefor never bothered to look into it. # TODO: With only PRIVILEGE on USAGE won't infer the change in state and as well can't be deleted.
resource "snowflake_grant_privileges_to_account_role" "all_privileges_to_volume" {
all_privileges = true
account_role_name = snowflake_role.service_full.name
always_apply = false
on_account_object {
object_name = "${upper(local.project_name)}_${upper(local.environment)}_${upper(local.domain_short)}_${upper(local.bounded_context_short)}_VOLUME"
object_type = "EXTERNAL VOLUME"
}
depends_on = [snowflake_unsafe_execute.external_volume]
} @sfc-gh-jcieslak created the part on grants due to issue 2248 created by @danu165 . |
Hey @caseywhoop 👋 |
Fixes: #2533 Terraform couldn't read privileges for External volumes, because Snowflake returns a shorter `VOLUME` name where we expect `EXTERNAL VOLUME` to be returned. The proposed fix relies on replacing `EXTERNAL VOLUME` with `VOLUME` in the prepare read request function so that the Read operation will be untouched and will work for external volumes. ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests to show the fix works (didn't pass without the fix) <!-- add more below if you think they are relevant --> ## Other Wrote to the docs team to add this case to the SHOW GRANTS page. **Update**: added missing privileges (CREATE MODEL needed for #2563)
Hey @caseywhoop. We have released the fix as part of v0.87.0 release. Please follow the migration guide during the update. Please confirm that the issue is resolved in the newest version. Thanks! |
External Volume stuff looks great now, thank you! Now that my diff isn't as cluttered, I can see that I am having a similar issue with the "apply tag" permission. No matter how many times I apply these changes, they keep popping up in the diff. Please let me know if I should open a new ticket. Thank you!
|
Great to hear EXTERNAL VOLUMES are working for you! Yes, please open another ticket, but before that please try to use the latest grant resource (this one is deprecated and we're not planning on supporting deprecated resources). For this kind of grant, it should be |
Terraform CLI and Provider Versions
Terraform Configuration
Expected Behavior
1 - We expect there to be no diff after applying changes, confirming resource is properly configured in state file, and running a terraform plan.
2 - We expect terraform to delete the resource after removing the code from the repo and re-applying.
Actual Behavior
Running
terraform plan
still shows:Re-applying this will not fix resolve the diff; It will always try to re-add
"USAGE"
Removing the resource from the repo shows the incorrect changes to be applied (note,
USAGE
privilege is missing:If you try to apply these changes, you get an error:
Steps to Reproduce
To replicate the first bug:
terraform apply
yes
apply changesterraform plan
USAGE
privilegeTo replicate the second bug:
terraform apply
yes
apply changesterraform apply
yes
apply changesHow much impact is this issue causing?
High
Logs
No response
Additional Information
This is a huge blocker as we have external volume grants as part of a permissions module, and it means we cannot ever remove any permissions once granted to users.
It also means we cannot have any CI/CD or developer PR checks as there will always be a diff in the Terraform plan
The text was updated successfully, but these errors were encountered: