ALIYUN::SLS::RdsExternalStore

ALIYUN::SLS::RdsExternalStore类型用于创建RDS外部存储。

语法

{
  "Type": "ALIYUN::SLS::RdsExternalStore",
  "Properties": {
    "Db": String,
    "ExternalStoreName": String,
    "Host": String,
    "Project": String,
    "Port": Integer,
    "Password": String,
    "Region": String,
    "StoreType": String,
    "Table": String,
    "Username": String,
    "VpcId": String,
    "InstanceId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Db

String

RDS MySQL 实例的数据库名称。

ExternalStoreName

String

外部存储名称。

Host

String

RDS MySQL 实例的内网地址或外网地址。

Project

String

Project 名称。

Port

Integer

RDS MySQL 实例的内网或者外网端口。

Password

String

RDS MySQL 实例中账号对应的密码。

Region

String

RDS MySQL 实例所在地域

当前支持:

  • cn-qingdao

  • cn-beijing

  • cn-hangzhou

StoreType

String

存储类型。

固定取值为 rds-vpc,表示 VPC 下的 RDS MySQL 数据库。

Table

String

RDS MySQL 实例的数据库表名称。

Username

String

RDS MySQL 实例中的账号名称。

VpcId

String

RDS MySQL 实例所属的 VPC ID。

InstanceId

String

RDS实例ID。

返回值

Fn::GetAtt

  • Project:Project 名称。

  • ExternalStoreName:外部存储名称。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  StoreType:
    Type: String
    Description:
      en: The storage type. Set the value to rds-vpc, which indicates an ApsaraDB RDS for MySQL database in a virtual private cloud (VPC).
    AllowedValues:
      - rds-vpc
    Required: true
  Project:
    Type: String
    Description:
      en: The name of the project.
    Required: true
  Table:
    Type: String
    Description:
      en: The name of the database table in the ApsaraDB RDS for MySQL instance.
    Required: true
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The ID of the VPC to which the ApsaraDB RDS for MySQL instance belongs.
    Required: true
  Username:
    Type: String
    Description:
      en: The username that is used to log on to the ApsaraDB RDS for MySQL instance.
    Required: true
  Port:
    Type: Number
    Description:
      en: The internal or public port of the ApsaraDB RDS for MySQL instance.
    Required: true
  Region:
    Type: String
    Description:
      en: 'The region where the ApsaraDB RDS for MySQL instance resides. Valid values: cn-qingdao, cn-beijing, and cn-hangzhou.'
    AllowedValues:
      - cn-qingdao
      - cn-beijing
      - cn-hangzhou
    Required: true
  Host:
    Type: String
    Description:
      en: The internal or public endpoint of the ApsaraDB RDS for MySQL instance.
    Required: true
  ExternalStoreName:
    Type: String
    Description:
      en: The name of the external store. The name must be unique in a project and different from Logstore.
    Required: true
  Db:
    Type: String
    Description:
      en: The name of the database in the ApsaraDB RDS for MySQL instance.
    Required: true
  Password:
    Type: String
    Description:
      en: The password that is used to log on to the ApsaraDB RDS for MySQL instance.
    Required: true
Resources:
  RdsExternalStore:
    Type: ALIYUN::SLS::RdsExternalStore
    Properties:
      StoreType:
        Ref: StoreType
      Project:
        Ref: Project
      Table:
        Ref: Table
      VpcId:
        Ref: VpcId
      Username:
        Ref: Username
      Port:
        Ref: Port
      Region:
        Ref: Region
      Host:
        Ref: Host
      ExternalStoreName:
        Ref: ExternalStoreName
      Db:
        Ref: Db
      Password:
        Ref: Password
Outputs:
  Project:
    Description: The name of the project to which the external store belongs.
    Value:
      Fn::GetAtt:
        - RdsExternalStore
        - Project
  ExternalStoreName:
    Description: The name of the external store.
    Value:
      Fn::GetAtt:
        - RdsExternalStore
        - ExternalStoreName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "StoreType": {
      "Type": "String",
      "Description": {
        "en": "The storage type. Set the value to rds-vpc, which indicates an ApsaraDB RDS for MySQL database in a virtual private cloud (VPC)."
      },
      "AllowedValues": [
        "rds-vpc"
      ],
      "Required": true
    },
    "Project": {
      "Type": "String",
      "Description": {
        "en": "The name of the project."
      },
      "Required": true
    },
    "Table": {
      "Type": "String",
      "Description": {
        "en": "The name of the database table in the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    },
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC to which the ApsaraDB RDS for MySQL instance belongs."
      },
      "Required": true
    },
    "Username": {
      "Type": "String",
      "Description": {
        "en": "The username that is used to log on to the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    },
    "Port": {
      "Type": "Number",
      "Description": {
        "en": "The internal or public port of the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    },
    "Region": {
      "Type": "String",
      "Description": {
        "en": "The region where the ApsaraDB RDS for MySQL instance resides. Valid values: cn-qingdao, cn-beijing, and cn-hangzhou."
      },
      "AllowedValues": [
        "cn-qingdao",
        "cn-beijing",
        "cn-hangzhou"
      ],
      "Required": true
    },
    "Host": {
      "Type": "String",
      "Description": {
        "en": "The internal or public endpoint of the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    },
    "ExternalStoreName": {
      "Type": "String",
      "Description": {
        "en": "The name of the external store. The name must be unique in a project and different from Logstore."
      },
      "Required": true
    },
    "Db": {
      "Type": "String",
      "Description": {
        "en": "The name of the database in the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "The password that is used to log on to the ApsaraDB RDS for MySQL instance."
      },
      "Required": true
    }
  },
  "Resources": {
    "RdsExternalStore": {
      "Type": "ALIYUN::SLS::RdsExternalStore",
      "Properties": {
        "StoreType": {
          "Ref": "StoreType"
        },
        "Project": {
          "Ref": "Project"
        },
        "Table": {
          "Ref": "Table"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "Username": {
          "Ref": "Username"
        },
        "Port": {
          "Ref": "Port"
        },
        "Region": {
          "Ref": "Region"
        },
        "Host": {
          "Ref": "Host"
        },
        "ExternalStoreName": {
          "Ref": "ExternalStoreName"
        },
        "Db": {
          "Ref": "Db"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "Project": {
      "Description": "The name of the project to which the external store belongs.",
      "Value": {
        "Fn::GetAtt": [
          "RdsExternalStore",
          "Project"
        ]
      }
    },
    "ExternalStoreName": {
      "Description": "The name of the external store.",
      "Value": {
        "Fn::GetAtt": [
          "RdsExternalStore",
          "ExternalStoreName"
        ]
      }
    }
  }
}