Skip to content

/AWS1/CL_MQ=>CREATEBROKER()

About CreateBroker

Creates a broker. Note: This API is asynchronous.

To create a broker, you must either use the AmazonMQFullAccess IAM policy or include the following EC2 permissions in your IAM policy.

  • ec2:CreateNetworkInterface

    This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account.

  • ec2:CreateNetworkInterfacePermission

    This permission is required to attach the ENI to the broker instance.

  • ec2:DeleteNetworkInterface

  • ec2:DeleteNetworkInterfacePermission

  • ec2:DetachNetworkInterface

  • ec2:DescribeInternetGateways

  • ec2:DescribeNetworkInterfaces

  • ec2:DescribeNetworkInterfacePermissions

  • ec2:DescribeRouteTables

  • ec2:DescribeSecurityGroups

  • ec2:DescribeSubnets

  • ec2:DescribeVpcs

For more information, see Create an IAM User and Get Your Amazon Web Services Credentials and Never Modify or Delete the Amazon MQ Elastic Network Interface in the Amazon MQ Developer Guide.

Method Signature

IMPORTING

Required arguments:

iv_brokername TYPE /AWS1/MQ___STRING /AWS1/MQ___STRING

Required. The broker's name. This value must be unique in your Amazon Web Services account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters.

Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker names are not intended to be used for private or sensitive data.

iv_deploymentmode TYPE /AWS1/MQ_DEPLOYMENTMODE /AWS1/MQ_DEPLOYMENTMODE

Required. The broker's deployment mode.

iv_enginetype TYPE /AWS1/MQ_ENGINETYPE /AWS1/MQ_ENGINETYPE

Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.

iv_hostinstancetype TYPE /AWS1/MQ___STRING /AWS1/MQ___STRING

Required. The broker's instance type.

iv_publiclyaccessible TYPE /AWS1/MQ___BOOLEAN /AWS1/MQ___BOOLEAN

Enables connections from applications outside of the VPC that hosts the broker's subnets. Set to false by default, if no value is provided.

it_users TYPE /AWS1/CL_MQ_USER=>TT___LISTOFUSER TT___LISTOFUSER

The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ API calls directly to brokers or via the RabbitMQ web console.

Optional arguments:

iv_authenticationstrategy TYPE /AWS1/MQ_AUTHNTCTNSTRATEGY /AWS1/MQ_AUTHNTCTNSTRATEGY

Optional. The authentication strategy used to secure the broker. The default is SIMPLE.

iv_autominorversionupgrade TYPE /AWS1/MQ___BOOLEAN /AWS1/MQ___BOOLEAN

Enables automatic upgrades to new patch versions for brokers as new versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window or after a manual broker reboot. Set to true by default, if no value is specified.

Must be set to true for ActiveMQ brokers version 5.18 and above and for RabbitMQ brokers version 3.13 and above.

io_configuration TYPE REF TO /AWS1/CL_MQ_CONFIGURATIONID /AWS1/CL_MQ_CONFIGURATIONID

A list of information about the configuration.

iv_creatorrequestid TYPE /AWS1/MQ___STRING /AWS1/MQ___STRING

The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action.

We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.

io_encryptionoptions TYPE REF TO /AWS1/CL_MQ_ENCRYPTIONOPTIONS /AWS1/CL_MQ_ENCRYPTIONOPTIONS

Encryption options for the broker.

iv_engineversion TYPE /AWS1/MQ___STRING /AWS1/MQ___STRING

The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the ActiveMQ version management and the RabbitMQ version management sections in the Amazon MQ Developer Guide.

io_ldapservermetadata TYPE REF TO /AWS1/CL_MQ_LDAPSERVERMETINPUT /AWS1/CL_MQ_LDAPSERVERMETINPUT

Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.

io_logs TYPE REF TO /AWS1/CL_MQ_LOGS /AWS1/CL_MQ_LOGS

Enables Amazon CloudWatch logging for brokers.

io_maintenancewindowstrttime TYPE REF TO /AWS1/CL_MQ_WEEKLYSTARTTIME /AWS1/CL_MQ_WEEKLYSTARTTIME

The parameters that determine the WeeklyStartTime.

it_securitygroups TYPE /AWS1/CL_MQ___LISTOF__STRING_W=>TT___LISTOF__STRING TT___LISTOF__STRING

The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.

iv_storagetype TYPE /AWS1/MQ_BROKERSTORAGETYPE /AWS1/MQ_BROKERSTORAGETYPE

The broker's storage type.

