简体   繁体   English

CDN 端点规则引擎

[英]CDN Endpoints Rule Engine

I keep getting this error我不断收到此错误

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.

Unsure why it doesn't like the block.不确定为什么它不喜欢块。

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

Can someone point me in the right direction?有人可以指出我正确的方向吗? The block seems to be in the correct place, I'm unsure why this isn't able to deploy.该块似乎位于正确的位置,我不确定为什么无法部署。

There is hardly any information online regarding rules_engine for terraform.网上几乎没有任何关于 terraform 的 rules_engine 的信息。

It does not work with azurerm provider =2.0.0 , you could bind the lastest provider like this or leave out the version:它不适用于azurerm provider =2.0.0 ,您可以像这样绑定最新的提供者或省略版本:

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

Also, global_delivery_policy and delivery_rule are only allowed when Standard_Microsoft SKU is used.此外,仅当使用Standard_Microsoft SKU 时才允许使用global_delivery_policydelivery_rule Ensure that you have sku = "Standard_Microsoft" in your azurerm_cdn_profile .确保您的azurerm_cdn_profilesku = "Standard_Microsoft"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM