alicloud_dcdn_waf_policy_domain_attachment

Provides a DCDN Waf Policy Domain Attachment resource.

For information about DCDN Waf Policy Domain Attachment and how to use it, see What is Waf Policy Domain Attachment.

Example Usage

Basic Usage

variable "domain_name" {
  default = "tf-example.com"
}

variable "name" {
  default = "tf_example"
}

resource "random_integer" "default" {
  min = 10000
  max = 99999
}

resource "alicloud_dcdn_domain" "example" {
  domain_name = "${var.domain_name}-${random_integer.default.result}"
  scope       = "overseas"
  sources {
    content  = "1.1.1.1"
    port     = "80"
    priority = "20"
    type     = "ipaddr"
    weight   = "10"
  }
}

resource "alicloud_dcdn_waf_domain" "example" {
  domain_name   = alicloud_dcdn_domain.example.domain_name
  client_ip_tag = "X-Forwarded-For"
}

resource "alicloud_dcdn_waf_policy" "example" {
  defense_scene = "waf_group"
  policy_name   = "${var.name}_${random_integer.default.result}"
  policy_type   = "custom"
  status        = "on"
}

resource "alicloud_dcdn_waf_policy_domain_attachment" "example" {
  domain_name = alicloud_dcdn_waf_domain.example.domain_name
  policy_id   = alicloud_dcdn_waf_policy.example.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

DCDN Waf Policy Domain Attachment can be imported using the id, e.g.

$ terraform import alicloud_dcdn_waf_policy_domain_attachment.example policy_id:domain_name