it_subnetids TYPE /AWS1/CL_MQ___LISTOF__STRING_W=>TT___LISTOF__STRING TT___LISTOF__STRING

The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ Amazon MQ for ActiveMQ deployment requires two subnets. A CLUSTER_MULTI_AZ Amazon MQ for RabbitMQ deployment has no subnet requirements when deployed with public accessibility. Deployment without public accessibility requires at least one subnet.

If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your Amazon Web Services account. Amazon MQ will not be able to create VPC endpoints in VPCs that are not owned by your Amazon Web Services account.

it_tags TYPE /AWS1/CL_MQ___MAPOF__STRING_W=>TT___MAPOF__STRING TT___MAPOF__STRING

Create tags when creating the broker.

iv_datareplicationmode TYPE /AWS1/MQ_DATAREPLICATIONMODE /AWS1/MQ_DATAREPLICATIONMODE

Defines whether this broker is a part of a data replication pair.

iv_datareplprimarybrokerarn TYPE /AWS1/MQ___STRING /AWS1/MQ___STRING

The Amazon Resource Name (ARN) of the primary broker that is used to replicate data from in a data replication pair, and is applied to the replica broker. Must be set when dataReplicationMode is set to CRDR.

RETURNING

oo_output TYPE REF TO /aws1/cl_mq_createbrokerrsp /AWS1/CL_MQ_CREATEBROKERRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_mq~createbroker(
  io_configuration = new /aws1/cl_mq_configurationid(
    iv_id = |string|
    iv_revision = 123
  )
  io_encryptionoptions = new /aws1/cl_mq_encryptionoptions(
    iv_kmskeyid = |string|
    iv_useawsownedkey = ABAP_TRUE
  )
  io_ldapservermetadata = new /aws1/cl_mq_ldapservermetinput(
    it_hosts = VALUE /aws1/cl_mq___listof__string_w=>tt___listof__string(
      ( new /aws1/cl_mq___listof__string_w( |string| ) )
    )
    iv_rolebase = |string|
    iv_rolename = |string|
    iv_rolesearchmatching = |string|
    iv_rolesearchsubtree = ABAP_TRUE
    iv_serviceaccountpassword = |string|
    iv_serviceaccountusername = |string|
    iv_userbase = |string|
    iv_userrolename = |string|
    iv_usersearchmatching = |string|
    iv_usersearchsubtree = ABAP_TRUE
  )
  io_logs = new /aws1/cl_mq_logs(
    iv_audit = ABAP_TRUE
    iv_general = ABAP_TRUE
  )
  io_maintenancewindowstrttime = new /aws1/cl_mq_weeklystarttime(
    iv_dayofweek = |string|
    iv_timeofday = |string|
    iv_timezone = |string|
  )
  it_securitygroups = VALUE /aws1/cl_mq___listof__string_w=>tt___listof__string(
    ( new /aws1/cl_mq___listof__string_w( |string| ) )
  )
  it_subnetids = VALUE /aws1/cl_mq___listof__string_w=>tt___listof__string(
    ( new /aws1/cl_mq___listof__string_w( |string| ) )
  )
  it_tags = VALUE /aws1/cl_mq___mapof__string_w=>tt___mapof__string(
    (
      VALUE /aws1/cl_mq___mapof__string_w=>ts___mapof__string_maprow(
        key = |string|
        value = new /aws1/cl_mq___mapof__string_w( |string| )
      )
    )
  )
  it_users = VALUE /aws1/cl_mq_user=>tt___listofuser(
    (
      new /aws1/cl_mq_user(
        it_groups = VALUE /aws1/cl_mq___listof__string_w=>tt___listof__string(
          ( new /aws1/cl_mq___listof__string_w( |string| ) )
        )
        iv_consoleaccess = ABAP_TRUE
        iv_password = |string|
        iv_replicationuser = ABAP_TRUE
        iv_username = |string|
      )
    )
  )
  iv_authenticationstrategy = |string|
  iv_autominorversionupgrade = ABAP_TRUE
  iv_brokername = |string|
  iv_creatorrequestid = |string|
  iv_datareplicationmode = |string|
  iv_datareplprimarybrokerarn = |string|
  iv_deploymentmode = |string|
  iv_enginetype = |string|
  iv_engineversion = |string|
  iv_hostinstancetype = |string|
  iv_publiclyaccessible = ABAP_TRUE
  iv_storagetype = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv___string = lo_result->get_brokerarn( ).
  lv___string = lo_result->get_brokerid( ).
ENDIF.