CDN端点规则引擎

时间:2020-10-16 07:42:42

标签: azure terraform-provider-azure

我不断收到此错误

Error: Unsupported block type

  on cdn\main.tf line 18, in resource "azurerm_cdn_endpoint" "example":
  18:   delivery_rule {
Blocks of type “delivery_rule” are not expected here.

不确定为什么不喜欢该方块。

resource "azurerm_cdn_endpoint" "*" {

  name                = "example"
  profile_name        = azurerm_cdn_profile.example.name
  location            = "Global"
  resource_group_name = var.resource_group_name
  origin_host_header = "*"
  origin {
    name      = "Example-Web"
    host_name = "*"
  }

  delivery_rule {
      name = "HttpsRedirect"
      order = 1
  request_scheme_condition  {
          match_values = ["HTTP"]
          operator = "Equal"
      }
  url_redirect_action {
          redirect_type = "Found"
          protocol = "Https"
      }
  }
Am using azurerm provider =2.0.0

有人可以指出我正确的方向吗?障碍似乎在正确的位置,我不确定为什么它无法部署。

在线几乎没有有关Terraform的rules_engine的信息。

1 个答案:

答案 0 :(得分:0)

它不适用于azurerm提供程序=2.0.0,您可以像这样绑定最新的提供程序或忽略版本:

provider "azurerm" {
        
     features {}
    
     version = "=2.32.0"
      
}

此外,仅在使用global_delivery_policy SKU时允许delivery_ruleStandard_Microsoft。确保您有sku = "Standard_Microsoft" azurerm_cdn_profile