hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

New Data Source: `azurerm_cdn_endpoint` #8243

Open tehho opened 4 years ago

tehho commented 4 years ago

Community Note

Description

The option to alias cdn endpoints using the endpoint as a data source. We manage our dns and the teams manage the apps in cdn.

New or Affected Resource(s)

Potential Terraform Configuration

resource "azurerm_resource_group" "example" {
  name     = "acceptanceTestResourceGroup1"
  location = "West US"
}

resource "azurerm_dns_zone" "example" {
  name                = "mydomain.com"
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_dns_a_record" "apex" {
  name                = "@"
  zone_name           = azurerm_dns_zone.example.name
  resource_group_name = azurerm_dns_zone.example.resource_group_name
  ttl                 = 60
  target_resource_id  = data.azurerm_cdn_profile.app.id
}

data "azurerm_cdn_endpoint" "app" {
  name                = "cdn-your-name-here"
  resource_group_name = "Group-Your-Name-Here"
}
Waidmann commented 1 year ago

Any update on this?