Creates a custom domain name.
Operation description
You can attach a custom domain name to an application or function in Function Compute to access it through a fixed domain name in a production environment, or to resolve the forced download behavior when you access an HTTP trigger.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
fc:CreateCustomDomain |
create |
*All Resource
|
None | None |
Request syntax
POST /2023-03-30/custom-domains HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body | CreateCustomDomainInput |
Yes |
The information about the custom domain name. |
Response elements
|
Element |
Type |
Description |
Example |
| CustomDomain |
The information about the custom domain name. |
Examples
Success response
JSON format
{
"accountId": "186851234023****",
"apiVersion": "2023-03-30",
"authConfig": {
"authInfo": "{}",
"authType": "anonymous"
},
"certConfig": {
"certName": "my-cert",
"certificate": "PEM format",
"privateKey": "PEM format"
},
"createdTime": "2023-03-30T08:02:19Z",
"domainName": "example.com",
"lastModifiedTime": "2023-03-30T08:02:19Z",
"protocol": "HTTP",
"routeConfig": {
"routes": [
{
"functionName": "myFunction",
"methods": [
"GET"
],
"path": "/api/*",
"qualifier": "myAlias",
"rewriteConfig": {
"equalRules": [
{
"match": "/old",
"replacement": "/new"
}
],
"regexRules": [
{
"match": "^/api/.+?/(.*)",
"replacement": "/api/v2/$1"
}
],
"wildcardRules": [
{
"match": "/api/*",
"replacement": "/$1"
}
]
}
}
]
},
"subdomainCount": "1",
"tlsConfig": {
"cipherSuites": [
"TLS_RSA_WITH_RC4_128_SHA"
],
"maxVersion": "TLSv1.3",
"minVersion": "TLSv1.0"
},
"wafConfig": {
"enableWAF": true
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.