Skip to content

Commit

Permalink
feat(cdn): [118298226] add more origin type (#2812)
Browse files Browse the repository at this point in the history
* add more origin type

* add changelog
  • Loading branch information
hellertang authored Sep 6, 2024
1 parent a9be6ad commit e68665a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .changelog/2812.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_cdn_domain: Add more origin type
```
41 changes: 35 additions & 6 deletions tencentcloud/services/cdn/extension_cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ const (
CDN_SERVICE_TYPE_HYBIRD = "hybrid"
CDN_SERVICE_TYPE_DYNAMIC = "dynamic"

CDN_ORIGIN_TYPE_DOMAIN = "domain"
CDN_ORIGIN_TYPE_COS = "cos"
CDN_ORIGIN_TYPE_IP = "ip"
CDN_ORIGIN_TYPE_IPV6 = "ipv6"
CDN_ORIGIN_TYPE_IP_IPV6 = "ip_ipv6"
CDN_ORIGIN_TYPE_DOMAIN = "domain"
CDN_ORIGIN_TYPE_DOMAIN_V6 = "domainv6"
CDN_ORIGIN_TYPE_COS = "cos"
CDN_ORIGIN_TYPE_THIRD_PARTY = "third_party"
CDN_ORIGIN_TYPE_IGTM = "igtm"
CDN_ORIGIN_TYPE_IP = "ip"
CDN_ORIGIN_TYPE_IPV6 = "ipv6"
CDN_ORIGIN_TYPE_IP_IPV6 = "ip_ipv6"
CDN_ORIGIN_TYPE_IP_DOMAIN = "ip_domain"
CDN_ORIGIN_TYPE_IP_DOMAINV6 = "ip_domainv6"
CDN_ORIGIN_TYPE_IPV6_DOMAIN = "ipv6_domain"
CDN_ORIGIN_TYPE_IPV6_DOMAINV6 = "ipv6_domainv6"
CDN_ORIGIN_TYPE_DOMAIN_DOMAINV6 = "domain_domainv6"
CDN_ORIGIN_TYPE_IP_IPV6_DOMAIN = "ip_ipv6_domain"
CDN_ORIGIN_TYPE_IP_IPV6_DOMAINV6 = "ip_ipv6_domainv6"
CDN_ORIGIN_TYPE_IP_DOMAIN_DOMAINV6 = "ip_domain_domainv6"
CDN_ORIGIN_TYPE_IPV6_DOMAIN_DOMAINV6 = "ipv6_domain_domainv6"
CDN_ORIGIN_TYPE_IP_IPV6_DOMAIN_DOMAINV6 = "ip_ipv6_domain_domainv6"

CDN_ORIGIN_PULL_PROTOCOL_HTTP = "http"
CDN_ORIGIN_PULL_PROTOCOL_HTTPS = "https"
Expand Down Expand Up @@ -55,15 +68,31 @@ var CDN_SERVICE_TYPE = []string{

var CDN_ORIGIN_TYPE = []string{
CDN_ORIGIN_TYPE_DOMAIN,
CDN_ORIGIN_TYPE_DOMAIN_V6,
CDN_ORIGIN_TYPE_COS,
CDN_ORIGIN_TYPE_THIRD_PARTY,
CDN_ORIGIN_TYPE_IGTM,
CDN_ORIGIN_TYPE_IP,
CDN_ORIGIN_TYPE_IPV6,
CDN_ORIGIN_TYPE_IP_IPV6,
CDN_ORIGIN_TYPE_IP_DOMAIN,
CDN_ORIGIN_TYPE_IP_DOMAINV6,
CDN_ORIGIN_TYPE_IPV6_DOMAIN,
CDN_ORIGIN_TYPE_IPV6_DOMAINV6,
CDN_ORIGIN_TYPE_DOMAIN_DOMAINV6,
CDN_ORIGIN_TYPE_IP_IPV6_DOMAIN,
CDN_ORIGIN_TYPE_IP_IPV6_DOMAINV6,
CDN_ORIGIN_TYPE_IP_DOMAIN_DOMAINV6,
CDN_ORIGIN_TYPE_IPV6_DOMAIN_DOMAINV6,
CDN_ORIGIN_TYPE_IP_IPV6_DOMAIN_DOMAINV6,
}

var CDN_BACKUP_ORIGIN_TYPE = []string{
CDN_ORIGIN_TYPE_IP,
CDN_ORIGIN_TYPE_DOMAIN,
CDN_ORIGIN_TYPE_IP,
CDN_ORIGIN_TYPE_IPV6_DOMAIN,
CDN_ORIGIN_TYPE_IP_IPV6,
CDN_ORIGIN_TYPE_IP_IPV6_DOMAIN,
}

var CDN_ORIGIN_PULL_PROTOCOL = []string{
Expand Down
8 changes: 6 additions & 2 deletions tencentcloud/services/cdn/resource_tc_cdn_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
Type: schema.TypeString,
Required: true,
ValidateFunc: tccommon.ValidateAllowedStringValue(CDN_ORIGIN_TYPE),
Description: "Master origin server type. The following types are supported: `domain`: domain name type, `cos`: COS origin, `ip`: IP list used as origin server, `ipv6`: origin server list is a single IPv6 address, `ip_ipv6`: origin server list is multiple IPv4 addresses and an IPv6 address.",
Description: "Master origin server type. The following types are supported: `domain`: Domain name, `domainv6`: IPv6 domain name, `cos`: COS bucket address, `third_party`: Third-party object storage origin, " +
"`igtm`: IGTM origin, `ip`: IP address, `ipv6`: One IPv6 address, `ip_ipv6`: Multiple IPv4 addresses and one IPv6 address, " +
"`ip_domain`: IP addresses and domain names (only available to beta users), `ip_domainv6`: Multiple IPv4 addresses and one IPv6 domain name, `ipv6_domain`: Multiple IPv6 addresses and one domain name, `ipv6_domainv6`: Multiple IPv6 addresses and one IPv6 domain name, " +
"`domain_domainv6`: Multiple IPv4 domain names and one IPv6 domain name, `ip_ipv6_domain`: Multiple IPv4 and IPv6 addresses and one domain name, `ip_ipv6_domainv6`: Multiple IPv4 and IPv6 addresses and one IPv6 domain name, `ip_domain_domainv6`: Multiple IPv4 addresses and IPv4 domain names and one IPv6 domain name, " +
"`ipv6_domain_domainv6`: Multiple IPv4 domain names and IPv6 addresses and one IPv6 domain name, `ip_ipv6_domain_domainv6`: Multiple IPv4 and IPv6 addresses and IPv4 domain names and one IPv6 domain name.",
},
"origin_list": {
Type: schema.TypeList,
Expand Down Expand Up @@ -120,7 +124,7 @@ func ResourceTencentCloudCdnDomain() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ValidateFunc: tccommon.ValidateAllowedStringValue(CDN_BACKUP_ORIGIN_TYPE),
Description: "Backup origin server type, which supports the following types: `domain`: domain name type, `ip`: IP list used as origin server.",
Description: "Backup origin server type, which supports the following types: `domain`: domain name type, `ip`: IP list used as origin server, `ipv6_domain`: Multiple IPv6 addresses and one domain name, `ip_ipv6`: Multiple IPv4 addresses and one IPv6 address, `ip_ipv6_domain`: Multiple IPv4 and IPv6 addresses and one domain name.",
},
"backup_origin_list": {
Type: schema.TypeList,
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/cdn_domain.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ The `origin_pull_timeout` object supports the following:
The `origin` object supports the following:

* `origin_list` - (Required, List) Master origin server list. Valid values can be ip or domain name. When modifying the origin server, you need to enter the corresponding `origin_type`.
* `origin_type` - (Required, String) Master origin server type. The following types are supported: `domain`: domain name type, `cos`: COS origin, `ip`: IP list used as origin server, `ipv6`: origin server list is a single IPv6 address, `ip_ipv6`: origin server list is multiple IPv4 addresses and an IPv6 address.
* `origin_type` - (Required, String) Master origin server type. The following types are supported: `domain`: Domain name, `domainv6`: IPv6 domain name, `cos`: COS bucket address, `third_party`: Third-party object storage origin, `igtm`: IGTM origin, `ip`: IP address, `ipv6`: One IPv6 address, `ip_ipv6`: Multiple IPv4 addresses and one IPv6 address, `ip_domain`: IP addresses and domain names (only available to beta users), `ip_domainv6`: Multiple IPv4 addresses and one IPv6 domain name, `ipv6_domain`: Multiple IPv6 addresses and one domain name, `ipv6_domainv6`: Multiple IPv6 addresses and one IPv6 domain name, `domain_domainv6`: Multiple IPv4 domain names and one IPv6 domain name, `ip_ipv6_domain`: Multiple IPv4 and IPv6 addresses and one domain name, `ip_ipv6_domainv6`: Multiple IPv4 and IPv6 addresses and one IPv6 domain name, `ip_domain_domainv6`: Multiple IPv4 addresses and IPv4 domain names and one IPv6 domain name, `ipv6_domain_domainv6`: Multiple IPv4 domain names and IPv6 addresses and one IPv6 domain name, `ip_ipv6_domain_domainv6`: Multiple IPv4 and IPv6 addresses and IPv4 domain names and one IPv6 domain name.
* `backup_origin_list` - (Optional, List) Backup origin server list. Valid values can be ip or domain name. When modifying the backup origin server, you need to enter the corresponding `backup_origin_type`.
* `backup_origin_type` - (Optional, String) Backup origin server type, which supports the following types: `domain`: domain name type, `ip`: IP list used as origin server.
* `backup_origin_type` - (Optional, String) Backup origin server type, which supports the following types: `domain`: domain name type, `ip`: IP list used as origin server, `ipv6_domain`: Multiple IPv6 addresses and one domain name, `ip_ipv6`: Multiple IPv4 addresses and one IPv6 address, `ip_ipv6_domain`: Multiple IPv4 and IPv6 addresses and one domain name.
* `backup_server_name` - (Optional, String) Host header used when accessing the backup origin server. If left empty, the ServerName of master origin server will be used by default.
* `cos_private_access` - (Optional, String) When OriginType is COS, you can specify if access to private buckets is allowed. Valid values are `on` and `off`. and default value is `off`.
* `origin_pull_protocol` - (Optional, String) Origin-pull protocol configuration. `http`: forced HTTP origin-pull, `follow`: protocol follow origin-pull, `https`: forced HTTPS origin-pull. This only supports origin server port 443 for origin-pull.
Expand Down

0 comments on commit e68665a

Please sign in to comment.