All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DTS::SubscriptionInstance

Last Updated:Jan 29, 2024

ALIYUN::DTS::SubscriptionInstance is used to create a change tracking instance and configure a change tracking task.

Note

We recommend that you use ALIYUN::DTS::Instance to purchase a Data Transmission Service (DTS) instance and ALIYUN::DTS::SubscriptionJob2 to configure a change tracking task.

Syntax

{
  "Type": "ALIYUN::DTS::SubscriptionInstance",
  "Properties": {
    "Configuration": Map,
    "SourceEndpointInstanceType": String,
    "Period": String,
    "PayType": String,
    "UsedTime": Integer,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Configuration

Map

No

Yes

The configurations of the change tracking instance.

For more information, see Configuration properties.

SourceEndpointInstanceType

String

No

No

The type of the change tracking instance.

Valid values:

  • MySQL (default)

  • PolarDB

  • DRDS

  • Oracle

Period

String

No

No

The unit of the subscription duration of the change tracking instance.

Valid values:

  • Year

  • Month

Note

You must specify this property when PayType is set to Prepaid.

PayType

String

No

No

The billing method.

Valid values:

  • Postpaid (default)

  • Prepaid

UsedTime

Integer

No

No

The subscription duration of the change tracking instance.

  • Valid values when Period is set to Year: 1 to 5.

  • Valid values when Period is set to Month: 1 to 60.

Note

You must specify this property when PayType is set to Prepaid.

Tags

List

No

Yes

The custom tags that you want to add to the change tracking instance.

For more information, see Tags properties.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length

and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length

and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Configuration syntax

"Configuration": {
  "SubscriptionDataType": Map,
  "SubscriptionInstanceName": String,
  "SubscriptionInstance": Map,
  "SourceEndpoint": Map,
  "SubscriptionInstanceNetworkType": String,
  "DbList": Map
}

Configuration properties

Property

Type

Required

Editable

Description

Constraint

SubscriptionDataType

Map

Yes

No

The type of the data whose changes you want to track.

For more information, see SubscriptionDataType properties.

SubscriptionInstanceName

String

No

No

The name of the change tracking instance.

None.

SubscriptionInstance

Map

No

No

The network configurations of the change tracking instance.

For more information, see SubscriptionInstance properties.

SourceEndpoint

Map

Yes

Yes

The connection information about the source instance.

For more information, see SourceEndpoint properties.

SubscriptionInstanceNetworkType

String

No

No

The network type of the change tracking instance.

Valid values:

  • classic: classic network

  • vpc: virtual private cloud (VPC)

DbList

Map

No

No

The objects whose changes you want to track.

For more information, see Objects of DTS tasks.

TableIncludes syntax

"TableIncludes": [
  {
    "TableName": String
  }
]

TableIncludes property

Property

Type

Required

Editable

Description

Constraint

TableName

String

No

No

The name of the table whose changes you want to track.

None.

TableExcludes syntax

"TableExcludes": [
  {
    "TableName": String
  }
]

TableExcludes property

Property

Type

Required

Editable

Description

Constraint

TableName

String

No

No

The name of the table whose changes you do not want to track from the source database.

None.

SubscriptionDataType syntax

"SubscriptionDataType": {
  "DML": Boolean,
  "DDL": Boolean
}

SubscriptionDataType properties

Property

Type

Required

Editable

Description

Constraint

DML

Boolean

Yes

No

Specifies whether to track changes of data manipulation language (DML) statements.

Valid values:

  • true

  • false

DDL

Boolean

Yes

No

Specifies whether to track changes of data definition language (DDL) statements.

Valid values:

  • true

  • false

SubscriptionInstance syntax

"SubscriptionInstance": {
  "VPCId": String,
  "VSwitchId": String
}

SubscriptionInstance properties

Property

Type

Required

Editable

Description

Constraint

VPCId

String

Yes

No

The VPC ID of the change tracking instance.

This property takes effect when SubscriptionInstanceNetworkType is set to vpc.

VSwitchId

String

Yes

No

The vSwitch ID of the change tracking instance.

This property takes effect when SubscriptionInstanceNetworkType is set to vpc.

SourceEndpoint syntax

"SourceEndpoint": {
  "Role": String,
  "OracleSID": String,
  "UserName": String,
  "OwnerID": String,
  "InstanceID": String,
  "IP": String,
  "Port": String,
  "DatabaseName": String,
  "InstanceType": String,
  "Password": String
}

SourceEndpoint properties

Property

Type

Required

Editable

Description

Constraint

Role

String

No

No

The Resource Access Management (RAM) role that the Alibaba Cloud account of the source ApsaraDB RDS instance assigns to the Alibaba Cloud account of the destination instance. This property takes effect when the source ApsaraDB RDS instance and the destination instance belong to different Alibaba Cloud accounts.

None.

OracleSID

String

No

No

The name of the source Oracle instance. This property takes effect when the engine type of the source instance is Oracle.

None.

UserName

String

Yes

No

The username that is used to access the database on the source instance.

None.

OwnerID

String

No

No

The ID of the Alibaba Cloud account to which the source ApsaraDB RDS instance belongs. This property takes effect when the source ApsaraDB RDS instance and the destination instance belong to different Alibaba Cloud accounts.

None.

InstanceID

String

No

No

The ID of the source instance.

None.

IP

String

No

No

The IP address of the source instance.

You must specify this property when the source instance is a self-managed database.

Port

String

No

No

The port number of the source instance.

You must specify this property when the source instance is a self-managed database.

DatabaseName

String

No

No

The name of the database that you want to use to establish the connection.

None.

InstanceType

String

Yes

No

The type of the source instance.

Valid values:

  • RDS: ApsaraDB RDS instance

  • ECS: self-managed database that is hosted on an Elastic Compute Service (ECS) instance

Password

String

Yes

Yes

The password that is used to log on to the source instance.

None.

Return values

Fn::GetAtt

  • SubscriptionInstanceId: the ID of the change tracking instance.

  • VPCHost: the VPC endpoint of the change tracking instance.

  • PublicHost: the public endpoint of the change tracking instance.

  • PrivateHost: the private endpoint of the change tracking instance.

  • SubscribeTopic: the topic of the change tracking instance.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      VpcId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
      VSwitchId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
      RdsId:
        Type: String
        AssociationProperty: ALIYUN::RDS::Instance::InstanceId
    Resources:
      SubscriptionInstance:
        Type: ALIYUN::DTS::SubscriptionInstance
        Properties:
          SourceEndpointInstanceType: MySQL
          Configuration:
            SubscriptionObject:
              - DBName: DemoDB
            SubscriptionDataType:
              DDL: true
              DML: false
            SubscriptionInstanceName: TestSubscription
            SourceEndpoint:
              InstanceType: RDS
              UserName: DBAdmin
              Password: Admin@123!
              InstanceID:
                Ref: RdsId
            SubscriptionInstanceNetworkType: vpc
            SubscriptionInstance:
              VPCId:
                Ref: VpcId
              VSwitchId:
                Ref: VSwitchId
    Outputs:
      PublicHost:
        Description: Public host.
        Value:
          Fn::GetAtt:
            - SubscriptionInstance
            - PublicHost
      PrivateHost:
        Description: Private host.
        Value:
          Fn::GetAtt:
            - SubscriptionInstance
            - PrivateHost
      SubscriptionInstanceId:
        Description: The ID of Data subscription instance.
        Value:
          Fn::GetAtt:
            - SubscriptionInstance
            - SubscriptionInstanceId
      VPCHost:
        Description: VPC host.
        Value:
          Fn::GetAtt:
            - SubscriptionInstance
            - VPCHost
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "VpcId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        },
        "VSwitchId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          }
        },
        "RdsId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::RDS::Instance::InstanceId"
        }
      },
      "Resources": {
        "SubscriptionInstance": {
          "Type": "ALIYUN::DTS::SubscriptionInstance",
          "Properties": {
            "SourceEndpointInstanceType": "MySQL",
            "Configuration": {
              "SubscriptionObject": [
                {
                  "DBName": "DemoDB"
                }
              ],
              "SubscriptionDataType": {
                "DDL": true,
                "DML": false
              },
              "SubscriptionInstanceName": "TestSubscription",
              "SourceEndpoint": {
                "InstanceType": "RDS",
                "UserName": "DBAdmin",
                "Password": "Admin@123!",
                "InstanceID": {
                  "Ref": "RdsId"
                }
              },
              "SubscriptionInstanceNetworkType": "vpc",
              "SubscriptionInstance": {
                "VPCId": {
                  "Ref": "VpcId"
                },
                "VSwitchId": {
                  "Ref": "VSwitchId"
                }
              }
            }
          }
        }
      },
      "Outputs": {
        "PublicHost": {
          "Description": "Public host.",
          "Value": {
            "Fn::GetAtt": [
              "SubscriptionInstance",
              "PublicHost"
            ]
          }
        },
        "PrivateHost": {
          "Description": "Private host.",
          "Value": {
            "Fn::GetAtt": [
              "SubscriptionInstance",
              "PrivateHost"
            ]
          }
        },
        "SubscriptionInstanceId": {
          "Description": "The ID of Data subscription instance.",
          "Value": {
            "Fn::GetAtt": [
              "SubscriptionInstance",
              "SubscriptionInstanceId"
            ]
          }
        },
        "VPCHost": {
          "Description": "VPC host.",
          "Value": {
            "Fn::GetAtt": [
              "SubscriptionInstance",
              "VPCHost"
            ]
          }
        }
      }
    }