terraform/website/source/docs/providers/azurerm/r/cdn_endpoint.html.markdown

95 lines
3.6 KiB
Markdown
Raw Normal View History

---
layout: "azurerm"
page_title: "Azure Resource Manager: azurerm_cdn_endpoint"
sidebar_current: "docs-azurerm-resource-cdn-endpoint"
description: |-
Create a CDN Endpoint entity.
---
# azurerm\_cdn\_endpoint
A CDN Endpoint is the entity within a CDN Profile containing configuration information regarding caching behaviors and origins. The CDN Endpoint is exposed using the URL format <endpointname>.azureedge.net by default, but custom domains can also be created.
## Example Usage
```
resource "azurerm_resource_group" "test" {
name = "acceptanceTestResourceGroup1"
location = "West US"
}
resource "azurerm_cdn_profile" "test" {
name = "acceptanceTestCdnProfile1"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
}
resource "azurerm_cdn_endpoint" "test" {
name = "acceptanceTestCdnEndpoint1"
profile_name = "${azurerm_cdn_profile.test.name}"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
}
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) Specifies the name of the CDN Endpoint. Changing this forces a
new resource to be created.
* `resource_group_name` - (Required) The name of the resource group in which to
create the CDN Endpoint.
* `profile_name` - (Required) The CDN Profile to which to attach the CDN Endpoint.
* `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
* `origin_host_header` - (Optional) The host header CDN provider will send along with content requests to origins. Defaults to the host name of the origin.
* `is_http_allowed` - (Optional) Defaults to `true`.
* `is_https_allowed` - (Optional) Defaults to `true`.
* `origin` - (Optional) The set of origins of the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options.
Each `origin` block supports fields documented below.
* `origin_path` - (Optional) The path used at for origin requests.
* `querystring_caching_behaviour` - (Optional) Sets query string caching behavior. Allowed values are `IgnoreQueryString`, `BypassCaching` and `UseQueryString`. Defaults to `IgnoreQueryString`.
* `content_types_to_compress` - (Optional) An array of strings that indicates a content types on which compression will be applied. The value for the elements should be MIME types.
* `is_compression_enabled` - (Optional) Indicates whether compression is to be enabled. Defaults to false.
* `tags` - (Optional) A mapping of tags to assign to the resource.
The `origin` block supports:
* `name` - (Required) The name of the origin. This is an arbitrary value. However, this value needs to be unique under endpoint.
* `host_name` - (Required) A string that determines the hostname/IP address of the origin server. This string could be a domain name, IPv4 address or IPv6 address.
* `http_port` - (Optional) The HTTP port of the origin. Defaults to null. When null, 80 will be used for HTTP.
* `https_port` - (Optional) The HTTPS port of the origin. Defaults to null. When null, 443 will be used for HTTPS.
## Attributes Reference
The following attributes are exported:
provider/azurerm: enable import of more resources (#10195) * provider/azurerm: support import of virtual_machine TF_ACC=1 go test ./builtin/providers/azurerm -v -run "TestAccAzureRMVirtualMachine_(basic|import)" -timeout 120m === RUN TestAccAzureRMVirtualMachine_importBasic --- PASS: TestAccAzureRMVirtualMachine_importBasic (561.08s) === RUN TestAccAzureRMVirtualMachine_basicLinuxMachine --- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine (677.49s) === RUN TestAccAzureRMVirtualMachine_basicLinuxMachine_disappears --- PASS: TestAccAzureRMVirtualMachine_basicLinuxMachine_disappears (674.21s) === RUN TestAccAzureRMVirtualMachine_basicWindowsMachine --- PASS: TestAccAzureRMVirtualMachine_basicWindowsMachine (1105.18s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 3017.970s * provider/azurerm: support import of servicebus_namespace TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMServiceBusNamespace_import -timeout 120m === RUN TestAccAzureRMServiceBusNamespace_importBasic --- PASS: TestAccAzureRMServiceBusNamespace_importBasic (345.80s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 345.879s * provider/azurerm: document import of servicebus_topic and servicebus_subscription * provider/azurerm: support import of dns record resources TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMDns[A-z]+Record_importBasic -timeout 120m === RUN TestAccAzureRMDnsARecord_importBasic --- PASS: TestAccAzureRMDnsARecord_importBasic (102.84s) === RUN TestAccAzureRMDnsAAAARecord_importBasic --- PASS: TestAccAzureRMDnsAAAARecord_importBasic (100.59s) === RUN TestAccAzureRMDnsCNameRecord_importBasic --- PASS: TestAccAzureRMDnsCNameRecord_importBasic (98.94s) === RUN TestAccAzureRMDnsMxRecord_importBasic --- PASS: TestAccAzureRMDnsMxRecord_importBasic (107.30s) === RUN TestAccAzureRMDnsNsRecord_importBasic --- PASS: TestAccAzureRMDnsNsRecord_importBasic (98.55s) === RUN TestAccAzureRMDnsSrvRecord_importBasic --- PASS: TestAccAzureRMDnsSrvRecord_importBasic (100.19s) === RUN TestAccAzureRMDnsTxtRecord_importBasic --- PASS: TestAccAzureRMDnsTxtRecord_importBasic (97.49s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 706.000s * provider/azurerm: support import of cdn_endpoint, document profile import TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMCdnEndpoint_import -timeout 120m === RUN TestAccAzureRMCdnEndpoint_importWithTags --- PASS: TestAccAzureRMCdnEndpoint_importWithTags (207.83s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 207.907s * provider/azurerm: support import of sql_server, fix sql_firewall import TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMSql[A-z]+_importBasic -timeout 120m === RUN TestAccAzureRMSqlFirewallRule_importBasic --- PASS: TestAccAzureRMSqlFirewallRule_importBasic (153.72s) === RUN TestAccAzureRMSqlServer_importBasic --- PASS: TestAccAzureRMSqlServer_importBasic (119.83s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 273.630s
2016-11-22 13:13:11 +01:00
* `id` - The CDN Endpoint ID.
## Import
CDN Endpoints can be imported using the `resource id`, e.g.
```
terraform import azurerm_cdn_endpoint.test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Cdn/profiles/myprofile1/endpoints/myendpoint1
```