ALIYUN::PVTZ::UserVpcAuthorization类型用于跨账号VPC授权。

语法

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

属性

属性名称类型必须允许更新描述约束
AuthCodeString验证码。AuthChannel取值为AUTH_CODE或者不填时,AuthCode必选。
AuthChannelString授权渠道。取值:
  • AUTH_CODE(默认值):验证码授权,验证AuthCode输入的验证码是否正确。
  • RESOURCE_DIRECTORY:资源目录授权,验证AuthorizedUserId与当前阿里云账号是否存在资源目录授信。
AuthorizedUserIdString授权资源的所属阿里云账号ID。
AuthTypeString授权类型。取值为NORMAL,表示普通授权。
IgnoreDeletionForbiddenBoolean是否忽略删除保护。取值:
  • true:忽略删除保护。
  • false:不忽略删除保护。

返回值

Fn::GetAtt

  • AuthorizedUserId:授权资源的所属阿里云账号ID。
  • AuthType:授权类型。

示例

  • YAML格式

    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格式

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