All Products
Search
Document Center

CDN:How do I resolve an HTTPS configuration error that occurs when I use Terraform to add a domain name to Alibaba Cloud CDN?

Last Updated:Apr 01, 2026

This article explains how to fix the SSLPri.MissingParameter error that occurs when you add an HTTPS certificate while creating a CDN-accelerated domain name with Terraform.

Error message

Terraform returns the following error:

│ Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_cdn_domain_new.go:576: Resource public1.sige-test3.com SetCdnDomainSSLCertificate Failed!!! [SDK alibaba-cloud-sdk-go ERROR]:
│ SDKError:
│ StatusCode: 400
│ Code: SSLPri.MissingParameter
│ Message: code: 400, The SSLPri parameter is required. request id: F5512B73-4FCE-56DD-8F05-19BA81C701F1
│ Data: {"Code":"SSLPri.MissingParameter","HostId":"cdn.aliyuncs.com","Message":"The SSLPri parameter is required.","Recommend":"https://api.alibabacloud.com/troubleshoot?intl_lang=EN_US&q=SSLPri.MissingParameter&product=Cdn&requestId=F5512B73-4FCE-56DD-8F05-19BA81C701F1","RequestId":"F5512B73-4FCE-56DD-8F05-19BA81C701F1"}
│
│ with alicloud_cdn_domain_new.default,
│ on main.tf line 1, in resource "alicloud_cdn_domain_new" "default":
│ 1: resource "alicloud_cdn_domain_new" "default"

Cause

When using alicloud_cdn_domain_new with cert_type set to cas (Alibaba Cloud Certificate Center), the cert_region parameter must match your account type:

Account typeRequired cert_region valueNotes
International siteap-southeast-1Must be set explicitly. Omitting this parameter causes the SSLPri.MissingParameter error.
China sitecn-hangzhouThis is the default value. No explicit setting required.

For the full parameter reference, see alicloud_cdn_domain_new.

Terraform2025030485

Solution

In your alicloud_cdn_domain_new resource, set cert_type to cas and add the cert_region parameter to the certificate_config block with the value that corresponds to your account type.

The following example shows a complete configuration for an international site account:

# Add an accelerated domain name.
resource "alicloud_cdn_domain_new" "domain" {
  domain_name = "mycdndomain.alicloud-provider.cn"
  cdn_type    = "download"
  scope       = "overseas"
  sources {
    content  = "myoss.oss-rg-china-mainland.aliyuncs.com"
    type     = "oss"
    priority = "20"
    port     = 80
    weight   = "15"
  }
  # Configure a certificate.
  # cert_id: To obtain a certificate ID, purchase or upload a certificate in Alibaba Cloud Certificate Center first.
  # cert_type="cas" uses a certificate from Alibaba Cloud Certificate Center.
  # cert_region="ap-southeast-1" targets Alibaba Cloud Certificate Center for the international site.
  # International site accounts must set cert_region explicitly. China site accounts can omit this parameter.
  certificate_config {
    cert_id     = "1111111"
    cert_name   = "cert-2987438279834"
    cert_type   = "cas"
    cert_region = "ap-southeast-1"
  }
}