ALIYUN::HBR::CrossAccount

更新时间:
复制为 MD 格式

ALIYUN::HBR::CrossAccount类型用于创建跨账号。

语法

{
  "Type": "ALIYUN::HBR::CrossAccount",
  "Properties": {
    "Alias": String,
    "CrossAccountUserId": Integer,
    "CrossAccountRoleName": String,
    "CrossAccountType": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Alias

String

跨账号授权的别名。

CrossAccountRoleName

String

用于向被授权账号授予权限的RAM角色名称。

CrossAccountType

String

跨账号授权的类型。

有效值:

  • CROSS_ACCOUNT

  • CROSS_ACCOUNT_BY_RD

CrossAccountUserId

Integer

您要授权备份数据的账号的用户ID。

返回值

Fn::GetAtt

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  CrossAccountUserId:
    Type: Number
    Description:
      en: The user ID of the account that you want to authorize to back up data in your account.
    Required: false
  CrossAccountRoleName:
    Type: String
    Description:
      en: The name of the RAM role that is used to grant permissions to the authorized account.
    Required: false
  Alias:
    Type: String
    Description:
      en: The alias of the cross-account authorization.
    Required: false
  CrossAccountType:
    Type: String
    Description:
      en: 'The type of the cross-account authorization. Valid values: CROSS_ACCOUNT, CROSS_ACCOUNT_BY_RD.'
    AllowedValues:
      - CROSS_ACCOUNT
      - CROSS_ACCOUNT_BY_RD
    Required: false
Resources:
  CrossAccount:
    Type: ALIYUN::HBR::CrossAccount
    Properties:
      CrossAccountUserId:
        Ref: CrossAccountUserId
      CrossAccountRoleName:
        Ref: CrossAccountRoleName
      Alias:
        Ref: Alias
      CrossAccountType:
        Ref: CrossAccountType
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "CrossAccountUserId": {
      "Type": "Number",
      "Description": {
        "en": "The user ID of the account that you want to authorize to back up data in your account."
      },
      "Required": false
    },
    "CrossAccountRoleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the RAM role that is used to grant permissions to the authorized account."
      },
      "Required": false
    },
    "Alias": {
      "Type": "String",
      "Description": {
        "en": "The alias of the cross-account authorization."
      },
      "Required": false
    },
    "CrossAccountType": {
      "Type": "String",
      "Description": {
        "en": "The type of the cross-account authorization. Valid values: CROSS_ACCOUNT, CROSS_ACCOUNT_BY_RD."
      },
      "AllowedValues": [
        "CROSS_ACCOUNT",
        "CROSS_ACCOUNT_BY_RD"
      ],
      "Required": false
    }
  },
  "Resources": {
    "CrossAccount": {
      "Type": "ALIYUN::HBR::CrossAccount",
      "Properties": {
        "CrossAccountUserId": {
          "Ref": "CrossAccountUserId"
        },
        "CrossAccountRoleName": {
          "Ref": "CrossAccountRoleName"
        },
        "Alias": {
          "Ref": "Alias"
        },
        "CrossAccountType": {
          "Ref": "CrossAccountType"
        }
      }
    }
  }
}