Skip to content
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

Get module working with TF v1.5.2 #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ locals {
self_permissions = {
object_id = local.service_principal_object_id
tenant_id = data.azurerm_client_config.current.tenant_id
key_permissions = ["create", "delete", "get", "backup", "decrypt", "encrypt", "import", "list", "purge", "recover", "restore", "sign", "update", "verify"]
secret_permissions = ["backup", "delete", "get", "list", "purge", "recover", "restore", "set"]
certificate_permissions = ["backup", "create", "delete", "deleteissuers", "get", "getissuers", "import", "list", "listissuers", "managecontacts", "manageissuers", "purge", "recover", "restore", "setissuers", "update"]
storage_permissions = ["backup", "delete", "deletesas", "get", "getsas", "list", "listsas", "purge", "recover", "regeneratekey", "restore", "set", "setsas", "update"]
key_permissions = ["Create", "Delete", "Get", "Backup", "Decrypt", "Encrypt", "Import", "List", "Purge", "Recover", "Restore", "Sign", "Update", "Verify"]
secret_permissions = ["Backup", "Delete", "Get", "List", "Purge", "Recover", "Restore", "Set"]
certificate_permissions = ["Backup", "Create", "Delete", "DeleteIssuers", "Get", "GetIssuers", "Import", "List", "ListIssuers", "ManageContacts", "ManageIssuers", "Purge", "Recover", "Restore", "SetIssuers", "Update"]
storage_permissions = ["Backup", "Delete", "DeleteSAS", "Get", "GetSAS", "List", "ListSAS", "Purge", "Recover", "RegenerateKey", "Restore", "Set", "SetSAS", "Update"]
}
}

Expand Down Expand Up @@ -235,12 +235,12 @@ data "azurerm_virtual_network" "vnet01" {
}

resource "azurerm_subnet" "snet-ep" {
count = var.enable_private_endpoint && var.existing_subnet_id == null ? 1 : 0
name = "snet-endpoint-${local.location}"
resource_group_name = var.existing_vnet_id == null ? data.azurerm_virtual_network.vnet01.0.resource_group_name : element(split("/", var.existing_vnet_id), 4)
virtual_network_name = var.existing_vnet_id == null ? data.azurerm_virtual_network.vnet01.0.name : element(split("/", var.existing_vnet_id), 8)
address_prefixes = var.private_subnet_address_prefix
enforce_private_link_endpoint_network_policies = true
count = var.enable_private_endpoint && var.existing_subnet_id == null ? 1 : 0
name = "snet-endpoint-${local.location}"
resource_group_name = var.existing_vnet_id == null ? data.azurerm_virtual_network.vnet01.0.resource_group_name : element(split("/", var.existing_vnet_id), 4)
virtual_network_name = var.existing_vnet_id == null ? data.azurerm_virtual_network.vnet01.0.name : element(split("/", var.existing_vnet_id), 8)
address_prefixes = var.private_subnet_address_prefix
private_endpoint_network_policies_enabled = true
}

resource "azurerm_private_endpoint" "pep1" {
Expand Down
27 changes: 25 additions & 2 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,37 @@ output "secrets" {
value = { for k, v in azurerm_key_vault_secret.keys : v.name => v.id }
}

output "Key_vault_references" {
output "versionless_secrets" {
description = "A mapping of secret names and versionless IDs."
value = { for k, v in azurerm_key_vault_secret.keys : v.name => v.versionless_id }
}

output "resource_secrets" {
description = "A mapping of secret names and resource IDs."
value = { for k, v in azurerm_key_vault_secret.keys : v.name => v.resource_id }
}

output "versionless_resource_secrets" {
description = "A mapping of secret names and versionless resource IDs."
value = { for k, v in azurerm_key_vault_secret.keys : v.name => v.resource_versionless_id }
}

output "key_vault_references" {
description = "A mapping of Key Vault references for App Service and Azure Functions."
value = {
for k, v in azurerm_key_vault_secret.keys :
v.name => format("@Microsoft.KeyVault(SecretUri=%s)", v.id)
}
}

output "versionless_key_vault_references" {
description = "A mapping of Key Vault versionless references for App Service and Azure Functions."
value = {
for k, v in azurerm_key_vault_secret.keys :
v.name => format("@Microsoft.KeyVault(SecretUri=%s)", v.versionless_id)
}
}

output "key_vault_private_endpoint" {
description = "The ID of the Key Vault Private Endpoint"
value = var.enable_private_endpoint ? element(concat(azurerm_private_endpoint.pep1.*.id, [""]), 0) : null
Expand All @@ -44,4 +67,4 @@ output "key_vault_private_endpoint_ip_addresses" {
output "key_vault_private_endpoint_fqdn" {
description = "Key Vault private endpoint FQDN Addresses"
value = var.enable_private_endpoint ? flatten(azurerm_private_endpoint.pep1.0.custom_dns_configs.*.fqdn) : null
}
}
1 change: 0 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
terraform {
experiments = [module_variable_optional_attrs]
required_providers {
azuread = {
source = "hashicorp/azuread"
Expand Down