Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

[#174726633] Remove cerficate version in azurerm_api_management #156

Merged

Conversation

uolter
Copy link
Collaborator

@uolter uolter commented Sep 9, 2020

No description provided.

@uolter uolter changed the title [#174726633] Revomve cerficate version in azurerm_api_management [#174726633] Remove cerficate version in azurerm_api_management Sep 9, 2020
@pasqualedevita
Copy link
Contributor

take a look also here hashicorp/terraform-provider-azurerm#4408

data "azurerm_key_vault_secret" "certs" {
  name         = "ssl-cert"
  key_vault_id = data.azurerm_key_vault.certs.id
}
locals {
  cert_url = replace(data.azurerm_key_vault_secret.certs.id,"/${data.azurerm_key_vault_secret.cert.version}","")
}
resource "azurerm_api_management" "api" {
...
  hostname_configuration {
    proxy {
      host_name    = "api.hostname.com"
      key_vault_id = local.cert_url
    }
    portal {
      host_name    = "developers.hostname.com"
      key_vault_id = local.cert_url
    }
  }

@uolter
Copy link
Collaborator Author

uolter commented Sep 9, 2020

take a look also here terraform-providers/terraform-provider-azurerm#4408

data "azurerm_key_vault_secret" "certs" {
  name         = "ssl-cert"
  key_vault_id = data.azurerm_key_vault.certs.id
}
locals {
  cert_url = replace(data.azurerm_key_vault_secret.certs.id,"/${data.azurerm_key_vault_secret.cert.version}","")
}
resource "azurerm_api_management" "api" {
...
  hostname_configuration {
    proxy {
      host_name    = "api.hostname.com"
      key_vault_id = local.cert_url
    }
    portal {
      host_name    = "developers.hostname.com"
      key_vault_id = local.cert_url
    }
  }

@pasqualedevita yep thank you ... it's much better than my complicated regex .... done in the last commit

@uolter uolter merged commit f616b9f into master Sep 9, 2020
@uolter uolter deleted the 174726633-revomve-cerficate-version-in-azurerm_api_management branch October 19, 2020 07:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants