Todos los productos
Search
Centro de documentos

Resource Orchestration Service:ALIYUN::DMS::Instance

Última actualización: Sep 04, 2026

ALIYUN::DMS::Instance registra una instancia de base de datos para su empresa.

Sintaxis

{
  "Type": "ALIYUN::DMS::Instance",
  "Properties": {
    "InstanceSource": String,
    "DatabasePassword": String,
    "Port": Integer,
    "Host": String,
    "ExportTimeout": Integer,
    "SafeRule": String,
    "DdlOnline": Integer,
    "EnvType": String,
    "Tid": Integer,
    "UseDsql": Integer,
    "Sid": String,
    "EcsInstanceId": String,
    "VpcId": String,
    "InstanceAlias": String,
    "DbaUid": Integer,
    "EcsRegion": String,
    "NetworkType": String,
    "DatabaseUser": String,
    "InstanceType": String,
    "DataLinkName": String,
    "QueryTimeout": Integer
  }
}

Propiedades

Nombre de la propiedad

Tipo

Obligatorio

Permite actualizaciones

Descripción

Restricción

InstanceSource

String

Sí

No

Origen de la instancia de base de datos.

Valores válidos:

  • PUBLIC_OWN: base de datos autogestionada en la red pública

  • RDS: instancia de ApsaraDB RDS

  • ECS_OWN: base de datos autogestionada en una instancia de ECS

  • VPC_IDC: base de datos autogestionada en un centro de datos conectado mediante VPC

DatabasePassword

String

Sí

Sí

Contraseña para conectarse a la instancia de base de datos.

Ninguna.

Port

Integer

Sí

No

Puerto de conexión de la instancia de base de datos.

Ninguna.

Host

String

Sí

No

Endpoint de la instancia de base de datos.

Ninguna.

ExportTimeout

Integer

Sí

Sí

Tiempo de espera para exportar datos.

Unidad: segundos.

SafeRule

String

Sí

Sí

Regla de seguridad para la instancia de base de datos. Use una regla definida en su empresa.

Ninguna.

DdlOnline

Integer

No

No

Indica si se debe habilitar el servicio DDL en línea.

Valores válidos:

  • 0: deshabilitado

  • 1: preferir DDL en línea nativo

  • 2: preferir cambio de esquema sin bloqueo de DMS

Nota

Compatible solo con MySQL y PolarDB.

EnvType

String

Sí

Sí

Tipo de entorno.

Valores válidos:

  • product: entorno de producción

  • dev: entorno de desarrollo

  • pre: entorno de prelanzamiento

  • test: entorno de pruebas

  • sit: entorno de prueba de integración del sistema (SIT)

  • uat: entorno de prueba de aceptación de usuario (UAT)

  • pet: entorno de prueba de estrés

  • stag: entorno de staging

Tid

Integer

No

No

ID del inquilino.

Ninguna.

UseDsql

Integer

No

No

Indica si se deben habilitar las consultas entre instancias.

Valores válidos:

  • 0: deshabilitado.

  • 1: habilitado

Sid

String

No

No

ID del sistema (SID) de la base de datos.

Obligatorio cuando InstanceType es PostgreSQL u Oracle.

EcsInstanceId

String

No

No

ID de la instancia de ECS.

Obligatorio cuando InstanceSource es ECS_OWN.

VpcId

String

No

No

ID de la VPC.

Obligatorio cuando InstanceSource es VPC_IDC.

InstanceAlias

String

Sí

Sí

Nombre de la instancia de base de datos.

Ninguna.

DbaUid

Integer

Sí

No

UID de Alibaba Cloud del propietario de la instancia de base de datos.

Ninguna.

EcsRegion

String

No

No

Región donde reside la instancia.

Obligatorio cuando InstanceSource es RDS, ECS_OWN o VPC_IDC.

NetworkType

String

Sí

No

Tipo de red.

Valores válidos:

  • CLASSIC: red clásica

  • VPC: Virtual Private Cloud

DatabaseUser

String

Sí

Sí

Nombre de usuario para conectarse a la instancia de base de datos.

Ninguna.

InstanceType

String

Sí

No

Tipo de la instancia de base de datos.

Valores válidos:

  • MySQL

  • SQLServer

  • PostgreSQL

  • Oracle

  • DRDS

  • OceanBase

  • Mongo

  • Redis

DataLinkName

String

No

No

Nombre del vínculo de datos para consultas entre bases de datos.

Ninguna.

QueryTimeout

Integer

Sí

Sí

Tiempo de espera para consultar datos.

Unidad: segundos.

Valores de retorno

Fn::GetAtt

  • InstanceId: ID de la instancia de base de datos.

  • Port: puerto de conexión de la instancia de base de datos.

  • Host: endpoint de la instancia de base de datos.

