alicloud_cdn_domain_config

Provides a Cdn Domain Config resource.

For information about Cdn Domain Config and how to use it, see What is Domain Config

Example Usage

Basic Usage

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

# Create a new Domain config.
resource "alicloud_cdn_domain_new" "domain" {
  domain_name = "mycdndomain-${random_integer.default.result}.alicloud-provider.cn"
  cdn_type    = "web"
  scope       = "overseas"
  sources {
    content  = "1.1.1.1"
    type     = "ipaddr"
    priority = "20"
    port     = 80
    weight   = "15"
  }
}

resource "alicloud_cdn_domain_config" "config" {
  domain_name   = alicloud_cdn_domain_new.domain.domain_name
  function_name = "ip_allow_list_set"
  function_args {
    arg_name  = "ip_list"
    arg_value = "110.110.110.110"
  }
}

Argument Reference

The following arguments are supported:

function_args

The function_args block supports the following:

Attributes Reference

The following attributes are exported:

Import

CDN domain config can be imported using the id, e.g.

terraform import alicloud_cdn_domain_config.example <domain_name>:<function_name>:<config_id>

NOTE: Before provider version 1.132.0, CDN domain config can be imported using the id, e.g.

$ terraform import alicloud_cdn_domain_config.example <domain_name>:<function_name>