Class Broker


  • public class Broker
    extends com.pulumi.resources.CustomResource
    Manages an AWS MQ broker. Use to create and manage message brokers for ActiveMQ and RabbitMQ engines. > For more information on Amazon MQ, see [Amazon MQ documentation](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/welcome.html). > **Note:** For RabbitMQ brokers, only one administrative user can be created during provisioning. Additional users must be created via the [RabbitMQ Management API](https://www.rabbitmq.com/management.html) or the Amazon MQ console after the broker is provisioned. Terraform cannot update or manage users after broker creation. Any changes to the `user` block will trigger full broker recreation. Amazon MQ does not return RabbitMQ user information via APIs, meaning drift of the `user` attribute can not be detected. > **Warning:** Amazon MQ currently places limits on **RabbitMQ** brokers. For example, a RabbitMQ broker cannot have: instances with an associated IP address of an ENI attached to the broker, an associated LDAP server to authenticate and authorize broker connections, storage type `EFS`, or audit logging. Although this resource allows you to create RabbitMQ users, RabbitMQ users cannot have console access or groups. > **Warning:** All arguments including the username and password will be stored in the raw state as plain-text. > **Note:** Changes to an MQ Broker can occur when you change a parameter, such as `configuration` or `user`, and are reflected in the next maintenance window. Because of this, Terraform may report a difference in its planning phase because a modification has not yet taken place. You can use the `applyImmediately` flag to instruct the service to apply the change immediately (see documentation below). Using `applyImmediately` can result in a brief downtime as the broker reboots. ## Example Usage ### Basic Example
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.mq.Broker;
     import com.pulumi.aws.mq.BrokerArgs;
     import com.pulumi.aws.mq.inputs.BrokerConfigurationArgs;
     import com.pulumi.aws.mq.inputs.BrokerUserArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Broker("example", BrokerArgs.builder()
                 .configuration(BrokerConfigurationArgs.builder()
                     .id(test.id())
                     .revision(test.latestRevision())
                     .build())
                 .users(BrokerUserArgs.builder()
                     .username("example_user")
                     .password("<password>")
                     .build())
                 .brokerName("example")
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .hostInstanceType("mq.t2.micro")
                 .securityGroups(testAwsSecurityGroup.id())
                 .build());
     
         }
     }
     
     
    ### High-throughput Optimized Example
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.mq.Broker;
     import com.pulumi.aws.mq.BrokerArgs;
     import com.pulumi.aws.mq.inputs.BrokerConfigurationArgs;
     import com.pulumi.aws.mq.inputs.BrokerUserArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Broker("example", BrokerArgs.builder()
                 .configuration(BrokerConfigurationArgs.builder()
                     .id(test.id())
                     .revision(test.latestRevision())
                     .build())
                 .users(BrokerUserArgs.builder()
                     .username("example_user")
                     .password("<password>")
                     .build())
                 .brokerName("example")
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .storageType("ebs")
                 .hostInstanceType("mq.m5.large")
                 .securityGroups(testAwsSecurityGroup.id())
                 .build());
     
         }
     }
     
     
    ### Cross-Region Data Replication
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.mq.Broker;
     import com.pulumi.aws.mq.BrokerArgs;
     import com.pulumi.aws.mq.inputs.BrokerUserArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var examplePrimary = new Broker("examplePrimary", BrokerArgs.builder()
                 .users(            
                     BrokerUserArgs.builder()
                         .username("example_user")
                         .password("<password>")
                         .build(),
                     BrokerUserArgs.builder()
                         .username("example_replication_user")
                         .password("<password>")
                         .replicationUser(true)
                         .build())
                 .applyImmediately(true)
                 .brokerName("example_primary")
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .hostInstanceType("mq.m5.large")
                 .securityGroups(examplePrimaryAwsSecurityGroup.id())
                 .deploymentMode("ACTIVE_STANDBY_MULTI_AZ")
                 .build());
     
             var example = new Broker("example", BrokerArgs.builder()
                 .users(            
                     BrokerUserArgs.builder()
                         .username("example_user")
                         .password("<password>")
                         .build(),
                     BrokerUserArgs.builder()
                         .username("example_replication_user")
                         .password("<password>")
                         .replicationUser(true)
                         .build())
                 .applyImmediately(true)
                 .brokerName("example")
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .hostInstanceType("mq.m5.large")
                 .securityGroups(exampleAwsSecurityGroup.id())
                 .deploymentMode("ACTIVE_STANDBY_MULTI_AZ")
                 .dataReplicationMode("CRDR")
                 .dataReplicationPrimaryBrokerArn(primary.arn())
                 .build());
     
         }
     }
     
     
    See the [AWS MQ documentation](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/crdr-for-active-mq.html) on cross-region data replication for additional details. ## Import Using `pulumi import`, import MQ Brokers using their broker ID. For example: ```sh $ pulumi import aws:mq/broker:Broker example a1b2c3d4-d5f6-7777-8888-9999aaaabbbbcccc ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Broker​(java.lang.String name)  
      Broker​(java.lang.String name, BrokerArgs args)  
      Broker​(java.lang.String name, BrokerArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Constructor Detail

      • Broker

        public Broker​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Broker

        public Broker​(java.lang.String name,
                      BrokerArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Broker

        public Broker​(java.lang.String name,
                      BrokerArgs args,
                      @Nullable
                      com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • applyImmediately

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> applyImmediately()
        Returns:
        Whether to apply broker modifications immediately. Default is `false`.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the broker.
      • authenticationStrategy

        public com.pulumi.core.Output<java.lang.String> authenticationStrategy()
        Returns:
        Authentication strategy used to secure the broker. Valid values are `simple` and `ldap`. `ldap` is not supported for `engineType` `RabbitMQ`.
      • autoMinorVersionUpgrade

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> autoMinorVersionUpgrade()
        Returns:
        Whether to automatically upgrade to new minor versions of brokers as Amazon MQ makes releases available.
      • brokerName

        public com.pulumi.core.Output<java.lang.String> brokerName()
        Returns:
        Name of the broker.
      • configuration

        public com.pulumi.core.Output<BrokerConfiguration> configuration()
        Returns:
        Configuration block for broker configuration. Applies to `engineType` of `ActiveMQ` and `RabbitMQ` only. Detailed below.
      • dataReplicationMode

        public com.pulumi.core.Output<java.lang.String> dataReplicationMode()
        Returns:
        Whether this broker is part of a data replication pair. Valid values are `CRDR` and `NONE`.
      • dataReplicationPrimaryBrokerArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> dataReplicationPrimaryBrokerArn()
        Returns:
        ARN of the primary broker used to replicate data in a data replication pair. Required when `dataReplicationMode` is `CRDR`.
      • deploymentMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> deploymentMode()
        Returns:
        Deployment mode of the broker. Valid values are `SINGLE_INSTANCE`, `ACTIVE_STANDBY_MULTI_AZ`, and `CLUSTER_MULTI_AZ`. Default is `SINGLE_INSTANCE`.
      • encryptionOptions

        public com.pulumi.core.Output<java.util.Optional<BrokerEncryptionOptions>> encryptionOptions()
        Returns:
        Configuration block containing encryption options. Detailed below.
      • engineType

        public com.pulumi.core.Output<java.lang.String> engineType()
        Returns:
        Type of broker engine. Valid values are `ActiveMQ` and `RabbitMQ`.
      • engineVersion

        public com.pulumi.core.Output<java.lang.String> engineVersion()
        Returns:
        Version of the broker engine.
      • hostInstanceType

        public com.pulumi.core.Output<java.lang.String> hostInstanceType()
        Returns:
        Broker's instance type. For example, `mq.t3.micro`, `mq.m5.large`. The following arguments are optional:
      • instances

        public com.pulumi.core.Output<java.util.List<BrokerInstance>> instances()
        Returns:
        List of information about allocated brokers (both active & standby). See `instances` Block for details.
      • ldapServerMetadata

        public com.pulumi.core.Output<java.util.Optional<BrokerLdapServerMetadata>> ldapServerMetadata()
        Returns:
        Configuration block for the LDAP server used to authenticate and authorize connections. Not supported for `engineType` `RabbitMQ`. Detailed below.
      • logs

        public com.pulumi.core.Output<java.util.Optional<BrokerLogs>> logs()
        Returns:
        Configuration block for the logging configuration. Detailed below.
      • maintenanceWindowStartTime

        public com.pulumi.core.Output<BrokerMaintenanceWindowStartTime> maintenanceWindowStartTime()
        Returns:
        Configuration block for the maintenance window start time. Detailed below.
      • pendingDataReplicationMode

        public com.pulumi.core.Output<java.lang.String> pendingDataReplicationMode()
        Returns:
        Data replication mode that will be applied after reboot.
      • publiclyAccessible

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> publiclyAccessible()
        Returns:
        Whether to enable connections from applications outside of the VPC that hosts the broker's subnets.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • resourceShareArns

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> resourceShareArns()
        Returns:
        Set of [AWS RAM](https://docs.aws.amazon.com/ram/latest/userguide/what-is.html) resource share ARNs that grant the broker access to shared resources for [private networking](https://aws.amazon.com/blogs/big-data/introducing-private-networking-for-amazon-mq-for-rabbitmq/). Applies to `engineType` of `RabbitMQ` only. Because Amazon MQ applies resource shares during a reboot, set `applyImmediately` to `true` for changes to take effect without waiting for the next maintenance window.
      • securityGroups

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> securityGroups()
        Returns:
        List of security group IDs assigned to the broker.
      • sharedResources

        public com.pulumi.core.Output<java.util.List<BrokerSharedResource>> sharedResources()
        Returns:
        List of resources shared with the broker via `resourceShareArns`. Only populated for `engineType` of `RabbitMQ`. See `sharedResources` Block for details.
      • storageType

        public com.pulumi.core.Output<java.lang.String> storageType()
        Returns:
        Storage type of the broker. For `engineType` `ActiveMQ`, valid values are `efs` and `ebs` (AWS-default is `efs`). For `engineType` `RabbitMQ`, only `ebs` is supported. When using `ebs`, only the `mq.m5` broker instance type family is supported.
      • subnetIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> subnetIds()
        Returns:
        List of subnet IDs in which to launch the broker. A `SINGLE_INSTANCE` deployment requires one subnet. An `ACTIVE_STANDBY_MULTI_AZ` deployment requires multiple subnets.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of tags to assign to the broker. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • users

        public com.pulumi.core.Output<java.util.Optional<java.util.List<BrokerUser>>> users()
        Returns:
        Configuration block for broker users. For `engineType` of `RabbitMQ`, Amazon MQ does not return broker users preventing this resource from making user updates and drift detection. Detailed below.
      • get

        public static Broker get​(java.lang.String name,
                                 com.pulumi.core.Output<java.lang.String> id,
                                 @Nullable
                                 BrokerState state,
                                 @Nullable
                                 com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.