-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_key_vault_key
- rotation_policy
block added
#19113
azurerm_key_vault_key
- rotation_policy
block added
#19113
Conversation
f993fe3
to
9127673
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THanks @aristosvo - couple comments on property names, mainly expire_time seems less then idea for clarity on what it means. WDYT?
@katbyte It seems the troubles of implementing this as an inline resource are bubbling up: testcase.go:110: Step 1/1 error: Error running apply: exit status 1
Error: keyvault.BaseClient#GetKeyRotationPolicy: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="Forbidden" Message="The user, group or application 'appid=*******;oid=3aa04c8c-5a75-4e5e-9117-1b7cf6f33e21;numgroups=9;iss=https://sts.windows.net/*******/' does not have keys getrotationpolicy permission on key vault 'acctestkv-vecj9;location=westeurope'. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125287" InnerError={"code":"ForbiddenByPolicy"}
with azurerm_key_vault_key.test, This means we would not have backwards compatibility and we'd need more permissions on Edit: Added a workaround for now, ignoring the policy if unauthorised. Maybe something like a provider "azurerm" {
features {
key_vault {
ignore_missing_key_vault_key_policy_permissions = true
}
}
} |
bb2682b
to
4334a66
Compare
@aristosvo - would those permissions not still be needed by the separate resources? i imagine you could infer if the user is trying to set them from the existence of the block or not, if not set + read fails ignore, if set + read fails error out, but that does seem less then ideal 😅 |
Yes it would, but then it is not breaking
Yeah, doing something like that now, I set it conditionally and ignore read fails. Could finetune that indeed a bit, but it still isn't ideal. Should've stopped thinking earlier and just implemented it separately 😅 Reopened and improved #18603 to have options. Both are working and tested, each with their own compromise I'd say. |
01ca72e
to
b149c02
Compare
this is waiting on #18576 which is waiting on Azure/azure-rest-api-specs#21137 |
b08519f
to
b10bad7
Compare
Added in SDK v7.4, but this one is not available yet, causing all tests to fail. |
@aristosvo SDK v7.4 is now available in |
c661169
to
8c7e679
Compare
Rebased and replaced with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aristosvo ! LGTM 🌴
Out of curiosity, will v3.46.0 come out the 2nd @katbyte? Not normally a github follower, but I noticed the 'due date' was the 2nd and wasn't sure if those were hard or soft dates Ty ty! |
Hey @aristosvo @katbyte , want to confirm the final decision on "ignore read fails", it seems it's always failing but with a more friendly error message when read fails without enough permission now? |
This functionality has been released in v3.46.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! |
This functionality has been released but no documentation has bene provided. |
|
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key my bad sorry all is ok, |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Depends on #18576
Fixes #14471
Issues:
Contains a workaround for now, ignoring the policy read unauthorized error if unauthorised. Maybe something like a features flag would be the best solution?