ALIYUN::GPDB::InstancePublicConnection类型用于分配实例外网连接地址。

语法

{
  "Type": "ALIYUN::GPDB::DBInstance",
  "Properties": {
    "DBInstanceId": String,
    "ConnectionStringPrefix": String,
    "Port": integer
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
DBInstanceId String 实例ID。 您可以通过ALIYUN::GPDB::DBInstanceALIYUN::GPDB::ElasticDBInstance云原生数据仓库AnalyticDB PostgreSQL版管理控制台创建实例,获取实例ID。
Port Integer 端口号。
ConnectionStringPrefix String 连接地址前缀。

返回值

Fn::GetAtt

  • DBInstanceId:实例ID。
  • ConnectionString:连接地址。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "InstancePublicConnection": {
      "Type": "ALIYUN::GPDB::InstancePublicConnection",
      "Properties": {
        "ConnectionStringPrefix": "gp-2zef492q66we7h***-mytest",
        "DBInstanceId": "gp-2zef492q66we7h***",
        "Port": 5432
      }
    }
  },
  "Outputs": {
    "DBInstanceId": {
      "Value": { "Fn::GetAtt": ["InstancePublicConnection", "DBInstanceId"] }
    },
    "ConnectionString": {
      "Value": { "Ref": "InstancePublicConnection" }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  InstancePublicConnection:
    Type: 'ALIYUN::GPDB::InstancePublicConnection'
    Properties:
      ConnectionStringPrefix: gp-2zef492q66we7h***-mytest
      DBInstanceId: gp-2zef492q66we7h***
      Port: 5432
Outputs:
  DBInstanceId:
    Value:
      'Fn::GetAtt':
        - InstancePublicConnection
        - DBInstanceId
  ConnectionString:
    Value:
      Ref: InstancePublicConnection