Crie um endpoint público para um cluster PolarDB, incluindo endpoints primários, endpoints de cluster padrão e endpoints de cluster personalizados.
Sintaxe
{
"Type": "ALIYUN::POLARDB::DBClusterEndpointAddress",
"Properties": {
"DBClusterId": String,
"ConnectionStringPrefix": String,
"DBEndpointId": String,
"NetType": String
}
}
Propriedades
| Propriedade | Tipo | Obrigatória | Atualização permitida | Descrição | Restrições |
| DBClusterId | String | Sim | Não | ID do cluster. | Nenhuma. |
| DBEndpointId | String | Sim | Não | ID do endpoint do cluster. | Use a API DescribeDBClusterEndpoints para consultar o ID do endpoint do cluster. |
| ConnectionStringPrefix | String | Não | Sim | Prefixo do endpoint do cluster. | O prefixo deve começar com uma letra e conter apenas letras minúsculas, dígitos e hifens (-). Não pode terminar com hífen. O comprimento deve ser de 6 a 30 caracteres. |
| NetType | String | Não | Não | Tipo de rede do endpoint do cluster. | Valores válidos:
Valor padrão: Public. |
Valores de retorno
Fn::GetAtt
ConnectionString: endpoint do cluster.
Address: endereço IP do endpoint.
Exemplos
Formato JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"DBClusterEndpointAddress": {
"Type": "ALIYUN::POLARDB::DBClusterEndpointAddress",
"Properties": {
"DBClusterId": {
"Ref": "DBClusterId"
},
"ConnectionStringPrefix": {
"Ref": "ConnectionStringPrefix"
},
"DBEndpointId": {
"Ref": "DBEndpointId"
},
"NetType": {
"Ref": "NetType"
}
}
}
},
"Parameters": {
"DBClusterId": {
"Type": "String",
"Description": "The ID of the PolarDB cluster for which to create a public endpoint."
},
"ConnectionStringPrefix": {
"AllowedPattern": "[a-z][-a-z0-9]{4,28}[a-z0-9]",
"Type": "String",
"Description": "The prefix of the endpoint. It must start with a letter and can contain lowercase letters, digits, and hyphens (-). It cannot end with a hyphen. The length must be 6 to 30 characters."
},
"DBEndpointId": {
"Type": "String",
"Description": "The ID of the cluster endpoint."
},
"NetType": {
"Default": "Public",
"Type": "String",
"Description": "The network type of the endpoint. If you set this property to Public, ROS creates, modifies, and deletes the public endpoint. If you set this property to Private, ROS only modifies the private endpoint. Default: Public.",
"AllowedValues": [
"Public",
"Private"
]
}
},
"Outputs": {
"ConnectionString": {
"Description": "The endpoint.",
"Value": {
"Fn::GetAtt": [
"DBClusterEndpointAddress",
"ConnectionString"
]
}
},
"Address": {
"Description": "The IP address of the endpoint.",
"Value": {
"Fn::GetAtt": [
"DBClusterEndpointAddress",
"Address"
]
}
}
}
}
Formato YAML
ROSTemplateFormatVersion: '2015-09-01'
Resources:
DBClusterEndpointAddress:
Type: ALIYUN::POLARDB::DBClusterEndpointAddress
Properties:
DBClusterId:
Ref: DBClusterId
ConnectionStringPrefix:
Ref: ConnectionStringPrefix
DBEndpointId:
Ref: DBEndpointId
NetType:
Ref: NetType
Parameters:
DBClusterId:
Type: String
Description: The ID of the PolarDB cluster for which to create a public endpoint.
ConnectionStringPrefix:
AllowedPattern: '[a-z][-a-z0-9]{4,28}[a-z0-9]'
Type: String
Description: 'The prefix of the endpoint. It must start with a letter and can contain lowercase letters, digits, and hyphens (-). It cannot end with a hyphen. The length must be 6 to 30 characters.'
DBEndpointId:
Type: String
Description: The ID of the cluster endpoint.
NetType:
Default: Public
Type: String
Description: The network type of the endpoint. If you set this property to Public, ROS creates, modifies, and deletes the public endpoint. If you set this property to Private, ROS only modifies the private endpoint. Default: Public.
AllowedValues:
- Public
- Private
Outputs:
ConnectionString:
Description: The endpoint.
Value:
Fn::GetAtt:
- DBClusterEndpointAddress
- ConnectionString
Address:
Description: The IP address of the endpoint.
Value:
Fn::GetAtt:
- DBClusterEndpointAddress
- Address