Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDN Endpoint: make origin_host_header required #6550

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -455,6 +455,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 @@ -476,6 +478,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 @@ -550,6 +554,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 @@ -589,6 +595,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 @@ -631,6 +639,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 @@ -680,6 +690,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 @@ -769,6 +781,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