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

key_vault permissions case sensitive #16354

Closed
1 task done
mrfreester opened this issue Apr 12, 2022 · 3 comments · Fixed by #16363
Closed
1 task done

key_vault permissions case sensitive #16354

mrfreester opened this issue Apr 12, 2022 · 3 comments · Fixed by #16363

Comments

@mrfreester
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

0.13

AzureRM Provider Version

3.1

Affected Resource(s)/Data Source(s)

azurerm_key_vault_access_policy

Terraform Configuration Files

resource "azurerm_key_vault_access_policy" "owner_policy" {
  # not relavent....

  secret_permissions = [
    "backup",  #<--- starting with version 3.0 this complains because it doesn't match case
    "delete",
    "get",
    "list",
    "purge",
    "recover",
    "restore",
    "set"
  ]

Debug Output/Panic Output

Error: expected secret_permissions.0 to be one of [Backup Delete Get List Purge Recover Restore Set], got backup

  on azure-keyvault.tf line 25, in resource "azurerm_key_vault_access_policy" "owner_policy":
  25:     "backup",

Expected Behaviour

Values ingore case and are accepted

Actual Behaviour

When first letter isn't capitalized, expected match fails

Steps to Reproduce

Using the azurerm_key_vault_access_policy resource, use lowercase values for any of the permissions rather than uppercase. When terraform runs using a provider of 3.0 or higher the bug is reproduced.

Important Factoids

No response

References

Issue also discussed here:
https://discuss.hashicorp.com/t/secret-permissions-of-azurerm-becomes-case-sensitive/37536

@tombuildsstuff
Copy link
Contributor

hey @mrfreester

Thanks for opening this issue.

These changes were made as a part of 3.0 (and are now correctly documented against the fields within the azurerm_key_vault and azurerm_key_vault_access_policy resources) - as such you'd need to update your configuration to use the fixed casing here.

Double-checking the upgrade guide it appears that this is missing from the upgrade guide for the azurerm_key_vault resource, as such I'll send a PR for that shortly - but this is included for the azurerm_key_vault_access_policy resource: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/3.0-upgrade-guide#resource-azurerm_key_vault_access_policy.

Thanks!

@github-actions
Copy link

This functionality has been released in v3.2.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@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 May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants