ALIYUN::GA::CertificatesListenerAssociation类型用于为HTTPS监听绑定扩展证书。
语法
{
"Type": "ALIYUN::GA::CertificatesListenerAssociation",
"Properties": {
"AcceleratorId": String,
"Certificates": List,
"ListenerId": String
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
AcceleratorId |
String |
是 |
否 |
全球加速实例的ID。 |
无 |
|
Certificates |
List |
是 |
是 |
与HTTPS监听关联的附加证书。 |
一次最多支持输入 10 个证书信息。更多信息,请参见Certificates属性。 |
|
ListenerId |
String |
是 |
否 |
HTTPS监听的ID。 |
无 |
Certificates语法
"Certificates": [
{
"Id": String,
"Domain": String
}
]
Certificates属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
Domain |
String |
是 |
是 |
附加证书生效的域名。 |
无 |
|
Id |
String |
是 |
是 |
附加证书的ID。 |
无 |
返回值
Fn::GetAtt
-
Certificates:附加证书。
-
ListenerId:监听的ID。
示例
场景 1 :为全球加速HTTPS监听器关联一张附加SSL证书(SNI单域名)。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 为全球加速 HTTPS 监听器关联一张附加 SSL 证书(SNI 单域名),用于多域名 HTTPS 加速。
Parameters:
AcceleratorId:
Type: String
Label: 全球加速实例ID
Description: 已创建的全球加速实例 ID。
ListenerId:
Type: String
Label: HTTPS监听器ID
Description: 已创建的 HTTPS 监听器 ID。
CertificateId:
Type: String
Label: 附加证书ID
Description: 附加 SSL 证书 ID(来自数字证书管理服务 CAS),需与监听器默认证书不同。
Domain:
Type: String
Label: 附加证书域名
Description: 附加证书生效的域名,例如 www.example.com。
Default: www.example.com
Resources:
CertListenerAssociation:
Type: ALIYUN::GA::CertificatesListenerAssociation
Properties:
AcceleratorId:
Ref: AcceleratorId
ListenerId:
Ref: ListenerId
Certificates:
- Id:
Ref: CertificateId
Domain:
Ref: Domain
Outputs:
ListenerId:
Description: 关联附加证书的 HTTPS 监听器 ID。
Value:
Fn::GetAtt:
- CertListenerAssociation
- ListenerId
Certificates:
Description: 关联的附加证书列表。
Value:
Fn::GetAtt:
- CertListenerAssociation
- Certificates{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "为全球加速 HTTPS 监听器关联一张附加 SSL 证书(SNI 单域名),用于多域名 HTTPS 加速。"
},
"Parameters": {
"AcceleratorId": {
"Type": "String",
"Label": "全球加速实例ID",
"Description": "已创建的全球加速实例 ID。"
},
"ListenerId": {
"Type": "String",
"Label": "HTTPS监听器ID",
"Description": "已创建的 HTTPS 监听器 ID。"
},
"CertificateId": {
"Type": "String",
"Label": "附加证书ID",
"Description": "附加 SSL 证书 ID(来自数字证书管理服务 CAS),需与监听器默认证书不同。"
},
"Domain": {
"Type": "String",
"Label": "附加证书域名",
"Description": "附加证书生效的域名,例如 www.example.com。",
"Default": "www.example.com"
}
},
"Resources": {
"CertListenerAssociation": {
"Type": "ALIYUN::GA::CertificatesListenerAssociation",
"Properties": {
"AcceleratorId": { "Ref": "AcceleratorId" },
"ListenerId": { "Ref": "ListenerId" },
"Certificates": [
{ "Id": { "Ref": "CertificateId" }, "Domain": { "Ref": "Domain" } }
]
}
}
},
"Outputs": {
"ListenerId": {
"Description": "关联附加证书的 HTTPS 监听器 ID。",
"Value": { "Fn::GetAtt": ["CertListenerAssociation", "ListenerId"] }
},
"Certificates": {
"Description": "关联的附加证书列表。",
"Value": { "Fn::GetAtt": ["CertListenerAssociation", "Certificates"] }
}
}
}场景 2 :为全球加速HTTPS监听器关联多张附加SSL证书(多域名SNI)。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 为全球加速 HTTPS 监听器关联多张附加 SSL 证书(多域名 SNI),支持多域名 HTTPS 加速。
Parameters:
AcceleratorId:
Type: String
Label: 全球加速实例ID
Description: 已创建的全球加速实例 ID。
ListenerId:
Type: String
Label: HTTPS监听器ID
Description: 已创建的 HTTPS 监听器 ID。
Certificates:
Type: Json
Label: 附加证书列表
Description: >-
附加 SSL 证书列表,JSON 数组,每个元素包含 Id(证书ID,来自数字证书管理服务 CAS)和
Domain(证书生效域名)。最多 10 张。示例:
[{"Id":"12345-cert-id","Domain":"www.example.com"},{"Id":"67890-cert-id","Domain":"api.example.com"}]。
Default: '[{"Id":"cert-id-a","Domain":"www.example.com"},{"Id":"cert-id-b","Domain":"api.example.com"}]'
Resources:
CertListenerAssociation:
Type: ALIYUN::GA::CertificatesListenerAssociation
Properties:
AcceleratorId:
Ref: AcceleratorId
ListenerId:
Ref: ListenerId
Certificates:
Ref: Certificates
Outputs:
ListenerId:
Description: 关联附加证书的 HTTPS 监听器 ID。
Value:
Fn::GetAtt:
- CertListenerAssociation
- ListenerId
Certificates:
Description: 关联的附加证书列表。
Value:
Fn::GetAtt:
- CertListenerAssociation
- Certificates{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "为全球加速 HTTPS 监听器关联多张附加 SSL 证书(多域名 SNI),支持多域名 HTTPS 加速。"
},
"Parameters": {
"AcceleratorId": {
"Type": "String",
"Label": "全球加速实例ID",
"Description": "已创建的全球加速实例 ID。"
},
"ListenerId": {
"Type": "String",
"Label": "HTTPS监听器ID",
"Description": "已创建的 HTTPS 监听器 ID。"
},
"Certificates": {
"Type": "Json",
"Label": "附加证书列表",
"Description": "附加 SSL 证书列表,JSON 数组,每个元素包含 Id(证书ID,来自数字证书管理服务 CAS)和 Domain(证书生效域名)。最多 10 张。示例:[{\"Id\":\"12345-cert-id\",\"Domain\":\"www.example.com\"},{\"Id\":\"67890-cert-id\",\"Domain\":\"api.example.com\"}]。",
"Default": "[{\"Id\":\"cert-id-a\",\"Domain\":\"www.example.com\"},{\"Id\":\"cert-id-b\",\"Domain\":\"api.example.com\"}]"
}
},
"Resources": {
"CertListenerAssociation": {
"Type": "ALIYUN::GA::CertificatesListenerAssociation",
"Properties": {
"AcceleratorId": { "Ref": "AcceleratorId" },
"ListenerId": { "Ref": "ListenerId" },
"Certificates": { "Ref": "Certificates" }
}
}
},
"Outputs": {
"ListenerId": {
"Description": "关联附加证书的 HTTPS 监听器 ID。",
"Value": { "Fn::GetAtt": ["CertListenerAssociation", "ListenerId"] }
},
"Certificates": {
"Description": "关联的附加证书列表。",
"Value": { "Fn::GetAtt": ["CertListenerAssociation", "Certificates"] }
}
}
}场景 3 :创建全球加速HTTPS加速链路,上传证书并关联附加证书。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建全球加速 HTTPS 加速链路,上传默认与附加 SSL 证书并关联到监听器,配置终端节点组转发到后端源站。
Parameters:
AcceleratorName:
Type: String
Label: 全球加速实例名称
Description: 全球加速实例名称。
Default: ga-https-demo
Spec:
Type: String
Label: 实例规格
Description: 全球加速实例规格,例如 Small_1、Small_2、Middle_1 等。
Default: Small_1
Bandwidth:
Type: Number
Label: 带宽包带宽
Description: 带宽包提供的带宽,单位 Mbps。
Default: 10
AccelerateRegionId:
Type: String
Label: 加速地域
Description: 需要加速的地域 ID(用户访问的源地域),例如 cn-beijing。
Default: cn-beijing
BackendRegion:
Type: String
Label: 终端节点组地域
Description: 终端节点组(后端源站)所在地域 ID,例如 cn-hangzhou。
Default: cn-hangzhou
BackendEndpoint:
Type: String
Label: 后端源站地址
Description: 后端源站的公网 IP 或域名。
Default: 47.111.111.111
BackendPort:
Type: Number
Label: 后端源站端口
Description: 后端源站监听端口,监听器 443 将转发到该端口。
Default: 80
EndpointType:
Type: String
Label: 终端节点类型
Description: 终端节点类型。PublicIp:公网 IP;Domain:自定义域名;Ip:自定义 IP。
AllowedValues:
- PublicIp
- Domain
- Ip
Default: PublicIp
DefaultDomain:
Type: String
Label: 默认证书域名
Description: 监听器默认证书对应的域名,例如 www.example.com。
Default: www.example.com
DefaultCert:
Type: String
Label: 默认证书内容
Description: 监听器默认 SSL 证书内容(PEM 格式)。
DefaultKey:
Type: String
Label: 默认证书私钥
Description: 监听器默认 SSL 证书私钥内容(PEM 格式)。
NoEcho: true
AdditionalDomain:
Type: String
Label: 附加证书域名
Description: 附加证书对应的域名,例如 api.example.com。
Default: api.example.com
AdditionalCert:
Type: String
Label: 附加证书内容
Description: 附加 SSL 证书内容(PEM 格式),需与默认证书不同。
AdditionalKey:
Type: String
Label: 附加证书私钥
Description: 附加 SSL 证书私钥内容(PEM 格式)。
NoEcho: true
Resources:
Accelerator:
Type: ALIYUN::GA::Accelerator
Properties:
AcceleratorName:
Ref: AcceleratorName
Spec:
Ref: Spec
InstanceChargeType: PostPaid
BandwidthPackage:
Type: ALIYUN::GA::BandwidthPackage
Properties:
Type: Basic
Bandwidth:
Ref: Bandwidth
BandwidthAddition:
Type: ALIYUN::GA::BandwidthPackageAcceleratorAddition
Properties:
BandwidthPackageId:
Fn::GetAtt:
- BandwidthPackage
- BandwidthPackageId
AcceleratorId:
Fn::GetAtt:
- Accelerator
- AcceleratorId
DependsOn:
- Accelerator
- BandwidthPackage
IpSets:
Type: ALIYUN::GA::IpSets
Properties:
AcceleratorId:
Fn::GetAtt:
- Accelerator
- AcceleratorId
AccelerateRegion:
- AccelerateRegionId:
Ref: AccelerateRegionId
Bandwidth: 2
IpVersion: IPv4
DependsOn: Accelerator
CasCertDefault:
Type: ALIYUN::CAS::Certificate
Properties:
Cert:
Ref: DefaultCert
Key:
Ref: DefaultKey
Name: ga-default-cert
CasCertAdditional:
Type: ALIYUN::CAS::Certificate
Properties:
Cert:
Ref: AdditionalCert
Key:
Ref: AdditionalKey
Name: ga-additional-cert
Listener:
Type: ALIYUN::GA::Listener
Properties:
AcceleratorId:
Fn::GetAtt:
- Accelerator
- AcceleratorId
Protocol: https
PortRanges:
- FromPort: 443
ToPort: 443
Certificates:
- Id:
Fn::GetAtt:
- CasCertDefault
- CertId
Name: ga-https-listener
DependsOn:
- Accelerator
- CasCertDefault
CertListenerAssociation:
Type: ALIYUN::GA::CertificatesListenerAssociation
Properties:
AcceleratorId:
Fn::GetAtt:
- Accelerator
- AcceleratorId
ListenerId:
Fn::GetAtt:
- Listener
- ListenerId
Certificates:
- Id:
Fn::GetAtt:
- CasCertAdditional
- CertId
Domain:
Ref: AdditionalDomain
DependsOn:
- Listener
- CasCertAdditional
EndpointGroup:
Type: ALIYUN::GA::EndpointGroup
Properties:
AcceleratorId:
Fn::GetAtt:
- Accelerator
- AcceleratorId
ListenerId:
Fn::GetAtt:
- Listener
- ListenerId
EndpointGroupRegion:
Ref: BackendRegion
EndpointRequestProtocol: HTTP
EndpointConfigurations:
- Type:
Ref: EndpointType
Endpoint:
Ref: BackendEndpoint
Weight: 100
HealthCheckEnabled: true
HealthCheckProtocol: tcp
PortOverrides:
- ListenerPort: 443
EndpointPort:
Ref: BackendPort
DependsOn: Listener
Outputs:
AcceleratorId:
Description: 全球加速实例 ID。
Value:
Fn::GetAtt:
- Accelerator
- AcceleratorId
AcceleratorCname:
Description: 全球加速实例的 CNAME 加速域名。
Value:
Fn::GetAtt:
- Accelerator
- DnsName
ListenerId:
Description: HTTPS 监听器 ID。
Value:
Fn::GetAtt:
- Listener
- ListenerId
EndpointGroupId:
Description: 终端节点组 ID。
Value:
Fn::GetAtt:
- EndpointGroup
- EndpointGroupId
Certificates:
Description: 关联到监听器的附加证书列表。
Value:
Fn::GetAtt:
- CertListenerAssociation
- Certificates{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建全球加速 HTTPS 加速链路,上传默认与附加 SSL 证书并关联到监听器,配置终端节点组转发到后端源站。"
},
"Parameters": {
"AcceleratorName": {
"Type": "String",
"Label": "全球加速实例名称",
"Description": "全球加速实例名称。",
"Default": "ga-https-demo"
},
"Spec": {
"Type": "String",
"Label": "实例规格",
"Description": "全球加速实例规格,例如 Small_1、Small_2、Middle_1 等。",
"Default": "Small_1"
},
"Bandwidth": {
"Type": "Number",
"Label": "带宽包带宽",
"Description": "带宽包提供的带宽,单位 Mbps。",
"Default": 10
},
"AccelerateRegionId": {
"Type": "String",
"Label": "加速地域",
"Description": "需要加速的地域 ID(用户访问的源地域),例如 cn-beijing。",
"Default": "cn-beijing"
},
"BackendRegion": {
"Type": "String",
"Label": "终端节点组地域",
"Description": "终端节点组(后端源站)所在地域 ID,例如 cn-hangzhou。",
"Default": "cn-hangzhou"
},
"BackendEndpoint": {
"Type": "String",
"Label": "后端源站地址",
"Description": "后端源站的公网 IP 或域名。",
"Default": "47.111.111.111"
},
"BackendPort": {
"Type": "Number",
"Label": "后端源站端口",
"Description": "后端源站监听端口,监听器 443 将转发到该端口。",
"Default": 80
},
"EndpointType": {
"Type": "String",
"Label": "终端节点类型",
"Description": "终端节点类型。PublicIp:公网 IP;Domain:自定义域名;Ip:自定义 IP。",
"AllowedValues": ["PublicIp", "Domain", "Ip"],
"Default": "PublicIp"
},
"DefaultDomain": {
"Type": "String",
"Label": "默认证书域名",
"Description": "监听器默认证书对应的域名,例如 www.example.com。",
"Default": "www.example.com"
},
"DefaultCert": {
"Type": "String",
"Label": "默认证书内容",
"Description": "监听器默认 SSL 证书内容(PEM 格式)。"
},
"DefaultKey": {
"Type": "String",
"Label": "默认证书私钥",
"Description": "监听器默认 SSL 证书私钥内容(PEM 格式)。",
"NoEcho": true
},
"AdditionalDomain": {
"Type": "String",
"Label": "附加证书域名",
"Description": "附加证书对应的域名,例如 api.example.com。",
"Default": "api.example.com"
},
"AdditionalCert": {
"Type": "String",
"Label": "附加证书内容",
"Description": "附加 SSL 证书内容(PEM 格式),需与默认证书不同。"
},
"AdditionalKey": {
"Type": "String",
"Label": "附加证书私钥",
"Description": "附加 SSL 证书私钥内容(PEM 格式)。",
"NoEcho": true
}
},
"Resources": {
"Accelerator": {
"Type": "ALIYUN::GA::Accelerator",
"Properties": {
"AcceleratorName": { "Ref": "AcceleratorName" },
"Spec": { "Ref": "Spec" },
"InstanceChargeType": "PostPaid"
}
},
"BandwidthPackage": {
"Type": "ALIYUN::GA::BandwidthPackage",
"Properties": {
"Type": "Basic",
"Bandwidth": { "Ref": "Bandwidth" }
}
},
"BandwidthAddition": {
"Type": "ALIYUN::GA::BandwidthPackageAcceleratorAddition",
"Properties": {
"BandwidthPackageId": { "Fn::GetAtt": ["BandwidthPackage", "BandwidthPackageId"] },
"AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] }
},
"DependsOn": ["Accelerator", "BandwidthPackage"]
},
"IpSets": {
"Type": "ALIYUN::GA::IpSets",
"Properties": {
"AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] },
"AccelerateRegion": [
{
"AccelerateRegionId": { "Ref": "AccelerateRegionId" },
"Bandwidth": 2,
"IpVersion": "IPv4"
}
]
},
"DependsOn": "Accelerator"
},
"CasCertDefault": {
"Type": "ALIYUN::CAS::Certificate",
"Properties": {
"Cert": { "Ref": "DefaultCert" },
"Key": { "Ref": "DefaultKey" },
"Name": "ga-default-cert"
}
},
"CasCertAdditional": {
"Type": "ALIYUN::CAS::Certificate",
"Properties": {
"Cert": { "Ref": "AdditionalCert" },
"Key": { "Ref": "AdditionalKey" },
"Name": "ga-additional-cert"
}
},
"Listener": {
"Type": "ALIYUN::GA::Listener",
"Properties": {
"AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] },
"Protocol": "https",
"PortRanges": [{ "FromPort": 443, "ToPort": 443 }],
"Certificates": [{ "Id": { "Fn::GetAtt": ["CasCertDefault", "CertId"] } }],
"Name": "ga-https-listener"
},
"DependsOn": ["Accelerator", "CasCertDefault"]
},
"CertListenerAssociation": {
"Type": "ALIYUN::GA::CertificatesListenerAssociation",
"Properties": {
"AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] },
"ListenerId": { "Fn::GetAtt": ["Listener", "ListenerId"] },
"Certificates": [
{ "Id": { "Fn::GetAtt": ["CasCertAdditional", "CertId"] }, "Domain": { "Ref": "AdditionalDomain" } }
]
},
"DependsOn": ["Listener", "CasCertAdditional"]
},
"EndpointGroup": {
"Type": "ALIYUN::GA::EndpointGroup",
"Properties": {
"AcceleratorId": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] },
"ListenerId": { "Fn::GetAtt": ["Listener", "ListenerId"] },
"EndpointGroupRegion": { "Ref": "BackendRegion" },
"EndpointRequestProtocol": "HTTP",
"EndpointConfigurations": [
{ "Type": { "Ref": "EndpointType" }, "Endpoint": { "Ref": "BackendEndpoint" }, "Weight": 100 }
],
"HealthCheckEnabled": true,
"HealthCheckProtocol": "tcp",
"PortOverrides": [{ "ListenerPort": 443, "EndpointPort": { "Ref": "BackendPort" } }]
},
"DependsOn": "Listener"
}
},
"Outputs": {
"AcceleratorId": {
"Description": "全球加速实例 ID。",
"Value": { "Fn::GetAtt": ["Accelerator", "AcceleratorId"] }
},
"AcceleratorCname": {
"Description": "全球加速实例的 CNAME 加速域名。",
"Value": { "Fn::GetAtt": ["Accelerator", "DnsName"] }
},
"ListenerId": {
"Description": "HTTPS 监听器 ID。",
"Value": { "Fn::GetAtt": ["Listener", "ListenerId"] }
},
"EndpointGroupId": {
"Description": "终端节点组 ID。",
"Value": { "Fn::GetAtt": ["EndpointGroup", "EndpointGroupId"] }
},
"Certificates": {
"Description": "关联到监听器的附加证书列表。",
"Value": { "Fn::GetAtt": ["CertListenerAssociation", "Certificates"] }
}
}
}该文章对您有帮助吗?