Azure CDN Profile
This page shows how to write Terraform and Azure Resource Manager for CDN Profile and write them securely.
azurerm_cdn_profile (Terraform)
The Profile in CDN can be configured in Terraform with the resource name azurerm_cdn_profile
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_cdn_profile" "std_verizon" {
name = "example-cdn"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku = "Standard_Verizon"
}
resource "azurerm_cdn_profile" "static" {
name = "boundlexx-static-cdn"
resource_group_name = azurerm_resource_group.rg.name
location = "Global"
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_profile" "DEV-CDN-BCP" {
name = "bcpdevprofile"
location = azurerm_resource_group.rgbcp.location
resource_group_name = azurerm_resource_group.rgbcp.name
sku = "Standard_Microsoft"
tags = {
resource "azurerm_cdn_profile" "cdnprofile" {
name = var.cdn_profile_name
resource_group_name = azurerm_resource_group.resource_group.name
location = azurerm_resource_group.resource_group.location
sku = var.cdn_sku_profile
}
resource "azurerm_cdn_profile" "redirector_cdn_profile" {
name = "redirector-cdn-profile"
location = azurerm_resource_group.redirector_rg.location
resource_group_name = azurerm_resource_group.redirector_rg.name
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_profile" "esgi" {
name = "esgi-cdn"
location = azurerm_resource_group.RG1.location
resource_group_name = azurerm_resource_group.RG1.name
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_profile" "example" {
name = "example-cdn"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku = "Standard_Microsoft"
}
resource "azurerm_cdn_profile" "ockam_verizon_premium" {
count = var.cdn_count
name = "ockam-verizon-premium"
location = var.location
resource_group_name = azurerm_resource_group.main.name
sku = "Premium_Verizon"
resource "azurerm_cdn_profile" "cdng5" {
name = "cdng5"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku = "Standard_Verizon"
}
resource "azurerm_cdn_profile" "jevason-cv-cdn-profile" {
name = "jevasoncv-profile"
location = "North Europe"
resource_group_name = azurerm_resource_group.jevason-cv.name
sku = "Standard_Microsoft"
Parameters
-
id
optional computed - string -
location
required - string -
name
required - string -
resource_group_name
required - string -
sku
required - string -
tags
optional - map from string to string -
timeouts
single block
Explanation in Terraform Registry
Manages a CDN Profile to create a collection of CDN Endpoints. !> Be Aware: Azure is rolling out a breaking change on Friday 9th April which may cause issues with the CDN/FrontDoor resources. More information is available in this Github issue - however unfortunately this may necessitate a breaking change to the CDN and FrontDoor resources, more information will be posted in the Github issue as the necessary changes are identified.
Microsoft.Cdn/profiles (Azure Resource Manager)
The profiles in Microsoft.Cdn can be configured in Azure Resource Manager with the resource name Microsoft.Cdn/profiles
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2020-09-01",
"name": "[variables('profileName')]",
"location": "global",
"sku": {
"name": "[parameters('skuName')]"
"type": "Microsoft.Cdn/profiles",
"tags": {},
"location": "WestCentralUs",
"sku": {
"name": "Standard_Verizon"
},
"type": "Microsoft.Cdn/profiles",
"tags": {},
"location": "WestCentralUs",
"sku": {
"name": "Standard_Verizon"
},
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2020-09-01",
"name": "[variables('profileName')]",
"location": "global",
"sku": {
"name": "[parameters('skuName')]"
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2020-09-01",
"name": "[variables('profileName')]",
"location": "global",
"sku": {
"name": "[parameters('skuName')]"
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2019-12-31",
"name": "[parameters('cdnName')]",
"location": "Global",
"sku": {
"name": "Standard_Microsoft"
"type": "Microsoft.Cdn/profiles",
"apiVersion": "2020-09-01",
"name": "[variables('profileName')]",
"location": "global",
"sku": {
"name": "[parameters('skuName')]"
"type": "Microsoft.Cdn/profiles",
"tags": {},
"location": "WestCentralUs",
"sku": {
"name": "Standard_Verizon"
},
Parameters
apiVersion
required - stringlocation
required - stringResource location.
name
required - stringName of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the resource group.
properties
requiredidentity
optionaltype
optional - stringType of managed service identity.
originResponseTimeoutSeconds
optional - integerSend and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns.
sku
requiredname
optional - stringName of the pricing tier.
tags
optional - stringResource tags.
type
required - string
Frequently asked questions
What is Azure CDN Profile?
Azure CDN Profile is a resource for CDN of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure CDN Profile?
For Terraform, the gilyas/infracost, AngellusMortis/boundlexx-terra and asdasdasdasdasdasd1/bcp-challenge-infra source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the srk810/azure-quickstart-templates, openapi-env-test/mk0prd-unified-pipeline-integration-test-specs and openapi-env-test/mk0prd-unified-pipeline-integration-test-specs source code examples are useful. See the Azure Resource Manager Example section for further details.