Manages Key Vault Certificate Contacts.
data "azurerm_client_config" "current" {}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_key_vault" "example" {
name = "examplekeyvault"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "premium"
}
resource "azurerm_key_vault_access_policy" "example" {
key_vault_id = azurerm_key_vault.example.id
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.object_id
certificate_permissions = [
"ManageContacts",
]
key_permissions = [
"Create",
]
secret_permissions = [
"Set",
]
}
resource "azurerm_key_vault_certificate_contacts" "example" {
key_vault_id = azurerm_key_vault.example.id
contact {
email = "example@example.com"
name = "example"
phone = "01234567890"
}
contact {
email = "example2@example.com"
}
depends_on = [
azurerm_key_vault_access_policy.example
]
}
The following arguments are supported:
key_vault_id
- (Required) The ID of the Key Vault. Changing this forces a new resource to be created.
contact
- (Required) One or more contact
blocks as defined below.
A contact
block supports the following:
email
- (Required) E-mail address of the contact.
name
- (Optional) Name of the contact.
phone
- (Optional) Phone number of the contact.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Key Vault Certificate Contacts.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Key Vault Certificate Contacts.read
- (Defaults to 5 minutes) Used when retrieving the Key Vault Certificate Contacts.update
- (Defaults to 30 minutes) Used when updating the Key Vault Certificate Contacts.delete
- (Defaults to 30 minutes) Used when deleting the Key Vault Certificate Contacts.Key Vault Certificate Contacts can be imported using the resource id
, e.g.
terraform import azurerm_key_vault_certificate_contacts.example https://example-keyvault.vault.azure.net/certificates/contacts