Skip to content

create_user

create_user(
    broker_id: __string,
    username: __string,
    *,
    config_overrides: Optional[mqClientConfig] = None,
    console_access: Optional[__boolean] = None,
    groups: Optional[__listOf__string] = None,
    password: Optional[__string] = None,
    replication_user: Optional[__boolean] = None,
) -> CreateUserResponse

Creates an ActiveMQ user.

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

Parameters:

  • broker_id (__string) –

    The unique ID that Amazon MQ generates for the broker.

  • console_access (Optional[__boolean], default: None ) –

    Enables access to the ActiveMQ Web Console for the ActiveMQ user.

  • groups (Optional[__listOf__string], default: None ) –

    The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.

  • password (Optional[__string], default: None ) –

    Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).

  • username (__string) –

    The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.

  • replication_user (Optional[__boolean], default: None ) –

    Defines if this user is intended for CRDR replication purposes.

Raises:

Source code in docs_src/capo_mq/_services/mq.py
def create_user(
    self,
    broker_id: "capo_mq.types.__string.__string",
    username: "capo_mq.types.__string.__string",
    *,
    config_overrides: Optional[mqClientConfig] = None,
    console_access: Optional["capo_mq.types.__boolean.__boolean"] = None,
    groups: Optional["capo_mq.types.__list_of__string.__listOf__string"] = None,
    password: Optional["capo_mq.types.__string.__string"] = None,
    replication_user: Optional["capo_mq.types.__boolean.__boolean"] = None,
) -> "capo_mq.types.create_user_response.CreateUserResponse":
    """<p>Creates an ActiveMQ user.</p> <important><p>Do not add personally identifiable information (PII) or other confidential or sensitive information in broker usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data.</p></important>

    Args:
        broker_id: <p>The unique ID that Amazon MQ generates for the broker.</p>
        console_access: <p>Enables access to the ActiveMQ Web Console for the ActiveMQ user.</p>
        groups: <p>The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
        password: <p>Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 unique characters, and must not contain commas, colons, or equal signs (,:=).</p>
        username: <p>The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.</p>
        replication_user: <p>Defines if this user is intended for CRDR replication purposes.</p>

    Raises:
        capo_mq.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
        capo_mq.errors.conflict_exception.ConflictException: <p>Returns information about an error.</p>
        capo_mq.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
        capo_mq.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
        capo_mq.errors.not_found_exception.NotFoundException: <p>Returns information about an error.</p>
        capo_mq.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mq.types.create_user_request.CreateUserRequest]",
    ) -> OperationResponse["capo_mq.types.create_user_response.CreateUserResponse"]:
        import capo_mq._operations.mq.create_user

        output, http_response = capo_mq._operations.mq.create_user.create_user(
            req.options, req.input
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUser")
    )
    input_: capo_mq.types.create_user_request.CreateUserRequest = {
        "broker_id": broker_id,
        "username": username,
    }
    if console_access is not None:
        input_["console_access"] = console_access
    if groups is not None:
        input_["groups"] = groups
    if password is not None:
        input_["password"] = password
    if replication_user is not None:
        input_["replication_user"] = replication_user

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output