Ejemplos

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceSource:
    Type: String
    Description: >-
      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).
  DatabasePassword:
    Type: String
    Description: The logon password of the database instance.
  Port:
    Type: Number
    Description: The connection port of the database instance.
  Host:
    Type: String
    Description: The endpoint of the database instance.
  ExportTimeout:
    Type: Number
    Description: 'The timeout period for exporting the database instance. Unit: seconds.'
  SafeRule:
    Type: String
    Description: >-
      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.
  DdlOnline:
    Type: Number
    Description: >-
      [Important] Specifies whether to enable the online data description
      language (DDL)

      service. Currently, this service is available only for the MySQL and
      PolarDB databases.
      0: The service is disabled.
      1: The native online DDL service prevails.
      2: Data change without table locking provided by DMS prevails.
  EnvType:
    Type: String
    Description: >-
      The type of the environment to which the database instance belongs. Valid
      values:
      product: the production environment.
      dev: the test environment.
  Tid:
    Type: Number
    Description: >-
      The ID of the tenant.
      Note To query the ID, log on to the DMS Enterprise console and choose
      System Management
      > Instance Management or System Management > User Management. The ID of
      the tenant
      appears in the Service Specification section.
  UseDsql:
    Type: Number
    Description: >-
      Specifies whether to enable cross-database query for the database
      instance. Valid
      values:
      0: disabled
      1: enabled
    AllowedValues:
      - 0
      - 1
  Sid:
    Type: String
    Description: >-
      The system ID (SID) of the database instance.
      Note You must specify this parameter if the InstanceType parameter is set
      to PostgreSQL or Oracle.
  EcsInstanceId:
    Type: String
    Description: >-
      The ID of the ECS instance to which the database instance belongs.
      Note You must specify this parameter if the InstanceSource parameter is
      set to ECS_OWN.
  VpcId:
    Type: String
    Description: >-
      The ID of the VPC to which the database instance belongs.
      Note You must specify this parameter if the InstanceSource parameter is
      set to VPC_IDC.
  DbaUid:
    Type: Number
    Description: >-
      The Alibaba Cloud unique ID (UID) of the database administrator (DBA) of
      the database
      instance.
      Note To query the UID, log on to the DMS Enterprise console and choose
      System Management
      > User Management.
  EcsRegion:
    Type: String
    Description: >-
      The region where the database instance resides.
      Note You must specify this parameter if the InstanceSource parameter is
      set to ECS_OWN or VPC_IDC.
  NetworkType:
    Type: String
    Description: |-
      The network type of the database instance. Valid values:
      CLASSIC
      VPC
    AllowedValues:
      - CLASSIC
      - VPC
  InstanceAlias:
    Type: String
    Description: >-
      The alias of the database instance. The alias helps you quickly find the
      required
      instance.
  DatabaseUser:
    Type: String
    Description: The logon username of the database instance.
  InstanceType:
    Type: String
    Description: >-
      The type of the database instance. Valid values: MySQL, SQLServer,
      PostgreSQL, Oracle, DRDS, OceanBase, Mongo, Redis
    AllowedValues:
      - MySQL
      - SQLServer
      - PostgreSQL
      - Oracle
      - DRDS
      - OceanBase
      - Mongo
      - Redis
  DataLinkName:
    Type: String
    Description: The name of the data link for cross-database query.
  QueryTimeout:
    Type: Number
    Description: 'The timeout period for querying the database instance. Unit: seconds.'
Resources:
  Instance:
    Type: 'ALIYUN::DMS::Instance'
    Properties:
      InstanceSource:
        Ref: InstanceSource
      DatabasePassword:
        Ref: DatabasePassword
      Port:
        Ref: Port
      Host:
        Ref: Host
      ExportTimeout:
        Ref: ExportTimeout
      SafeRule:
        Ref: SafeRule
      DdlOnline:
        Ref: DdlOnline
      EnvType:
        Ref: EnvType
      Tid:
        Ref: Tid
      UseDsql:
        Ref: UseDsql
      Sid:
        Ref: Sid
      EcsInstanceId:
        Ref: EcsInstanceId
      VpcId:
        Ref: VpcId
      DbaUid:
        Ref: DbaUid
      EcsRegion:
        Ref: EcsRegion
      NetworkType:
        Ref: NetworkType
      InstanceAlias:
        Ref: InstanceAlias
      DatabaseUser:
        Ref: DatabaseUser
      InstanceType:
        Ref: InstanceType
      DataLinkName:
        Ref: DataLinkName
      QueryTimeout:
        Ref: QueryTimeout
