Aliyun::Serverless::CustomDomain is used to create a custom domain name.
Syntax
{
"Type": "ALIYUN::Serverless::CustomDomain",
"Properties": {
"Protocol": String,
"RouteConfig": Map,
"CertConfig": Map,
"DomainName": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Protocol | String | Yes | Yes | The protocol type. | Valid values:
|
RouteConfig | Map | Yes | Yes | The configurations of the route table. |
For more information, visit RouteConfig object. |
CertConfig | Map | No | Yes | The information of the certificate. | For more information, visit CertConfig properties. |
DomainName | String | No | No | The domain name. | If you do not specify the DomainName parameter, you must specify the logical resource ID as the domain name.
|
CertConfig syntax
"CertConfig": {
"CertName": String,
"PrivateKey": String,
"Certificate": String
}
CertConfig properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
CertName | String | Yes | Yes | The custom name of the certificate. | None |
PrivateKey | String | Yes | Yes | The private key. | Specify this parameter in one line by using newline escape characters (\n ).
|
Certificate | String | Yes | Yes | The information of the certificate. | Specify this parameter in one line by using newline escape characters (\n ).
|
Response parameters
Fn::GetAtt
- DomainName: the custom domain name.
- Domain: the protocol and the custom domain name.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Transform": "Aliyun::Serverless-2018-04-03",
"Parameters": {
"DomainName": {
"Type": "String"
}
},
"Resources": {
"CustomDomain": {
"Type": "Aliyun::Serverless::CustomDomain",
"Properties": {
"DomainName": {
"Ref": "DomainName"
},
"Protocol": "HTTP",
"RouteConfig": {
"Routes": {
"/*": {
"ServiceName": "MyService",
"FunctionName": "MyServiceMyFunction"
}
}
}
}
}
},
"Outputs": {
"DomainName": {
"Value": {
"Fn::GetAtt": [
"CustomDomain",
"DomainName"
]
}
},
"Domain": {
"Value": {
"Fn::GetAtt": [
"CustomDomain",
"Domain"
]
}
}
}
}
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Parameters:
DomainName:
Type: String
Resources:
CustomDomain:
Type: 'Aliyun::Serverless::CustomDomain'
Properties:
DomainName:
Ref: DomainName
Protocol: HTTP
RouteConfig:
Routes:
/*:
ServiceName: MyService
FunctionName: MyServiceMyFunction
Outputs:
DomainName:
Value:
'Fn::GetAtt':
- CustomDomain
- DomainName
Domain:
Value:
'Fn::GetAtt':
- CustomDomain
- Domain