Skip to content

Commit

Permalink
Merge pull request #6550 from r0bnet/cdn-endpoint-origin-host-header-…
Browse files Browse the repository at this point in the history
…required

CDN Endpoint: make origin_host_header required
  • Loading branch information
tombuildsstuff authored Apr 21, 2020
2 parents a809b44 + 4c6552c commit aed9dcd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 1 addition & 2 deletions azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func resourceArmCdnEndpoint() *schema.Resource {

"origin_host_header": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Required: true,
},

"is_http_allowed": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ resource "azurerm_cdn_endpoint" "test" {
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
Expand All @@ -470,6 +472,8 @@ resource "azurerm_cdn_endpoint" "import" {
location = azurerm_cdn_endpoint.test.location
resource_group_name = azurerm_cdn_endpoint.test.resource_group_name
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
Expand Down Expand Up @@ -544,6 +548,8 @@ resource "azurerm_cdn_endpoint" "test" {
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin2"
host_name = "www.example.com"
Expand Down Expand Up @@ -583,6 +589,8 @@ resource "azurerm_cdn_endpoint" "test" {
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin2"
host_name = "www.example.com"
Expand Down Expand Up @@ -625,6 +633,8 @@ resource "azurerm_cdn_endpoint" "test" {
origin_path = "/origin-path"
probe_path = "/origin-path/probe"
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
Expand Down Expand Up @@ -674,6 +684,8 @@ resource "azurerm_cdn_endpoint" "test" {
is_https_allowed = true
optimization_type = "GeneralWebDelivery"
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
Expand Down Expand Up @@ -763,6 +775,8 @@ resource "azurerm_cdn_endpoint" "test" {
is_http_allowed = %s
is_https_allowed = %s
origin_host_header = "www.example.com"
origin {
name = "acceptanceTestCdnOrigin1"
host_name = "www.example.com"
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/cdn_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ resource "azurerm_cdn_endpoint" "example" {
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
origin_host_header = "www.example.com"
origin {
name = "example"
host_name = "www.example.com"
Expand Down Expand Up @@ -66,7 +68,7 @@ The following arguments are supported:

* `origin` - (Required) 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_host_header` - (Optional) The host header CDN provider will send along with content requests to origins. Defaults to the host name of the origin.
* `origin_host_header` - (Required) The host header CDN provider will send along with content requests to origins. Defaults to the host name of the origin.

* `origin_path` - (Optional) The path used at for origin requests.

Expand Down

0 comments on commit aed9dcd

Please sign in to comment.