-
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_certificate_order_key_vault_store
#25464
base: main
Are you sure you want to change the base?
New Resource: azurerm_certificate_order_key_vault_store
#25464
Conversation
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 @xiaxyi. Would you be able to provide some more detail on what this actually does? I see in the description that it enables binding a certificate order to a key vault, but what does that mean or do in an App Service context?
Thanks @stephybun for the review! The feature is to configure the key vault information for a purchased app service certificate. After user buy an app service certificate using API reference:https://learn.microsoft.com/en-us/rest/api/appservice/app-service-certificate-orders/create-or-update-certificate?view=rest-appservice-2023-01-01&tabs=HTTP Let me know if there is anything that's still not clear to you. |
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.
@xiaxyi could you please take a look through the comments and suggestions left in-line. Once those are fixed up we can take another look through this.
|
||
existing, err := client.GetCertificate(ctx, id) | ||
if err != nil && !response.WasNotFound(existing.HttpResponse) { | ||
return fmt.Errorf("retreiving %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("retreiving %s: %v", id, err) | |
return fmt.Errorf("retrieving %s: %v", id, err) |
|
||
existing, err := client.GetCertificate(ctx, *id) | ||
if err != nil { | ||
return fmt.Errorf("reading %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("reading %s: %+v", id, err) | |
return fmt.Errorf("retrieving %s: %+v", id, err) |
if response.WasNotFound(certificateOrderCertificate.HttpResponse) { | ||
return metadata.MarkAsGone(id) | ||
} | ||
return fmt.Errorf("reading %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("reading %s: %+v", id, err) | |
return fmt.Errorf("retrieving %s: %+v", id, err) |
} | ||
|
||
func (r CertificateOrderCertificateResource) ResourceType() string { | ||
return "azurerm_app_service_certificate_order_certificate" |
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 we rename this so it's a bit clearer at first glance what this does
return "azurerm_app_service_certificate_order_certificate" | |
return "azurerm_app_service_certificate_order_key_vault_store" |
"key_vault_id": { | ||
Type: pluginsdk.TypeString, | ||
Required: true, | ||
ValidateFunc: commonids.ValidateKeyVaultID, | ||
// TODO -- remove when issue https://github.com/Azure/azure-rest-api-specs/issues/28498 is addressed | ||
DiffSuppressFunc: suppress.CaseDifference, | ||
}, | ||
|
||
"key_vault_secret_name": { | ||
Type: pluginsdk.TypeString, | ||
Required: true, | ||
ValidateFunc: keyVaultValidate.NestedItemName, | ||
}, |
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.
Could these be replaced by key_vault_secret_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.
I'm afraid not, because we are not referring to a key vault secret, instead, we are creating the secret in the key vault with a name specified.
|
||
* `name` - (Required) Specifies the name of the certificate order certificate key vault binding. Changing this forces a new resource to be created. | ||
|
||
* `certificate_order_id` - (Required) The id of the certificate order in which to configure the certificate. Changing this forces a new resource to be created. |
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.
* `certificate_order_id` - (Required) The id of the certificate order in which to configure the certificate. Changing this forces a new resource to be created. | |
* `certificate_order_id` - (Required) The ID of the Certificate Order in which to configure the Certificate Key Vault Store Binding. Changing this forces a new resource to be created. |
|
||
* `certificate_order_id` - (Required) The id of the certificate order in which to configure the certificate. Changing this forces a new resource to be created. | ||
|
||
* `key_vault_id` - (Required) The id of the key vault in which to bind the certificate order certificate. |
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.
* `key_vault_id` - (Required) The id of the key vault in which to bind the certificate order certificate. | |
* `key_vault_id` - (Required) The ID of the Key Vault in which to bind the Certificate. |
|
||
* `key_vault_id` - (Required) The id of the key vault in which to bind the certificate order certificate. | ||
|
||
* `key_vault_secret_name` - (Required) The name of the key vault secrete in which to bind the certificate order certificate. |
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.
* `key_vault_secret_name` - (Required) The name of the key vault secrete in which to bind the certificate order certificate. | |
* `key_vault_secret_name` - (Required) The name of the Key Vault Secret to bind to the Certificate. |
|
||
## Attributes Reference | ||
|
||
* `location` - The location of the certificate order certificate. |
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.
* `location` - The location of the certificate order certificate. | |
* `location` - The location of the Certificate. |
|
||
* `location` - The location of the certificate order certificate. | ||
|
||
* `type` - The type of the certificate order certificate. |
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.
* `type` - The type of the certificate order certificate. | |
* `type` - The type of Certificate. |
…ertificateOrderCertificate
…in' into appService/supportCertificateOrderCertificate
azurerm_certificate_order_certificate
azurerm_certificate_order_key_vault_store
Hello Guys, any updates for this? I have used terraform app_service_certificate and missing key store I am very animated for this resource |
@stephybun Hello, how are you? :D do you can check this PR with your Request Change? |
Hi guys, this feature is very important. |
Community Note
Description
Enable user to bind certificate order to key vault using the api:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"
This PR is depending on the fix of the id of the parent resource
azurerm_app_service_certificate_order
that included in the pr #25428PR 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_app_service_certificate_order_certificate
- Support key vault binding.This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.