Outputs:
  InstanceId:
    Description: The ID of the database instance.
    Value:
      'Fn::GetAtt':
        - Instance
        - InstanceId
  Port:
    Description: The connection port of the database instance.
    Value:
      'Fn::GetAtt':
        - Instance
        - Port
  Host:
    Description: The endpoint of the database instance.
    Value:
      'Fn::GetAtt':
        - Instance
        - Host

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceSource": {
      "Type": "String",
      "Description": "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)."
    },
    "DatabasePassword": {
      "Type": "String",
      "Description": "The logon password of the database instance."
    },
    "Port": {
      "Type": "Number",
      "Description": "The connection port of the database instance."
    },
    "Host": {
      "Type": "String",
      "Description": "The endpoint of the database instance."
    },
    "ExportTimeout": {
      "Type": "Number",
      "Description": "The timeout period for exporting the database instance. Unit: seconds."
    },
    "SafeRule": {
      "Type": "String",
      "Description": "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."
    },
    "DdlOnline": {
      "Type": "Number",
      "Description": "[Important] Specifies whether to enable the online data description language (DDL)\nservice. Currently, this service is available only for the MySQL and PolarDB databases.\n0: The service is disabled.\n1: The native online DDL service prevails.\n2: Data change without table locking provided by DMS prevails."
    },
    "EnvType": {
      "Type": "String",
      "Description": "The type of the environment to which the database instance belongs. Valid values:\nproduct: the production environment.\ndev: the test environment."
    },
    "Tid": {
      "Type": "Number",
      "Description": "The ID of the tenant.\nNote To query the ID, log on to the DMS Enterprise console and choose System Management\n> Instance Management or System Management > User Management. The ID of the tenant\nappears in the Service Specification section."
    },
    "UseDsql": {
      "Type": "Number",
      "Description": "Specifies whether to enable cross-database query for the database instance. Valid\nvalues:\n0: disabled\n1: enabled",
      "AllowedValues": [
        0,
        1
      ]
    },
    "Sid": {
      "Type": "String",
      "Description": "The system ID (SID) of the database instance.\nNote You must specify this parameter if the InstanceType parameter is set to PostgreSQL or Oracle."
    },
    "EcsInstanceId": {
      "Type": "String",
      "Description": "The ID of the ECS instance to which the database instance belongs.\nNote You must specify this parameter if the InstanceSource parameter is set to ECS_OWN."
    },
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the VPC to which the database instance belongs.\nNote You must specify this parameter if the InstanceSource parameter is set to VPC_IDC."
    },
    "DbaUid": {
      "Type": "Number",
      "Description": "The Alibaba Cloud unique ID (UID) of the database administrator (DBA) of the database\ninstance.\nNote To query the UID, log on to the DMS Enterprise console and choose System Management\n> User Management."
    },
    "EcsRegion": {
      "Type": "String",
      "Description": "The region where the database instance resides.\nNote You must specify this parameter if the InstanceSource parameter is set to ECS_OWN or VPC_IDC."
    },
    "NetworkType": {
      "Type": "String",
      "Description": "The network type of the database instance. Valid values:\nCLASSIC\nVPC",
      "AllowedValues": [
        "CLASSIC",
        "VPC"
      ]
    },
    "InstanceAlias": {
      "Type": "String",
      "Description": "The alias of the database instance. The alias helps you quickly find the required\ninstance."
    },
    "DatabaseUser": {
      "Type": "String",
      "Description": "The logon username of the database instance."
    },
    "InstanceType": {
      "Type": "String",
      "Description": "The type of the database instance. Valid values: MySQL, SQLServer, PostgreSQL, Oracle, DRDS, OceanBase, Mongo, Redis",
      "AllowedValues": [
        "MySQL",
        "SQLServer",
        "PostgreSQL",
        "Oracle",
        "DRDS",
        "OceanBase",
        "Mongo",
        "Redis"
      ]
    },
    "DataLinkName": {
      "Type": "String",
      "Description": "The name of the data link for cross-database query."
    },
    "QueryTimeout": {
      "Type": "Number",
      "Description": "The timeout period for querying the database instance. Unit: seconds."
    }
  },
  "Resources": {
    "Instance": {
      "Type": "ALIYUN::DMS::Instance",
      "Properties": {
        "InstanceSource": {
          "Ref": "InstanceSource"
        },
        "DatabasePassword": {
          "Ref": "DatabasePassword"
        },
        "Port": {
          "Ref": "Port"
        },
        "Host": {
          "Ref": "Host"
        },
        "ExportTimeout": {
          "Ref": "ExportTimeout"
        },
        "SafeRule": {
          "Ref": "SafeRule"
        },
        "DdlOnline": {
          "Ref": "DdlOnline"
        },
        "EnvType": {
          "Ref": "EnvType"
        },
        "Tid": {
          "Ref": "Tid"
        },
        "UseDsql": {
          "Ref": "UseDsql"
        },
        "Sid": {
          "Ref": "Sid"
        },
        "EcsInstanceId": {
          "Ref": "EcsInstanceId"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "DbaUid": {
          "Ref": "DbaUid"
        },
        "EcsRegion": {
          "Ref": "EcsRegion"
        },
        "NetworkType": {
          "Ref": "NetworkType"
        },
        "InstanceAlias": {
          "Ref": "InstanceAlias"
        },
        "DatabaseUser": {
          "Ref": "DatabaseUser"
        },
        "InstanceType": {
          "Ref": "InstanceType"
        },
        "DataLinkName": {
          "Ref": "DataLinkName"
        },
        "QueryTimeout": {
          "Ref": "QueryTimeout"
        }
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "The ID of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "InstanceId"
        ]
      }
    },
    "Port": {
      "Description": "The connection port of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Port"
        ]
      }
    },
    "Host": {
      "Description": "The endpoint of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "Instance",
          "Host"
        ]
      }
    }
  }
}