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

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
ConfigurationMapNoNoThe configurations of the change tracking instance. For more information, see Configuration properties.
SourceEndpointInstanceTypeStringNoNoThe type of the change tracking instance that you want to create. Default value: MySQL. Valid values:
  • MySQL
  • PolarDB
  • DRDS
  • Oracle
PeriodStringNoNoThe billing cycle of the change tracking instance on a subscription basis. Valid values:
  • Year
  • Month
Note This property takes effect and is required when you set the PayType property to Prepaid.
PayTypeStringNoNoThe billing method of the change tracking instance. Default value: Postpaid. Valid values:
  • Postpaid: pay-as-you-go
  • Prepaid: subscription
UsedTimeIntegerNoNoThe subscription duration of the change tracking instance. Valid values:
  • Valid values if you set the Period property to Year: 1 to 5
  • Valid values if you set the Period property to Month: 1 to 60
Note This property takes effect and is required when you set the PayType property to Prepaid.
TagsListNoYesThe tags that you want to add to the change tracking instance. For more information, see Tags properties.

Tags properties

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]
PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe key of the tag. The tag key must be 1 to 128 characters in length,

and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

ValueStringNoNoThe value of the tag. The tag value can be up to 128 characters in length,

and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

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

Configuration properties

PropertyTypeRequiredEditableDescriptionConstraint
SubscriptionDataTypeMapYesNoThe type of the data for which you want to configure the change tracking task. For more information, see SubscriptionDataType properties.
SubscriptionInstanceNameStringNoNoThe name of the change tracking task. None
SubscriptionInstanceMapNoNoThe network configurations of the change tracking task. For more information, see SubscriptionInstance properties.
SourceEndpointMapYesNoThe connection information about the source instance for which you want to configure the change tracking task. For more information, see SourceEndpoint properties.
SubscriptionInstanceNetworkTypeStringNoNoThe network type of the change tracking task. Valid values:
  • classic: classic network
  • vpc: virtual private cloud (VPC)
DbListMapNoNoThe objects for which you want to configure the change tracking task. For more information, see Objects of DTS tasks.

TableIncludes syntax

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

TableIncludes property

PropertyTypeRequiredEditableDescriptionConstraint
TableNameStringNoNoThe name of the table for which you want to configure the change tracking task in the source database. None

TableExcludes syntax

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

TableExcludes property

PropertyTypeRequiredEditableDescriptionConstraint
TableNameStringNoNoThe name of the table for which you do not want to configure the change tracking task in the source database. None

SubscriptionDataType syntax

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

SubscriptionDataType properties

PropertyTypeRequiredEditableDescriptionConstraint
DMLBooleanYesNoSpecifies whether to track changes of the data that is generated from DML operations. Valid values:
  • true
  • false
DDLBooleanYesNoSpecifies whether to track changes of the data that is generated from DDL operations. Valid values:
  • true
  • false

SubscriptionInstance syntax

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

SubscriptionInstance properties

PropertyTypeRequiredEditableDescriptionConstraint
VPCIdStringYesNoThe ID of the VPC that you want to use in the change tracking task. This property takes effect when you set the SubscriptionInstanceNetworkType property to vpc.
VSwitchIdStringYesNoThe ID of the vSwitch that you want to use in the change tracking task. This property takes effect when you set the SubscriptionInstanceNetworkType property 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

PropertyTypeRequiredEditableDescriptionConstraint
RoleStringNoNoThe 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
OracleSIDStringNoNoThe name of the source Oracle instance. This property takes effect when the database type of the source instance is Oracle. None
UserNameStringYesNoThe username of the account that is used to access the source instance. None
OwnerIDStringNoNoThe 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
InstanceIDStringNoNoThe ID of the source instance. None
IPStringNoNoThe IP address that is used to access the source instance. This property is required when the source instance is a self-managed database.
PortStringNoNoThe port number that is used to access the source instance. This property is required when the source instance is a self-managed database.
DatabaseNameStringNoNoThe name of the database that you want to use when you connect the source instance to the change tracking task. None
InstanceTypeStringYesNoThe type of the source instance for which you want to configure the change tracking task. Valid values:
  • RDS: ApsaraDB RDS instance
  • ECS: ECS-hosted self-managed database
PasswordStringYesNoThe 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 that is configured in the change tracking task.
  • PublicHost: the public endpoint that is configured in the change tracking task.
  • PrivateHost: the internal endpoint that is configured in the change tracking task.
  • SubscribeTopic: the topic that is configured in the change tracking task.

Examples

  • YAMLformat

    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
  • JSONformat

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