ALIYUN::AMQP::Account

ALIYUN::AMQP::Account类型用于创建消息队列用户名密码。

语法

{
  "Type": "ALIYUN::AMQP::Account",
  "Properties": {
    "AccountAccessKey": String,
    "AccountAccessKeySecret": String,
    "InstanceId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

AccountAccessKey

String

您的阿里云账号或 RAM 用户的 AccessKey ID。

获取方式,请参见创建AccessKey

说明

如果您使用 RAM 用户的 AccessKey 创建的静态用户名密码接入消息队列 RabbitMQ 版并收发消息,请确保该 RAM 用户已被授予收发消息权限。更多信息,请参见 云消息队列 RabbitMQ 版自定义权限策略参考

AccountAccessKeySecret

String

您的阿里云账号或RAM用户的AccessKeySecret。

InstanceId

String

消息队列 RabbitMQ 版实例的 ID。

返回值

Fn::GetAtt

  • UserName:创建的静态用户名

  • AccountAccessKey:您的阿里云账号或 RAM 用户的 AccessKey ID。

  • CreateTimestamp:该用户名密码创建的时间戳。

  • Password:创建的静态用户密码。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    Description:
      en: Message Queue The ID of the RabbitMQ version instance, indicating which instance you need to create a static username and password.
    Required: true
  AccountAccessKey:
    Type: String
    Description:
      en: |-
        Your Alibaba Cloud account or RAM user's AccessKey ID. For obtaining it, visit RAM console.
        If you use the static username and password created by the AccessKey of the RAM user to access the RabbitMQ version of the message queue and send and receive messages, make sure that the RAM user has been granted the permission of sending and receiving messages. For more information, see RAM permissions policy.
    Required: true
  AccountAccessKeySecret:
    Type: String
    Description:
      en: Your Alibaba Cloud account or RAM user's AccessKeySecret.
    Required: true
Resources:
  Account:
    Type: ALIYUN::AMQP::Account
    Properties:
      InstanceId:
        Ref: InstanceId
      AccountAccessKey:
        Ref: AccountAccessKey
      AccountAccessKeySecret:
        Ref: AccountAccessKeySecret
Outputs:
  UserName:
    Description: The created account user name.
    Value:
      Fn::GetAtt:
        - Account
        - UserName
  AccountAccessKey:
    Description: The AccessKey ID used to create the username and password.
    Value:
      Fn::GetAtt:
        - Account
        - AccountAccessKey
  CreateTimestamp:
    Description: The timestamp when the account was created.
    Value:
      Fn::GetAtt:
        - Account
        - CreateTimestamp
  Password:
    Description: The created static user password.
    Value:
      Fn::GetAtt:
        - Account
        - Password
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "Message Queue The ID of the RabbitMQ version instance, indicating which instance you need to create a static username and password."
      },
      "Required": true
    },
    "AccountAccessKey": {
      "Type": "String",
      "Description": {
        "en": "Your Alibaba Cloud account or RAM user's AccessKey ID. For obtaining it, visit RAM console.\nIf you use the static username and password created by the AccessKey of the RAM user to access the RabbitMQ version of the message queue and send and receive messages, make sure that the RAM user has been granted the permission of sending and receiving messages. For more information, see RAM permissions policy."
      },
      "Required": true
    },
    "AccountAccessKeySecret": {
      "Type": "String",
      "Description": {
        "en": "Your Alibaba Cloud account or RAM user's AccessKeySecret."
      },
      "Required": true
    }
  },
  "Resources": {
    "Account": {
      "Type": "ALIYUN::AMQP::Account",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "AccountAccessKey": {
          "Ref": "AccountAccessKey"
        },
        "AccountAccessKeySecret": {
          "Ref": "AccountAccessKeySecret"
        }
      }
    }
  },
  "Outputs": {
    "UserName": {
      "Description": "The created account user name.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "UserName"
        ]
      }
    },
    "AccountAccessKey": {
      "Description": "The AccessKey ID used to create the username and password.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountAccessKey"
        ]
      }
    },
    "CreateTimestamp": {
      "Description": "The timestamp when the account was created.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "CreateTimestamp"
        ]
      }
    },
    "Password": {
      "Description": "The created static user password.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "Password"
        ]
      }
    }
  }
}