ALIYUN::PVTZ::UserVpcAuthorization

更新时间:
复制 MD 格式

Grants cross-account authorization for a VPC.

Syntax

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

Properties

Property Name Type Required Update allowed Description Constraints
AuthCode String No No The verification code. If you set AuthChannel to AUTH_CODE or leave it empty, this property is required.
AuthChannel String No No The authorization channel. Valid values:
  • AUTH_CODE (default): Authorizes by verification code. Verifies the code specified in the AuthCode property.
  • RESOURCE_DIRECTORY: Authorizes by resource directory. Verifies that a trusted relationship exists in the resource directory between the account specified by AuthorizedUserId and the current account.
AuthorizedUserId String Yes No The Alibaba Cloud account ID that owns the resources to be authorized. None
AuthType String No No The authorization type. The value is NORMAL, which indicates standard authorization.
IgnoreDeletionForbidden Boolean No Yes Whether to ignore deletion protection. Valid values:
  • true: Ignores deletion protection.
  • false: Does not ignore deletion protection.

Return values

Fn::GetAtt

  • AuthorizedUserId: The ID of the Alibaba Cloud account that is granted authorization.
  • AuthType: The authorization type.

Examples

  • YAML format

    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
  • JSON format

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