createBroker method

Future<CreateBrokerResponse> createBroker({
  1. AuthenticationStrategy? authenticationStrategy,
  2. bool? autoMinorVersionUpgrade,
  3. String? brokerName,
  4. ConfigurationId? configuration,
  5. String? creatorRequestId,
  6. DeploymentMode? deploymentMode,
  7. EncryptionOptions? encryptionOptions,
  8. EngineType? engineType,
  9. String? engineVersion,
  10. String? hostInstanceType,
  11. LdapServerMetadataInput? ldapServerMetadata,
  12. Logs? logs,
  13. WeeklyStartTime? maintenanceWindowStartTime,
  14. bool? publiclyAccessible,
  15. List<String>? securityGroups,
  16. BrokerStorageType? storageType,
  17. List<String>? subnetIds,
  18. Map<String, String>? tags,
  19. List<User>? users,
})

Creates a broker. Note: This API is asynchronous.

May throw BadRequestException. May throw UnauthorizedException. May throw InternalServerErrorException. May throw ConflictException. May throw ForbiddenException.

Parameter authenticationStrategy : The authentication strategy used to secure the broker.

Parameter autoMinorVersionUpgrade : Required. Enables automatic upgrades to new minor versions for brokers, as Apache releases the versions. The automatic upgrades occur during the maintenance window of the broker or after a manual broker reboot.

Parameter brokerName : Required. The name of the broker. This value must be unique in your AWS account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain whitespaces, brackets, wildcard characters, or special characters.

Parameter configuration : A list of information about the configuration.

Parameter creatorRequestId : The unique ID that the requester receives for the created broker. Amazon MQ passes your ID with the API action. Note: We recommend using a Universally Unique Identifier (UUID) for the creatorRequestId. You may omit the creatorRequestId if your application doesn't require idempotency.

Parameter deploymentMode : Required. The deployment mode of the broker.

Parameter encryptionOptions : Encryption options for the broker.

Parameter engineType : Required. The type of broker engine. Note: Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.

Parameter engineVersion : Required. The version of the broker engine. For a list of supported engine versions, see https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/broker-engine.html

Parameter hostInstanceType : Required. The broker's instance type.

Parameter ldapServerMetadata : The metadata of the LDAP server used to authenticate and authorize connections to the broker.

Parameter logs : Enables Amazon CloudWatch logging for brokers.

Parameter maintenanceWindowStartTime : The parameters that determine the WeeklyStartTime.

Parameter publiclyAccessible : Required. Enables connections from applications outside of the VPC that hosts the broker's subnets.

Parameter securityGroups : The list of security groups (1 minimum, 5 maximum) that authorizes connections to brokers.

Parameter storageType : The broker's storage type.

Parameter subnetIds : The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ deployment (ACTIVEMQ) requires two subnets. A CLUSTER_MULTI_AZ deployment (RABBITMQ) has no subnet requirements when deployed with public accessibility, deployment without public accessibility requires at least one subnet.

Parameter tags : Create tags when creating the broker.

Parameter users : Required. The list of broker users (persons or applications) who can access queues and topics. 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. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long.

Implementation

Future<CreateBrokerResponse> createBroker({
  AuthenticationStrategy? authenticationStrategy,
  bool? autoMinorVersionUpgrade,
  String? brokerName,
  ConfigurationId? configuration,
  String? creatorRequestId,
  DeploymentMode? deploymentMode,
  EncryptionOptions? encryptionOptions,
  EngineType? engineType,
  String? engineVersion,
  String? hostInstanceType,
  LdapServerMetadataInput? ldapServerMetadata,
  Logs? logs,
  WeeklyStartTime? maintenanceWindowStartTime,
  bool? publiclyAccessible,
  List<String>? securityGroups,
  BrokerStorageType? storageType,
  List<String>? subnetIds,
  Map<String, String>? tags,
  List<User>? users,
}) async {
  final $payload = <String, dynamic>{
    if (authenticationStrategy != null)
      'authenticationStrategy': authenticationStrategy.toValue(),
    if (autoMinorVersionUpgrade != null)
      'autoMinorVersionUpgrade': autoMinorVersionUpgrade,
    if (brokerName != null) 'brokerName': brokerName,
    if (configuration != null) 'configuration': configuration,
    'creatorRequestId': creatorRequestId ?? _s.generateIdempotencyToken(),
    if (deploymentMode != null) 'deploymentMode': deploymentMode.toValue(),
    if (encryptionOptions != null) 'encryptionOptions': encryptionOptions,
    if (engineType != null) 'engineType': engineType.toValue(),
    if (engineVersion != null) 'engineVersion': engineVersion,
    if (hostInstanceType != null) 'hostInstanceType': hostInstanceType,
    if (ldapServerMetadata != null) 'ldapServerMetadata': ldapServerMetadata,
    if (logs != null) 'logs': logs,
    if (maintenanceWindowStartTime != null)
      'maintenanceWindowStartTime': maintenanceWindowStartTime,
    if (publiclyAccessible != null) 'publiclyAccessible': publiclyAccessible,
    if (securityGroups != null) 'securityGroups': securityGroups,
    if (storageType != null) 'storageType': storageType.toValue(),
    if (subnetIds != null) 'subnetIds': subnetIds,
    if (tags != null) 'tags': tags,
    if (users != null) 'users': users,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/brokers',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBrokerResponse.fromJson(response);
}