Я хотел бы сгенерировать ключ keyvault с помощью:
resource "azurerm_key_vault" "xxx-keyvault" {
name = "xxx-keyvault"
location = var.location
resource_group_name = azurerm_resource_group.xxx-rg.name
enabled_for_disk_encryption = true
tenant_id = var.tenant_id
sku_name = "standard"
enabled_for_template_deployment = true
enabled_for_deployment = true
access_policy {
tenant_id = var.tenant_id
object_id = var.service_principal_object_id
key_permissions = [
"backup","create","decrypt","delete","encrypt","get","import","list","purge","recover","restore","sign","unwrapKey","update","verify","wrapKey"
]
secret_permissions = [
"backup","get","list","purge","recover","restore","set"
]
}
network_acls {
default_action = "Deny"
bypass = "AzureServices"
}
}
resource "azurerm_key_vault_key" "xxx-keyvault-key" {
name = "xxx-keyvault-key"
key_vault_id = azurerm_key_vault.xxx-keyvault.id
key_type = "RSA"
key_size = 2048
key_opts = [
"decrypt",
"encrypt",
"sign",
"unwrapKey",
"verify",
"wrapKey",
]
}
, но я получаю следующую ошибку:
Ошибка: Ошибка создания ключа: keyvault.BaseClient # CreateKey: Ошибка при ответе на запрос: StatusCode = 403 - Исходная ошибка: авторест / azure: служба вернула ошибку. Status = 403 Code = "Forbidden" Message = "Доступ запрещен. Вызывающий не найден ни в одной политике доступа. \ R \ nCaller: appid = <...>; oid = <...>; numgroups = 0; iss = <...> / \ r \ nVault: <...>; location = <...> "InnerError = {" code ":" AccessDenied "}
Что не так?
Спасибо!