» alicloud_cdn_domain_new
Provides a CDN Accelerated Domain resource. This resource is based on CDN's new version OpenAPI.
For information about Cdn Domain New and how to use it, see Add a domain.
NOTE: Available in v1.34.0+.
» Example Usage
Basic Usage
# Create a new Domain.
resource "alicloud_cdn_domain_new" "domain" {
domain_name = "terraform.test.com"
cdn_type = "web"
scope="overseas"
sources {
content = "1.1.1.1"
type = "ipaddr"
priority = 20
port = 80
weight = 10
}
}
» Argument Reference
The following arguments are supported:
-
domain_name
- (Required) Name of the accelerated domain. This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-", and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time. Suffix.sh
and.tel
are not supported. -
cdn_type
- (Required, ForceNew) Cdn type of the accelerated domain. Valid values areweb
,download
,video
. -
scope
- (Optional) Scope of the accelerated domain. Valid values aredomestic
,overseas
,global
. Default value isdomestic
. This parameter's setting is valid Only for the international users and domestic L3 and above users . -
sources
- (Optional, Type: list) The source address list of the accelerated domain. Defaults to null. See Block Sources.
» Block sources
The sources
block supports the following:
-
content
- (Required) The adress of source. Valid values can be ip or doaminName. Each item'scontent
can not be repeated. -
type
- (Required) The type of the source. Valid values areipaddr
,domain
andoss
. -
port
- (Optional, Type: int) The port of source. Valid values are443
and80
. Default value is80
. -
priority
- (Optional, Type: int) Priority of the source. Valid values are0
and100
. Default value is20
. -
weight
- (Optional, Type: int) Weight of the source. Valid values are from0
to100
. Default value is10
, but if type isipaddr
, the value can only be10
.
» Attributes Reference
The following attributes are exported:
-
id
- The cdn domain id. The value is same as the domain name.
» Import
CDN domain can be imported using the id, e.g.
terraform import alicloud_cdn_domain_new.example cdn-abc123456