All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DataWorks::DataSourceSharedRule

Last Updated:Jul 07, 2026

The ALIYUN::DataWorks::DataSourceSharedRule type creates a data source sharing rule.

Syntax

{
  "Type": "ALIYUN::DataWorks::DataSourceSharedRule",
  "Properties": {
    "DataSourceId": Integer,
    "EnvType": String,
    "TargetProjectId": Integer,
    "SharedUser": String
  }
}

Properties

Parameter

Type

Required

Update Allowed

Description

Constraints

DataSourceId

Integer

Yes

No

The unique identifier of the data source.

None

EnvType

String

Yes

No

The environment type of the target project.

Valid values:

  • Dev: development environment

  • Prod: production environment

TargetProjectId

Integer

Yes

No

The ID of the target project.

None

SharedUser

String

No

No

The target user of the data source permission policy.

If this parameter is left empty, the data source is shared with the project.

Return values

Fn::GetAtt

  • SharedDataSourceName: The name of the shared data source in the target workspace. It consists of the source workspace name and the data source name, separated by a period (.).

  • CreateTime: The creation time of the data source sharing rule.

  • SharedUser: The target user of the data source permission policy. If this parameter is left empty, the data source is shared with the project.

  • CreateUser: The creator of the data source permission policy.

  • TargetProjectId: The ID of the target project.

  • SourceProjectId: The ID of the source project.

  • DataSourceSharedRuleId: The unique identifier of the data source sharing rule.

  • EnvType: The environment type of the target project, such as Dev (development environment) or Prod (production environment).

  • DataSourceId: The unique identifier of the data source.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DataSourceId:
    Description:
      en: The unique identifier of the data source.
    Required: true
    Type: Number
  EnvType:
    AllowedValues:
      - Dev
      - Prod
    Description:
      en: The environment type of the target project, such as Dev (development environment)
        or Prod (production environment).
    Required: true
    Type: String
  SharedUser:
    Description:
      en: The target user of the data source permission policy. If this parameter
        is left empty, the data source is shared with the project.
    Required: false
    Type: String
  TargetProjectId:
    Description:
      en: The ID of the target project.
    Required: true
    Type: Number
Resources:
  ExtensionResource:
    Properties:
      DataSourceId:
        Ref: DataSourceId
      EnvType:
        Ref: EnvType
      SharedUser:
        Ref: SharedUser
      TargetProjectId:
        Ref: TargetProjectId
    Type: ALIYUN::DataWorks::DataSourceSharedRule
Outputs:
  CreateTime:
    Description: The creation time of the data source sharing rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  CreateUser:
    Description: The creator of the data source permission policy.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateUser
  DataSourceId:
    Description: The unique identifier of the data source.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DataSourceId
  DataSourceSharedRuleId:
    Description: The unique identifier of the data source sharing rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DataSourceSharedRuleId
  EnvType:
    Description: The environment type of the target project, such as Dev (development
      environment) or Prod (production environment).
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - EnvType
  SharedDataSourceName:
    Description: The name of the shared data source in the target workspace. It consists
      of the source workspace name and the data source name, separated by a period (.).
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SharedDataSourceName
  SharedUser:
    Description: The target user of the data source permission policy. If this parameter
      is left empty, the data source is shared with the project.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SharedUser
  SourceProjectId:
    Description: The ID of the source project.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SourceProjectId
  TargetProjectId:
    Description: The ID of the target project.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TargetProjectId
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DataSourceId": {
      "Type": "Number",
      "Description": {
        "en": "The unique identifier of the data source."
      },
      "Required": true
    },
    "EnvType": {
      "Type": "String",
      "Description": {
        "en": "The environment type of the target project, such as Dev (development environment) or Prod (production environment)."
      },
      "AllowedValues": [
        "Dev",
        "Prod"
      ],
      "Required": true
    },
    "SharedUser": {
      "Type": "String",
      "Description": {
        "en": "The target user of the data source permission policy. If this parameter is left empty, the data source is shared with the project."
      },
      "Required": false
    },
    "TargetProjectId": {
      "Type": "Number",
      "Description": {
        "en": "The ID of the target project."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::DataWorks::DataSourceSharedRule",
      "Properties": {
        "DataSourceId": {
          "Ref": "DataSourceId"
        },
        "EnvType": {
          "Ref": "EnvType"
        },
        "SharedUser": {
          "Ref": "SharedUser"
        },
        "TargetProjectId": {
          "Ref": "TargetProjectId"
        }
      }
    }
  },
  "Outputs": {
    "CreateTime": {
      "Description": "The creation time of the data source sharing rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "CreateUser": {
      "Description": "The creator of the data source permission policy.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateUser"
        ]
      }
    },
    "DataSourceId": {
      "Description": "The unique identifier of the data source.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DataSourceId"
        ]
      }
    },
    "DataSourceSharedRuleId": {
      "Description": "The unique identifier of the data source sharing rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DataSourceSharedRuleId"
        ]
      }
    },
    "EnvType": {
      "Description": "The environment type of the target project, such as Dev (development environment) or Prod (production environment).",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvType"
        ]
      }
    },
    "SharedDataSourceName": {
      "Description": "The name of the shared data source in the target workspace. It consists of the source workspace name and the data source name, separated by a period (.).",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SharedDataSourceName"
        ]
      }
    },
    "SharedUser": {
      "Description": "The target user of the data source permission policy. If this parameter is left empty, the data source is shared with the project.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SharedUser"
        ]
      }
    },
    "SourceProjectId": {
      "Description": "The ID of the source project.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SourceProjectId"
        ]
      }
    },
    "TargetProjectId": {
      "Description": "The ID of the target project.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TargetProjectId"
        ]
      }
    }
  }
}