ALIYUN::PVTZ::UserVpcAuthorization is used to associate virtual private clouds (VPCs) across accounts.

Syntax

{
  "Type": "ALIYUN::PVTZ::UserVpcAuthorization",
  "Properties": {
    "AuthCode": String,
    "AuthChannel": String,
    "AuthorizedUserId": String,
    "AuthType": String,
    "IgnoreDeletionForbidden": Boolean
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
AuthCodeStringNoNoThe verification code. This property is required when the AuthChannel property is set to AUTH_CODE or left empty.
AuthChannelStringNoNoThe authorization channel. Default value: AUTH_CODE. Valid values:
  • AUTH_CODE: An authorization code is used to associate VPCs across accounts. The system checks whether the authorization code specified by AuthCode is correct.
  • RESOURCE_DIRECTORY: A resource directory is used to associate VPCs across accounts. The system checks whether the account that is specified by the AuthorizedUserId property and the current Alibaba Cloud account are in the same resource directory.
AuthorizedUserIdStringYesNoThe ID of the Alibaba Cloud account to which you want to grant permissions. None
AuthTypeStringNoNoThe authorization type. Set the value to NORMAL. The value specifies that only regular permissions are granted.
IgnoreDeletionForbiddenBooleanNoYesIndicates whether to ignore deletion protection. Valid values:
  • true
  • false

Return values

Fn::GetAtt

  • AuthorizedUserId: the ID of the Alibaba Cloud account to which you want to grant permissions.
  • AuthType: the authorization type.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      UserVpcAuthorization:
        Type: ALIYUN::PVTZ::UserVpcAuthorization
        Properties:
          AuthCode: 12hsj839
          AuthChannel: AUTH_CODE
          AuthorizedUserId:
            Ref: ALIYUN::AccountId
          AuthType: NORMAL
    Outputs:
      AuthorizedUserId:
        Description: The account ID of the user who authorizes the resource.
        Value:
          Fn::GetAtt:
            - UserVpcAuthorization
            - AuthorizedUserId
      AuthType:
        Description: Authorization type.
        Value:
          Fn::GetAtt:
            - UserVpcAuthorization
            - AuthType
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "UserVpcAuthorization": {
          "Type": "ALIYUN::PVTZ::UserVpcAuthorization",
          "Properties": {
            "AuthCode": "12hsj839",
            "AuthChannel": "AUTH_CODE",
            "AuthorizedUserId": {
              "Ref": "ALIYUN::AccountId"
            },
            "AuthType": "NORMAL"
          }
        }
      },
      "Outputs": {
        "AuthorizedUserId": {
          "Description": "The account ID of the user who authorizes the resource.",
          "Value": {
            "Fn::GetAtt": [
              "UserVpcAuthorization",
              "AuthorizedUserId"
            ]
          }
        },
        "AuthType": {
          "Description": "Authorization type.",
          "Value": {
            "Fn::GetAtt": [
              "UserVpcAuthorization",
              "AuthType"
            ]
          }
        }
      }
    }