Open Raksha-CPU opened 1 month ago
Hi @Raksha-CPU thanks for opening this issue. Unfortunately, I could not reproduce the issue with the following tf config. Could you compare it to your configuration and see what the difference is?
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.85.0"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "testRG-26078-0524"
location = "eastus"
}
resource "azurerm_api_management" "test" {
name = "testAM-26078-0524"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
publisher_name = "pub1"
publisher_email = "pub1@email.com"
sku_name = "Consumption_0"
identity {
type = "SystemAssigned"
}
}
data "azurerm_client_config" "current" {}
resource "azurerm_key_vault" "test" {
name = "testKV-26078-0524"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "standard"
}
resource "azurerm_key_vault_access_policy" "test" {
key_vault_id = azurerm_key_vault.test.id
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.object_id
certificate_permissions = [
"Create",
"Delete",
"DeleteIssuers",
"Get",
"GetIssuers",
"Import",
"List",
"ListIssuers",
"ManageContacts",
"ManageIssuers",
"SetIssuers",
"Update",
"Purge",
]
secret_permissions = [
"Get",
"Delete",
"List",
"Purge",
"Recover",
"Set",
]
}
resource "azurerm_key_vault_access_policy" "test2" {
key_vault_id = azurerm_key_vault.test.id
tenant_id = azurerm_api_management.test.identity.0.tenant_id
object_id = azurerm_api_management.test.identity.0.principal_id
secret_permissions = [
"Get",
"List",
]
}
resource "azurerm_key_vault_secret" "test" {
name = "secret-26078-0524"
value = "rick-and-morty"
key_vault_id = azurerm_key_vault.test.id
depends_on = [azurerm_key_vault_access_policy.test]
}
resource "azurerm_api_management_named_value" "test" {
name = "testAMProperty-26078-0524"
resource_group_name = azurerm_api_management.test.resource_group_name
api_management_name = azurerm_api_management.test.name
display_name = "TestProperty26078"
secret = true
value_from_key_vault {
secret_id = azurerm_key_vault_secret.test.id
}
depends_on = [azurerm_key_vault_access_policy.test2]
}
Actual:
Is there an existing issue for this?
Community Note
Terraform Version
1.8.1
AzureRM Provider Version
Affected Resource(s)/Data Source(s)
azurerm_api_management_named_value
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Named value with Key Vault reference should be added in API management
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response