This terraform provider will allow the creation the Azure App Configuration resources, be they simple values or Key Vault secret references.
terraform {
required_providers {
akc = {
source = "arkiaconsulting/akc"
}
}
}
provider "akc" {
}
resource "akc_key_value" "test" {
endpoint = azurerm_app_configuration.test.endpoint
key = "Key"
value = "my config value"
}
resource "akc_key_value" "config_value" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev"
key = "Key"
value = "my config value"
}
resource "akc_key_secret" "config_secret" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev"
key = "storage-connection-string"
secret_id = azurerm_key_vault_secret.secret.id
latest_version = true # Trim or not the version information (default to false)
}
data "akc_key_value" "my_value" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev"
key = "Key"
}
Reference the resulting value using data.akc_key_value.my_value.value
data "akc_key_secret" "my_secret_id" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev"
key = "Key"
}
Reference the resulting secret Id using data.akc_key_value.my_secret_id.secret_id
The provider has App Configuration Features support
resource "akc_feature" "dark_mode" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev" # Optional
name = "DarkMode"
enabled = true # Optional
description = "Switch UI to dark mode" # Optional
}
data "akc_feature" "dark_mode" {
endpoint = azurerm_app_configuration.test.endpoint
label = "Dev" # Optional
name = "DarkMode"
}
The provider uses the current Azure CLI credentials if available, and fall back to environment variables.
The identity must have be assigned the RBAC role App Configuration Data Owner
, or at least App Configuration Data Reader
in order to use the data source.
If you don't want to connect using Azure CLI credentials, you must configure the following environment variables (terraform-azurerm standard):
export ARM_CLIENT_ID=XXXXXXXX-XXX
export ARM_SUBSCRIPTION_ID=XXXXXXXX-XXX
export ARM_TENANT_ID=XXXXXXXX-XXX
export ARM_CLIENT_SECRET=XXXXXXX
export ARM_USE_MSI=True # Optional
The provider is available on the terraform registry