ALIYUN::DMS::Instance2

更新时间:2025-02-12 01:38:26

ALIYUN::DMS::Instance2类型用于新版DMS录入数据库实例。

语法

{
  "Type": "ALIYUN::DMS::Instance2",
  "Properties": {
    "DatabasePassword": String,
    "DbaId": Integer,
    "DatabaseUser": String,
    "ExportTimeout": Integer,
    "EnvType": String,
    "EnableSellTrust": String,
    "Host": String,
    "InstanceAlias": String,
    "InstanceType": String,
    "InstanceSource": String,
    "NetworkType": String,
    "Port": Integer,
    "QueryTimeout": Integer,
    "SafeRule": String,
    "DataLinkName": String,
    "DdlOnline": Integer,
    "EcsRegion": String,
    "EnableSellSitd": String,
    "EnableSellStable": String,
    "EnableSellCommon": String,
    "EcsInstanceId": String,
    "SkipTest": Boolean,
    "Sid": String,
    "TemplateId": Integer,
    "TemplateType": String,
    "Tid": Integer,
    "UseSsl": Integer,
    "UseDsql": Integer,
    "VpcId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

DatabasePassword

String

数据库密码。

DbaId

Integer

实例DBA角色的用户ID。

DatabaseUser

String

数据库账号。

ExportTimeout

Integer

导出超时时间。

单位:s(秒)。

EnvType

String

环境类型。

取值如下:

  • product:生产环境

  • dev:开发环境

  • pre:预发环境

  • test:测试环境

  • sit:SIT 环境

  • uat:UAT 环境

  • pet:压测环境

  • stag:STAG环境

EnableSellTrust

String

实例是否需要开启安全托管。

取值:

  • Y:开启安全托管模式。

  • NULL或其它:不开启安全托管模式。

Host

String

数据库连接地址。

InstanceAlias

String

实例别名。

InstanceType

String

数据库类型。

InstanceSource

String

实例来源。

取值如下:

  • PUBLIC_OWN:表示公网自建实例。

  • RDS:表示RDS实例。

  • ECS_OWN:表示ECS自建实例。

  • VPC_IDC:表示 VPC IDC 自建实例。

  • GATEWAY:表示数据库网关实例。

NetworkType

String

网络类型。

取值如下:

  • CLASSIC:经典网络

  • VPC:VPC网络

Port

Integer

数据库连接端口。

QueryTimeout

Integer

查询超时时间。

单位:s(秒)。

SafeRule

String

为该实例设置安全规则集(GroupName)。

DataLinkName

String

输入跨库查询 datalink名称。

说明
  • 如果 UseDsql 取值为 1,此值必填。

  • DBLink 名称只能使用小写字母和下划线(_)。

  • DBLink 名称需要在租户内保持全局唯一性。

DdlOnline

Integer

是否开启DMS结构变更优先,

取值如下:

  • 0 :不使用。

  • 1 :原生 Online DDL优先。

  • 2 :DMS 无锁表结构变更优先。

说明
  • 支持的数据库类型:RDS MySQL、PolarDB MySQL 引擎、MyBase MySQL、其他来源 MySQL。

EcsRegion

String

实例所在地域。

说明

如果 InstanceSource取值为 RDS、ECS_OWN、GATEWAY或 VPC_IDC,此值必填。

EnableSellSitd

String

是否需要为该实例开启敏感数据保护功能。

取值:

  • Y:开启。

  • NULL 或其它:不开启。

EnableSellStable

String

实例是否需要开通稳定变更功能。

取值:

  • Y:开通。

  • NULL或其它:不开通。

EnableSellCommon

String

实例是否需要开通安全协同功能。

说明
  • Y:开启。

  • NULL 或其它:不开启。

EcsInstanceId

String

ECS实例ID。

例如您的实例是数据库网关实例,则此处需要填写网关 ID。

说明

如果 InstanceSource取值为 ECS_OWN或 GATEWAY,此值必填。

SkipTest

Boolean

实例是否忽略测试连通性。

取值如下:

  • true:忽略。

  • false:不忽略。

Sid

String

实例Sid。

说明

如果 InstanceType 为 ORACLE,此项必填。

TemplateId

Integer

分类分级模板 ID。

TemplateType

String

分类分级模板类型。

Tid

Integer

租户ID。

UseSsl

Integer

选择是否开启 SSL连接。

开启后,DMS 将通过SSL连接到数据库。使用该参数的前提是数据库已开启SSL连接,当前支持如下选项:

  • 0:默认值(DMS与数据库服务自动协商是否开启)系统将自动识别目标数据库是否已开启 SSL连接,若数据库已开启 SSL连接,则DMS将通过SSL 连接数据库;若数据库未开启SSL连接,则通过普通方式进行连接。

  • 1:开启 SSL连接。若数据库未开启SSL连接,则该参数无效。

  • -1:关闭SSL连接。

说明

说明

  • 该配置项仅在数据库为 MySQL 或 Redis 时出现。

  • SSL(Secure Sockets Layer)能在传输层对网络连接进行加密,提升通信数据的安全性和完整性,但会增加网络连接响应时间。

UseDsql

Integer

是否启用跨实例查询。

取值如下:

  • 0:不开启。

  • 1:开启。

说明

支持的数据库类型:MySQL、SQL Server、PostgreSQL、PolarDB O 引擎、Redis。

VpcId

String

专有网络VPC 的实例ID。

说明

如果 InstanceSource 取值为 VPC_IDC 时,此值必填。

返回值

Fn::GetAtt

  • InstanceId:实例ID。

  • Port:实例连接端口。

  • Host:实例链接地址。

示例

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DatabasePassword:
    Type: String
    Description:
      en: The logon password of the database instance.
    Required: true
  Port:
    Type: Number
    Description:
      en: The connection port of the database instance.
    Required: true
  SafeRule:
    Type: String
    Description:
      en: |-
        The security rule of the database instance. Enter the name of the security rule for
        your enterprise.
        Note To query a specified security rule, log on to the DMS Enterprise console and choose
        System Management > Security Rules. The security rule appears in the security rule
        list.
    Required: true
  ExportTimeout:
    Type: Number
    Description:
      en: 'The timeout period for exporting the database instance. Unit: seconds.'
    Required: true
  EnvType:
    Type: String
    Description:
      en: |-
        The type of the environment to which the database instance belongs. Valid values:
        product: the production environment.
        dev: the test environment.
    Required: true
  DbaId:
    Type: Number
    Description:
      en: The user ID of the instance DBA role. You can call the ListUsers or GetInstance operation to obtain the value of this parameter.
    Required: true
  InstanceAlias:
    Type: String
    Description:
      en: |-
        The alias of the database instance. The alias helps you quickly find the required
        instance.
    Required: true
  NetworkType:
    Type: String
    Description:
      en: |-
        The network type of the database instance. Valid values:
        CLASSIC
        VPC
    AllowedValues:
      - CLASSIC
      - VPC
    Required: true
  EnableSellTrust:
    Type: String
    Description:
      en: |-
        Whether the instance needs to enable secure hosting.
        - Y: Enable secure hosting mode.
        - NULL or other: Do not enable secure hosting mode.
    Required: true
  InstanceType:
    Type: String
    Description:
      en: 'The type of the database instance. Valid values: MySQL, SQLServer, PostgreSQL, Oracle, DRDS, OceanBase, Mongo, Redis'
    Required: true
  QueryTimeout:
    Type: Number
    Description:
      en: 'The timeout period for querying the database instance. Unit: seconds.'
    Required: true
  InstanceSource:
    Type: String
    Description:
      en: |-
        The source of the database instance. Valid values:
        PUBLIC_OWN: an on-premises database built on the public network.
        RDS: an ApsaraDB for RDS (RDS) instance.
        ECS_OWN: an on-premises database built on an Elastic Compute Service (ECS) instance.
        VPC_IDC: an on-premises database built in an Internet data center (IDC) in Virtual Private
        Cloud (VPC).
    Required: true
  Host:
    Type: String
    Description:
      en: The endpoint of the database instance.
    Required: true
  DatabaseUser:
    Type: String
    Description:
      en: The logon username of the database instance.
    Required: true
Resources:
  Instance2:
    Type: ALIYUN::DMS::Instance2
    Properties:
      DatabasePassword:
        Ref: DatabasePassword
      Port:
        Ref: Port
      SafeRule:
        Ref: SafeRule
      ExportTimeout:
        Ref: ExportTimeout
      EnvType:
        Ref: EnvType
      DbaId:
        Ref: DbaId
      InstanceAlias:
        Ref: InstanceAlias
      NetworkType:
        Ref: NetworkType
      EnableSellTrust:
        Ref: EnableSellTrust
      InstanceType:
        Ref: InstanceType
      QueryTimeout:
        Ref: QueryTimeout
      InstanceSource:
        Ref: InstanceSource
      Host:
        Ref: Host
      DatabaseUser:
        Ref: DatabaseUser
Outputs:
  InstanceId:
    Description: The ID of the database instance.
    Value:
      Fn::GetAtt:
        - Instance2
        - InstanceId
  Port:
    Description: The connection port of the database instance.
    Value:
      Fn::GetAtt:
        - Instance2
        - Port
  Host:
    Description: The endpoint of the database instance.
    Value:
      Fn::GetAtt:
        - Instance2
        - Host
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DatabasePassword": {
      "Type": "String",
      "Description": {
        "en": "The logon password of the database instance."
      },
      "Required": true
    },
    "Port": {
      "Type": "Number",
      "Description": {
        "en": "The connection port of the database instance."
      },
      "Required": true
    },
    "SafeRule": {
      "Type": "String",
      "Description": {
        "en": "The security rule of the database instance. Enter the name of the security rule for\nyour enterprise.\nNote To query a specified security rule, log on to the DMS Enterprise console and choose\nSystem Management > Security Rules. The security rule appears in the security rule\nlist."
      },
      "Required": true
    },
    "ExportTimeout": {
      "Type": "Number",
      "Description": {
        "en": "The timeout period for exporting the database instance. Unit: seconds."
      },
      "Required": true
    },
    "EnvType": {
      "Type": "String",
      "Description": {
        "en": "The type of the environment to which the database instance belongs. Valid values:\nproduct: the production environment.\ndev: the test environment."
      },
      "Required": true
    },
    "DbaId": {
      "Type": "Number",
      "Description": {
        "en": "The user ID of the instance DBA role. You can call the ListUsers or GetInstance operation to obtain the value of this parameter."
      },
      "Required": true
    },
    "InstanceAlias": {
      "Type": "String",
      "Description": {
        "en": "The alias of the database instance. The alias helps you quickly find the required\ninstance."
      },
      "Required": true
    },
    "NetworkType": {
      "Type": "String",
      "Description": {
        "en": "The network type of the database instance. Valid values:\nCLASSIC\nVPC"
      },
      "AllowedValues": [
        "CLASSIC",
        "VPC"
      ],
      "Required": true
    },
    "EnableSellTrust": {
      "Type": "String",
      "Description": {
        "en": "Whether the instance needs to enable secure hosting.\n- Y: Enable secure hosting mode.\n- NULL or other: Do not enable secure hosting mode."
      },
      "Required": true
    },
    "InstanceType": {
      "Type": "String",
      "Description": {
        "en": "The type of the database instance. Valid values: MySQL, SQLServer, PostgreSQL, Oracle, DRDS, OceanBase, Mongo, Redis"
      },
      "Required": true
    },
    "QueryTimeout": {
      "Type": "Number",
      "Description": {
        "en": "The timeout period for querying the database instance. Unit: seconds."
      },
      "Required": true
    },
    "InstanceSource": {
      "Type": "String",
      "Description": {
        "en": "The source of the database instance. Valid values:\nPUBLIC_OWN: an on-premises database built on the public network.\nRDS: an ApsaraDB for RDS (RDS) instance.\nECS_OWN: an on-premises database built on an Elastic Compute Service (ECS) instance.\nVPC_IDC: an on-premises database built in an Internet data center (IDC) in Virtual Private\nCloud (VPC)."
      },
      "Required": true
    },
    "Host": {
      "Type": "String",
      "Description": {
        "en": "The endpoint of the database instance."
      },
      "Required": true
    },
    "DatabaseUser": {
      "Type": "String",
      "Description": {
        "en": "The logon username of the database instance."
      },
      "Required": true
    }
  },
  "Resources": {
    "Instance2": {
      "Type": "ALIYUN::DMS::Instance2",
      "Properties": {
        "DatabasePassword": {
          "Ref": "DatabasePassword"
        },
        "Port": {
          "Ref": "Port"
        },
        "SafeRule": {
          "Ref": "SafeRule"
        },
        "ExportTimeout": {
          "Ref": "ExportTimeout"
        },
        "EnvType": {
          "Ref": "EnvType"
        },
        "DbaId": {
          "Ref": "DbaId"
        },
        "InstanceAlias": {
          "Ref": "InstanceAlias"
        },
        "NetworkType": {
          "Ref": "NetworkType"
        },
        "EnableSellTrust": {
          "Ref": "EnableSellTrust"
        },
        "InstanceType": {
          "Ref": "InstanceType"
        },
        "QueryTimeout": {
          "Ref": "QueryTimeout"
        },
        "InstanceSource": {
          "Ref": "InstanceSource"
        },
        "Host": {
          "Ref": "Host"
        },
        "DatabaseUser": {
          "Ref": "DatabaseUser"
        }
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "The ID of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance2",
          "InstanceId"
        ]
      }
    },
    "Port": {
      "Description": "The connection port of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance2",
          "Port"
        ]
      }
    },
    "Host": {
      "Description": "The endpoint of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance2",
          "Host"
        ]
      }
    }
  }
}
                        
  • 本页导读 (1)
  • 语法
  • 属性
  • 返回值
  • 示例
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等