CDN Endpoint Rules Engine

I keep getting this error

Error: Unsupported block type

  on cdn\main.tf line 18, in resource "azurerm_cdn_endpoint" "brcgs-ngd-mig":
  18:   delivery_rule {

Blocks of type “delivery_rule” are not expected here.

Unsure why it doesn’t like the block.

resource "azurerm_cdn_endpoint" "brcgs-ngd-mig" {

  name                = "brcgs-ngd-${var.environment}"
  profile_name        = azurerm_cdn_profile.ngdmig.name
  location            = "Global"
  resource_group_name = var.resource_group_name
  origin_host_header = "*"
  origin {
    name      = "BRCGS-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?