ALIYUN::CAS::UserCertificate类型用于上传证书。
语法
{
"Type": "ALIYUN::CAS::UserCertificate",
"Properties": {
"Cert": String,
"CertificateName": String,
"EncryptCert": String,
"EncryptPrivateKey": String,
"Key": String,
"ResourceGroupId": String,
"ResourceId": String,
"SignCert": String,
"SignPrivateKey": String,
"Tags": List
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Cert |
String |
否 |
否 |
PEM 格式的证书内容。 |
无 |
|
CertificateName |
String |
否 |
否 |
自定义证书名称。 |
最大支持字符长度为 128,支持所有字符类型,包括字母、数字和下划线。 同一用户下证书名称不能重复。 |
|
EncryptCert |
String |
否 |
否 |
PEM 格式的加密证书内容。 |
无 |
|
EncryptPrivateKey |
String |
否 |
否 |
PEM 格式的加密证书私钥内容。 |
无 |
|
Key |
String |
否 |
否 |
PEM 格式的证书私钥内容。 |
无 |
|
ResourceGroupId |
String |
否 |
否 |
资源组 ID。 |
无 |
|
ResourceId |
String |
否 |
否 |
资源 ID。 |
无 |
|
SignCert |
String |
否 |
否 |
PEM 格式的签名证书内容。 |
无 |
|
SignPrivateKey |
String |
否 |
否 |
PEM 格式的签名证书私钥内容。 |
无 |
|
Tags |
List |
否 |
否 |
证书的标签。 |
更多信息,请参考Tags属性。 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Key |
String |
是 |
否 |
标签键。 |
无 |
|
Value |
String |
否 |
否 |
标签值。 |
无 |
返回值
Fn::GetAtt
-
SignCert:PEM 格式的签名证书内容。
-
ResourceGroupId:资源组 ID。
-
CertId:证书 ID。
-
EncryptCert:PEM 格式的加密证书内容。
-
SignPrivateKey:PEM 格式的签名证书私钥内容。
-
Cert:PEM 格式的证书内容。
-
EncryptPrivateKey:PEM 格式的加密证书私钥内容。
-
CertificateName:自定义证书名称,最大支持字符长度为 128,支持所有字符类型,包括字母、数字和下划线。
-
Tags:资源的标记。
-
Key:PEM 格式的证书私钥内容。
示例
场景 1 :上传一张标准SSL证书到证书管理服务。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 上传一张标准SSL证书到证书管理服务。
en: Upload a standard SSL certificate to Certificate Management Service.
Parameters:
CertificateName:
Type: String
Label:
zh-cn: 证书名称
en: Certificate Name
Description:
zh-cn: >-
自定义证书名称,最大支持128个字符。
同一用户下证书名称不能重复。
en: >-
Custom certificate name, up to 128 characters.
Must be unique within the same user account.
MaxLength: 128
MinLength: 1
Cert:
Type: String
Label:
zh-cn: 证书内容(PEM格式)
en: Certificate Content (PEM)
Description:
zh-cn: >-
PEM格式的证书内容,以-----BEGIN CERTIFICATE-----开头,
以-----END CERTIFICATE-----结尾。
en: >-
Certificate content in PEM format, starting with
-----BEGIN CERTIFICATE----- and ending with -----END CERTIFICATE-----.
Key:
Type: String
Label:
zh-cn: 证书私钥(PEM格式)
en: Private Key (PEM)
Description:
zh-cn: >-
PEM格式的证书私钥内容,以-----BEGIN RSA PRIVATE KEY-----
或-----BEGIN EC PRIVATE KEY-----开头。
en: >-
Private key content in PEM format, starting with
-----BEGIN RSA PRIVATE KEY----- or -----BEGIN EC PRIVATE KEY-----.
NoEcho: true
Resources:
Certificate:
Type: ALIYUN::CAS::UserCertificate
Properties:
CertificateName:
Ref: CertificateName
Cert:
Ref: Cert
Key:
Ref: Key
Outputs:
CertId:
Label:
zh-cn: 证书ID
en: Certificate ID
Description:
zh-cn: 上传成功后生成的证书唯一标识,可用于绑定到SLB、CDN、API网关等服务。
en: The unique certificate ID generated after upload, used to bindto SLB, CDN, API Gateway, etc.
Value:
Fn::GetAtt:
- Certificate
- CertId
CertificateName:
Label:
zh-cn: 证书名称
en: Certificate Name
Value:
Fn::GetAtt:
- Certificate
- CertificateName{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "上传一张标准SSL证书到证书管理服务。",
"en": "Upload a standard SSL certificate to Certificate Management Service."
},
"Parameters": {
"CertificateName": {
"Type": "String",
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Description": {
"zh-cn": "自定义证书名称,最大支持128个字符。同一用户下证书名称不能重复。",
"en": "Custom certificate name, up to 128 characters. Must be unique within the same user account."
},
"MaxLength": 128,
"MinLength": 1
},
"Cert": {
"Type": "String",
"Label": {
"zh-cn": "证书内容(PEM格式)",
"en": "Certificate Content (PEM)"
},
"Description": {
"zh-cn": "PEM格式的证书内容,以-----BEGIN CERTIFICATE-----开头,以-----END CERTIFICATE-----结尾。",
"en": "Certificate content in PEM format, starting with -----BEGIN CERTIFICATE----- and ending with -----END CERTIFICATE-----."
}
},
"Key": {
"Type": "String",
"Label": {
"zh-cn": "证书私钥(PEM格式)",
"en": "Private Key (PEM)"
},
"Description": {
"zh-cn": "PEM格式的证书私钥内容,以-----BEGIN RSA PRIVATE KEY-----或-----BEGIN EC PRIVATE KEY-----开头。",
"en": "Private key content in PEM format, starting with -----BEGIN RSA PRIVATE KEY----- or -----BEGIN EC PRIVATE KEY-----."
},
"NoEcho": true
}
},
"Resources": {
"Certificate": {
"Type": "ALIYUN::CAS::UserCertificate",
"Properties": {
"CertificateName": {
"Ref": "CertificateName"
},
"Cert": {
"Ref": "Cert"
},
"Key": {
"Ref": "Key"
}
}
}
},
"Outputs": {
"CertId": {
"Label": {
"zh-cn": "证书ID",
"en": "Certificate ID"
},
"Description": {
"zh-cn": "上传成功后生成的证书唯一标识,可用于绑定到SLB、CDN、API网关等服务。",
"en": "The unique certificate ID generated after upload, used to bind to SLB, CDN, API Gateway, etc."
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"CertId"
]
}
},
"CertificateName": {
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"CertificateName"
]
}
}
}
}场景 2 :上传标准SSL证书并配置资源组和标签,实现企业级证书管理。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 上传SSL证书并配置资源组和标签,实现企业级证书管理。
en: Upload an SSL certificate with resource group and tags for enterprise certificate management.
Parameters:
CertificateName:
Type: String
Label:
zh-cn: 证书名称
en: Certificate Name
Description:
zh-cn: >-
自定义证书名称,最大支持128个字符。
建议使用“域名-环境-用途”的命名规范,如 example.com-prod-web。
en: >-
Custom certificate name, up to 128 characters.
Recommended naming: domain-env-usage, e.g. example.com-prod-web.
MaxLength: 128
MinLength: 1
Cert:
Type: String
Label:
zh-cn: 证书内容(PEM格式)
en: Certificate Content (PEM)
Description:
zh-cn: PEM格式的证书内容。如包含证书链,请将服务器证书放在第一位,中间证书放在后面。
en: Certificate content in PEM format. If including a chain, place the server certificate first.
Key:
Type: String
Label:
zh-cn: 证书私钥(PEM格式)
en: Private Key (PEM)
Description:
zh-cn: PEM格式的证书私钥内容。
en: Private key content in PEM format.
NoEcho: true
ResourceGroupId:
Type: String
Label:
zh-cn: 资源组
en: Resource Group
Description:
zh-cn: 证书所属的资源组,用于权限隔离和成本管理。
en: The resource group for permission isolation and cost management.
AssociationProperty: ALIYUN::ResourceManager::ResourceGroup
Default: Null
Tags:
Type: Json
Label:
zh-cn: 标签
en: Tags
Description:
zh-cn: 证书的标签,用于分类管理。最多支持20个标签。
en: Certificate tags for classification. Up to 20 tags supported.
AssociationProperty: List[Parameters]
AssociationPropertyMetadata:
ListMetadata:
Order:
- Key
- Value
Parameters:
Key:
Label:
zh-cn: 标签键
en: Tag Key
Type: String
Required: true
Value:
Label:
zh-cn: 标签值
en: Tag Value
Type: String
Required: false
MaxLength: 20
Default:
- Key: Environment
Value: Production
- Key: Team
Value: Platform
Resources:
Certificate:
Type: ALIYUN::CAS::UserCertificate
Properties:
CertificateName:
Ref: CertificateName
Cert:
Ref: Cert
Key:
Ref: Key
ResourceGroupId:
Ref: ResourceGroupId
Tags:
Ref: Tags
Outputs:
CertId:
Label:
zh-cn: 证书ID
en: Certificate ID
Value:
Fn::GetAtt:
- Certificate
- CertId
CertificateName:
Label:
zh-cn: 证书名称
en: Certificate Name
Value:
Fn::GetAtt:
- Certificate
- CertificateName
ResourceGroupId:
Label:
zh-cn: 资源组ID
en: Resource Group ID
Value:
Fn::GetAtt:
- Certificate
- ResourceGroupId
Tags:
Label:
zh-cn: 标签
en: Tags
Value:
Fn::GetAtt:
- Certificate
- Tags{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "上传SSL证书并配置资源组和标签,实现企业级证书管理。",
"en": "Upload an SSL certificate with resource group and tags for enterprise certificate management."
},
"Parameters": {
"CertificateName": {
"Type": "String",
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Description": {
"zh-cn": "自定义证书名称,最大支持128个字符。建议使用“域名-环境-用途”的命名规范,如 example.com-prod-web。",
"en": "Custom certificate name, up to 128 characters. Recommended naming: domain-env-usage, e.g. example.com-prod-web."
},
"MaxLength": 128,
"MinLength": 1
},
"Cert": {
"Type": "String",
"Label": {
"zh-cn": "证书内容(PEM格式)",
"en": "Certificate Content (PEM)"
},
"Description": {
"zh-cn": "PEM格式的证书内容。如包含证书链,请将服务器证书放在第一位,中间证书放在后面。",
"en": "Certificate content in PEM format. If including a chain, place the server certificate first."
}
},
"Key": {
"Type": "String",
"Label": {
"zh-cn": "证书私钥(PEM格式)",
"en": "Private Key (PEM)"
},
"Description": {
"zh-cn": "PEM格式的证书私钥内容。",
"en": "Private key content in PEM format."
},
"NoEcho": true
},
"ResourceGroupId": {
"Type": "String",
"Label": {
"zh-cn": "资源组",
"en": "Resource Group"
},
"Description": {
"zh-cn": "证书所属的资源组,用于权限隔离和成本管理。",
"en": "The resource group for permission isolation and cost management."
},
"AssociationProperty": "ALIYUN::ResourceManager::ResourceGroup",
"Default": null
},
"Tags": {
"Type": "Json",
"Label": {
"zh-cn": "标签",
"en": "Tags"
},
"Description": {
"zh-cn": "证书的标签,用于分类管理。最多支持20个标签。",
"en": "Certificate tags for classification. Up to 20 tags supported."
},
"AssociationProperty": "List[Parameters]",
"AssociationPropertyMetadata": {
"ListMetadata": {
"Order": [
"Key",
"Value"
]
},
"Parameters": {
"Key": {
"Label": {
"zh-cn": "标签键",
"en": "Tag Key"
},
"Type": "String",
"Required": true
},
"Value": {
"Label": {
"zh-cn": "标签值",
"en": "Tag Value"
},
"Type": "String",
"Required": false
}
}
},
"MaxLength": 20,
"Default": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Team",
"Value": "Platform"
}
]
}
},
"Resources": {
"Certificate": {
"Type": "ALIYUN::CAS::UserCertificate",
"Properties": {
"CertificateName": {
"Ref": "CertificateName"
},
"Cert": {
"Ref": "Cert"
},
"Key": {
"Ref": "Key"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"Tags": {
"Ref": "Tags"
}
}
}
},
"Outputs": {
"CertId": {
"Label": {
"zh-cn": "证书ID",
"en": "Certificate ID"
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"CertId"
]
}
},
"CertificateName": {
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"CertificateName"
]
}
},
"ResourceGroupId": {
"Label": {
"zh-cn": "资源组ID",
"en": "Resource Group ID"
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"ResourceGroupId"
]
}
},
"Tags": {
"Label": {
"zh-cn": "标签",
"en": "Tags"
},
"Value": {
"Fn::GetAtt": [
"Certificate",
"Tags"
]
}
}
}
}场景 3 :上传国密SM2双证书并部署到API网关HTTPS域名。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 上传国密SM2双证书并部署到API网关HTTPS域名。
en: Upload SM2 dual certificates and deploy to an API Gateway HTTPS domain.
Parameters:
CertificateName:
Type: String
Label:
zh-cn: 证书名称
en: Certificate Name
Description:
zh-cn: 国密双证书的名称,最大支持128个字符。
en: Name of the SM2 dual certificate, up to 128 characters.
MaxLength: 128
MinLength: 1
SignCert:
Type: String
Label:
zh-cn: 签名证书内容(PEM格式)
en: Signing Certificate (PEM)
Description:
zh-cn: PEM格式的SM2签名证书内容,用于数字签名验证。
en: SM2 signing certificate content in PEM format for digital signature verification.
SignPrivateKey:
Type: String
Label:
zh-cn: 签名证书私钥(PEM格式)
en: Signing Private Key (PEM)
Description:
zh-cn: PEM格式的SM2签名证书私钥内容。
en: SM2 signing certificate private key in PEM format.
NoEcho: true
EncryptCert:
Type: String
Label:
zh-cn: 加密证书内容(PEM格式)
en: Encryption Certificate (PEM)
Description:
zh-cn: PEM格式的SM2加密证书内容,用于数据加密传输。
en: SM2 encryption certificate content in PEM format for data encryption.
EncryptPrivateKey:
Type: String
Label:
zh-cn: 加密证书私钥(PEM格式)
en: Encryption Private Key (PEM)
Description:
zh-cn: PEM格式的SM2加密证书私钥内容。
en: SM2 encryption certificate private key in PEM format.
NoEcho: true
DomainName:
Type: String
Label:
zh-cn: API网关域名
en: API Gateway Domain
Description:
zh-cn: >-
需要绑定国密证书的域名,例如api.example.com。
需已完成域名备案和DNS解析。
en: >-
The domain to bindthe SM2 certificate, e.g. api.example.com.
DNS resolution and ICP filing must be completed.
AllowedPattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$'
ResourceGroupId:
Type: String
Label:
zh-cn: 资源组
en: Resource Group
Description:
zh-cn: 证书和域名所属的资源组。
en: The resource group for the certificate and domain.
AssociationProperty: ALIYUN::ResourceManager::ResourceGroup
Default: Null
Resources:
SM2Certificate:
Type: ALIYUN::CAS::UserCertificate
Properties:
CertificateName:
Ref: CertificateName
SignCert:
Ref: SignCert
SignPrivateKey:
Ref: SignPrivateKey
EncryptCert:
Ref: EncryptCert
EncryptPrivateKey:
Ref: EncryptPrivateKey
ResourceGroupId:
Ref: ResourceGroupId
Tags:
- Key: CertType
Value: SM2-Dual
- Key: Compliance
Value: GM/T
Domain:
Type: ALIYUN::APIG::Domain
DependsOn: SM2Certificate
Properties:
DomainName:
Ref: DomainName
Protocol: HTTPS
CertIdentifier:
Fn::GetAtt:
- SM2Certificate
- CertId
ForceHttps: true
TlsMin: TLS 1.2
TlsMax: TLS 1.3
Http2Option: Open
ResourceGroupId:
Ref: ResourceGroupId
Outputs:
CertId:
Label:
zh-cn: 证书ID
en: Certificate ID
Description:
zh-cn: 国密SM2双证书的唯一标识。
en: The unique identifier of the SM2 dual certificate.
Value:
Fn::GetAtt:
- SM2Certificate
- CertId
CertificateName:
Label:
zh-cn: 证书名称
en: Certificate Name
Value:
Fn::GetAtt:
- SM2Certificate
- CertificateName
DomainId:
Label:
zh-cn: 域名ID
en: Domain ID
Description:
zh-cn: API网关域名的唯一标识。
en: The unique identifier of the API Gateway domain.
Value:
Fn::GetAtt:
- Domain
- DomainId
DomainName:
Label:
zh-cn: 域名
en: Domain Name
Value:
Fn::GetAtt:
- Domain
- DomainName{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "上传国密SM2双证书并部署到API网关HTTPS域名。",
"en": "Upload SM2 dual certificates and deploy to an API Gateway HTTPS domain."
},
"Parameters": {
"CertificateName": {
"Type": "String",
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Description": {
"zh-cn": "国密双证书的名称,最大支持128个字符。",
"en": "Name of the SM2 dual certificate, up to 128 characters."
},
"MaxLength": 128,
"MinLength": 1
},
"SignCert": {
"Type": "String",
"Label": {
"zh-cn": "签名证书内容(PEM格式)",
"en": "Signing Certificate (PEM)"
},
"Description": {
"zh-cn": "PEM格式的SM2签名证书内容,用于数字签名验证。",
"en": "SM2 signing certificate content in PEM format for digital signature verification."
}
},
"SignPrivateKey": {
"Type": "String",
"Label": {
"zh-cn": "签名证书私钥(PEM格式)",
"en": "Signing Private Key (PEM)"
},
"Description": {
"zh-cn": "PEM格式的SM2签名证书私钥内容。",
"en": "SM2 signing certificate private key in PEM format."
},
"NoEcho": true
},
"EncryptCert": {
"Type": "String",
"Label": {
"zh-cn": "加密证书内容(PEM格式)",
"en": "Encryption Certificate (PEM)"
},
"Description": {
"zh-cn": "PEM格式的SM2加密证书内容,用于数据加密传输。",
"en": "SM2 encryption certificate content in PEM format for data encryption."
}
},
"EncryptPrivateKey": {
"Type": "String",
"Label": {
"zh-cn": "加密证书私钥(PEM格式)",
"en": "Encryption Private Key (PEM)"
},
"Description": {
"zh-cn": "PEM格式的SM2加密证书私钥内容。",
"en": "SM2 encryption certificate private key in PEM format."
},
"NoEcho": true
},
"DomainName": {
"Type": "String",
"Label": {
"zh-cn": "API网关域名",
"en": "API Gateway Domain"
},
"Description": {
"zh-cn": "需要绑定国密证书的域名,例如api.example.com。需已完成域名备案和DNS解析。",
"en": "The domain to bind the SM2 certificate, e.g. api.example.com. DNS resolution and ICP filing must be completed."
},
"AllowedPattern": "^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$"
},
"ResourceGroupId": {
"Type": "String",
"Label": {
"zh-cn": "资源组",
"en": "Resource Group"
},
"Description": {
"zh-cn": "证书和域名所属的资源组。",
"en": "The resource group for the certificate and domain."
},
"AssociationProperty": "ALIYUN::ResourceManager::ResourceGroup",
"Default": null
}
},
"Resources": {
"SM2Certificate": {
"Type": "ALIYUN::CAS::UserCertificate",
"Properties": {
"CertificateName": {
"Ref": "CertificateName"
},
"SignCert": {
"Ref": "SignCert"
},
"SignPrivateKey": {
"Ref": "SignPrivateKey"
},
"EncryptCert": {
"Ref": "EncryptCert"
},
"EncryptPrivateKey": {
"Ref": "EncryptPrivateKey"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"Tags": [
{
"Key": "CertType",
"Value": "SM2-Dual"
},
{
"Key": "Compliance",
"Value": "GM/T"
}
]
}
},
"Domain": {
"Type": "ALIYUN::APIG::Domain",
"DependsOn": "SM2Certificate",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"Protocol": "HTTPS",
"CertIdentifier": {
"Fn::GetAtt": [
"SM2Certificate",
"CertId"
]
},
"ForceHttps": true,
"TlsMin": "TLS 1.2",
"TlsMax": "TLS 1.3",
"Http2Option": "Open",
"ResourceGroupId": {
"Ref": "ResourceGroupId"
}
}
}
},
"Outputs": {
"CertId": {
"Label": {
"zh-cn": "证书ID",
"en": "Certificate ID"
},
"Description": {
"zh-cn": "国密SM2双证书的唯一标识。",
"en": "The unique identifier of the SM2 dual certificate."
},
"Value": {
"Fn::GetAtt": [
"SM2Certificate",
"CertId"
]
}
},
"CertificateName": {
"Label": {
"zh-cn": "证书名称",
"en": "Certificate Name"
},
"Value": {
"Fn::GetAtt": [
"SM2Certificate",
"CertificateName"
]
}
},
"DomainId": {
"Label": {
"zh-cn": "域名ID",
"en": "Domain ID"
},
"Description": {
"zh-cn": "API网关域名的唯一标识。",
"en": "The unique identifier of the API Gateway domain."
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainId"
]
}
},
"DomainName": {
"Label": {
"zh-cn": "域名",
"en": "Domain Name"
},
"Value": {
"Fn::GetAtt": [
"Domain",
"DomainName"
]
}
}
}
}该文章对您有帮助吗?