All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DMS::Instance2

更新时间:Mar 03, 2025

ALIYUN::DMS::Instance2 is used to register a database instance in new Data Management (DMS).

Syntax

{
  "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
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DatabasePassword

String

Yes

Yes

The password of the database account.

None.

DbaId

Integer

Yes

Yes

The ID of the user who assumes the database administrator (DBA) role of the database instance.

None.

DatabaseUser

String

Yes

Yes

The database account.

None.

ExportTimeout

Integer

Yes

Yes

The timeout period for exporting data.

Unit: seconds.

EnvType

String

Yes

Yes

The type of the environment.

Valid values:

  • product: production environment.

  • dev: development environment.

  • pre: pre-release environment.

  • test: test environment.

  • sit: system integration testing (SIT) environment.

  • uat: user acceptance testing (UAT) environment.

  • pet: stress testing environment.

  • stag: staging environment.

EnableSellTrust

String

Yes

Yes

Specifies whether to enable the security hosting feature for the database instance.

Valid values:

  • Y: enables the security hosting feature for the database instance.

  • NULL or another value: disables the security hosting feature for the database instance.

Host

String

Yes

Yes

The endpoint of the database.

None.

InstanceAlias

String

Yes

Yes

The alias of the database instance.

None.

InstanceType

String

Yes

Yes

The type of the database engine.

None.

InstanceSource

String

Yes

Yes

The source of the database instance.

Valid values:

  • PUBLIC_OWN: a self-managed database instance that is deployed on the Internet.

  • RDS: an ApsaraDB RDS instance.

  • ECS_OWN: a self-managed database instance that is deployed on an Elastic Compute Service (ECS) instance.

  • VPC_IDC: a self-managed database instance that is deployed in a data center connected over a virtual private cloud (VPC).

  • GATEWAY: a database instance connected by using a database gateway.

NetworkType

String

Yes

Yes

The type of the network.

Valid values:

  • CLASSIC: classic network.

  • VPC: VPC.

Port

Integer

Yes

Yes

The port of the database instance.

None.

QueryTimeout

Integer

Yes

Yes

The timeout period for querying data.

Unit: seconds.

SafeRule

String

Yes

Yes

The security rule set that you want to configure for the database instance. The name of the security rule set is specified by GroupName.

None.

DataLinkName

String

No

Yes

The name of the database link for cross-database queries.

Note
  • This property must be specified when UseDsql is set to 1.

  • The name can contain only lowercase letters and underscores (_).

  • The name must be unique within a tenant.

DdlOnline

Integer

No

Yes

Specifies whether to enable the lock-free schema change feature.

Valid values:

  • 0: disables the lock-free schema change feature.

  • 1: uses the online DDL of MySQL first.

  • 2: enables the lock-free schema change feature.

Note
  • The following types of databases are supported: ApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQL, and third-party MySQL databases.

EcsRegion

String

No

Yes

The region of the database instance.

Note

This property must be specified when InstanceSource is set to RDS, ECS_OWN, GATEWAY, or VPC_IDC.

EnableSellSitd

String

No

Yes

Specifies whether to enable the sensitive data protection feature for the database instance.

Valid values:

  • Y: enables the sensitive data protection feature for the database instance.

  • NULL or another value: disables the sensitive data protection feature for the database instance.

EnableSellStable

String

No

Yes

Specifies whether to enable the Stable Change feature for the database instance.

Valid values:

  • Y: enables the Stable Change feature for the database instance.

  • NULL or another value: disables the Stable Change feature for the database instance.

EnableSellCommon

String

No

Yes

Specifies whether to enable the Security Collaboration feature for the database instance.

Note
  • Y: enables the Security Collaboration feature for the database instance.

  • NULL or another value: disables the Security Collaboration feature for the database instance.

EcsInstanceId

String

No

Yes

The ID of the ECS instance.

If your instance is a database instance connected by using a database gateway, specify the gateway ID as the value of this property.

Note

This property must be specified when InstanceSource is set to ECS_OWN or GATEWAY.

SkipTest

Boolean

No

Yes

Specifies whether to skip the connectivity test for the database instance.

Valid values:

  • true

  • false

Sid

String

No

Yes

The system ID (SID) of the database instance.

Note

This property must be specified when InstanceType is set to ORACLE.

TemplateId

Integer

No

Yes

The ID of the classification and grading template.

None.

TemplateType

String

No

Yes

The type of the classification and grading template.

None.

Tid

Integer

No

Yes

The ID of the tenant.

None.

UseSsl

Integer

No

Yes

Specifies whether to enable the SSL connection feature for the database instance.

If you enable the feature for the database instance, DMS can connect to the database by using SSL. This property is available only when the SSL connection feature is already enabled for the database. Valid values:

  • 0 (default): DMS automatically negotiates with the database service to determine whether to enable the SSL connection feature for the database instance. If the feature is already enabled for the database, DMS connects to the database by using SSL. If the feature is disabled for the database, DMS connects to the database without using SSL.

  • 1: enables the SSL connection feature for the database instance. This value is invalid when the SSL connection feature is disabled for the database.

  • -1: disables the SSL connection feature for the database instance.

Note

Take note of the following information:

  • This property is available only for MySQL or Redis databases.

  • SSL encrypts network connections at the transport layer to improve the security and integrity of data in transmission. However, SSL increases the response time of network connections.

UseDsql

Integer

No

Yes

Specifies whether to enable the cross-database query feature.

Valid values:

  • 0: disables the cross-database query feature.

  • 1: enables the cross-database query feature.

Note

The following types of databases are supported: MySQL, SQL Server, PostgreSQL, PolarDB for Oracle, and Redis databases.

VpcId

String

No

Yes

The ID of the VPC.

Note

This property must be specified when InstanceSource is set to VPC_IDC.

Return values

Fn::GetAtt

  • InstanceId: the ID of the database instance.

  • Port: the port of the database instance.

  • Host: the endpoint of the database instance.

Examples

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"
        ]
      }
    }
  }
}