-
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
New Resource: azurerm_data_protection_backup_vault_customer_managed_key
#28679
Conversation
|
||
err = client.CreateOrUpdateThenPoll(ctx, *id, *model, backupvaults.DefaultCreateOrUpdateOperationOptions()) | ||
if err != nil { | ||
return fmt.Errorf("creating Data Protection Backup Vault Customer Managed Key %s: %+v", *id, err) |
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.
Printing the ID will already contain the resource name, rephrasing this will remove the redundant information
return fmt.Errorf("creating Data Protection Backup Vault Customer Managed Key %s: %+v", *id, err) | |
return fmt.Errorf("creating Customer Managed Key for %s: %+v", *id, err) |
model := resp.Model | ||
if model == nil { | ||
return fmt.Errorf("retrieving %s: `model` is nil", *id) | ||
} |
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.
Can you please update this so it's consistent with how we do these nil checks in other update methods
model := resp.Model | |
if model == nil { | |
return fmt.Errorf("retrieving %s: `model` is nil", *id) | |
} | |
if resp.Model == nil { | |
return fmt.Errorf("retrieving %s: `model` is nil", *id) | |
} | |
if resp.Model.Properties == nil { | |
return fmt.Errorf("retrieving %s: `properties` is nil", *id) | |
} | |
model := resp.Model |
|
||
err = client.CreateOrUpdateThenPoll(ctx, *id, *model, backupvaults.DefaultCreateOrUpdateOperationOptions()) | ||
if err != nil { | ||
return fmt.Errorf("updating Data Protection Backup Vault Customer Managed Key for %s: %+v", *id, err) |
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.
return fmt.Errorf("updating Data Protection Backup Vault Customer Managed Key for %s: %+v", *id, err) | |
return fmt.Errorf("updating Customer Managed Key for %s: %+v", *id, err) |
# azurerm_data_protection_backup_vault_customer_managed_key | ||
|
||
Manages a Backup Vault Customer Managed Key. | ||
|
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.
Should we add a cautionary note here about how this can only be deleted/removed by deleting the parent resource?
* `create` - (Defaults to 30 minutes) Used when creating the Backup Vault Customer Managed Key. | ||
* `read` - (Defaults to 5 minutes) Used when retrieving the Backup Vault Customer Managed Key. | ||
* `update` - (Defaults to 30 minutes) Used when updating the Backup Vault Customer Managed Key. | ||
* `delete` - (Defaults to 5 minutes) Used when deleting the Backup Vault Customer Managed Key. |
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.
I'm split about listing the delete here, since we can't delete it..
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.
same, but leaning towards removing it now since we've added a note about the delete at the top, WDYT?
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.
sounds good to me
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 @catriona-m provided tests are passing LGTM 🏄♀️
Just made one small change after this, but the tests are passing 👍 |
Community Note
Description
Adding the new resource
azurerm_data_protection_backup_vault_customer_managed_key
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_data_protection_backup_vault_customer_managed_key
[New Resource:azurerm_data_protection_backup_vault_customer_managed_key
#28679]This is a (please select all that apply):
Related Issue(s)
Fixes #25413
Note
If this PR changes meaningfully during the course of review please update the title and description as required.