Class Broker


  • public class Broker
    extends com.pulumi.resources.CustomResource
    Provides an Amazon MQ broker resource. This resources also manages users for the broker. > For more information on Amazon MQ, see [Amazon MQ documentation](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/welcome.html). > **NOTE:** 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. Also, Amazon MQ does not return information about RabbitMQ users so drift detection is not possible. > **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, the provider may report a difference in its planning phase because a modification has not yet taken place. You can use the `apply_immediately` flag to instruct the service to apply the change immediately (see documentation below). Using `apply_immediately` can result in a brief downtime as the broker reboots. ## Example Usage ### Basic Example <!--Start PulumiCodeChooser -->
     
     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.List;
     import java.util.ArrayList;
     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()
                 .brokerName("example")
                 .configuration(BrokerConfigurationArgs.builder()
                     .id(test.id())
                     .revision(test.latestRevision())
                     .build())
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .hostInstanceType("mq.t2.micro")
                 .securityGroups(testAwsSecurityGroup.id())
                 .users(BrokerUserArgs.builder()
                     .username("ExampleUser")
                     .password("MindTheGap")
                     .build())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### High-throughput Optimized Example This example shows the use of EBS storage for high-throughput optimized performance. <!--Start PulumiCodeChooser -->
     
     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.List;
     import java.util.ArrayList;
     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()
                 .brokerName("example")
                 .configuration(BrokerConfigurationArgs.builder()
                     .id(test.id())
                     .revision(test.latestRevision())
                     .build())
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .storageType("ebs")
                 .hostInstanceType("mq.m5.large")
                 .securityGroups(testAwsSecurityGroup.id())
                 .users(BrokerUserArgs.builder()
                     .username("ExampleUser")
                     .password("MindTheGap")
                     .build())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Cross-Region Data Replication <!--Start PulumiCodeChooser -->
     
     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.List;
     import java.util.ArrayList;
     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()
                 .applyImmediately(true)
                 .brokerName("example_primary")
                 .engineType("ActiveMQ")
                 .engineVersion("5.17.6")
                 .hostInstanceType("mq.m5.large")
                 .securityGroups(examplePrimaryAwsSecurityGroup.id())
                 .deploymentMode("ACTIVE_STANDBY_MULTI_AZ")
                 .users(            
                     BrokerUserArgs.builder()
                         .username("ExampleUser")
                         .password("MindTheGap")
                         .build(),
                     BrokerUserArgs.builder()
                         .username("ExampleReplicationUser")
                         .password("Example12345")
                         .replicationUser(true)
                         .build())
                 .build());
     
             var example = new Broker("example", BrokerArgs.builder()
                 .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())
                 .users(            
                     BrokerUserArgs.builder()
                         .username("ExampleUser")
                         .password("MindTheGap")
                         .build(),
                     BrokerUserArgs.builder()
                         .username("ExampleReplicationUser")
                         .password("Example12345")
                         .replicationUser(true)
                         .build())
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> 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:
        Specifies whether any broker modifications are applied immediately, or during the next maintenance window. 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 `engine_type` `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 `engine_type` of `ActiveMQ` and `RabbitMQ` only. Detailed below.
      • dataReplicationMode

        public com.pulumi.core.Output<java.lang.String> dataReplicationMode()
        Returns:
        Defines whether this broker is a 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:
        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 `data_replication_mode` 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. See the [AmazonMQ Broker Engine docs](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/broker-engine.html) for supported versions. For example, `5.17.6`.
      • hostInstanceType

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

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

        public com.pulumi.core.Output<java.util.Optional<BrokerLdapServerMetadata>> ldapServerMetadata()
        Returns:
        Configuration block for the LDAP server used to authenticate and authorize connections to the broker. Not supported for `engine_type` `RabbitMQ`. Detailed below. (Currently, AWS may not process changes to LDAP server metadata.)
      • logs

        public com.pulumi.core.Output<java.util.Optional<BrokerLogs>> logs()
        Returns:
        Configuration block for the logging configuration of the broker. 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:
        (Optional) The 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.
      • 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.
      • storageType

        public com.pulumi.core.Output<java.lang.String> storageType()
        Returns:
        Storage type of the broker. For `engine_type` `ActiveMQ`, the valid values are `efs` and `ebs`, and the AWS-default is `efs`. For `engine_type` `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 `default_tags` 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:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • users

        public com.pulumi.core.Output<java.util.List<BrokerUser>> users()
        Returns:
        Configuration block for broker users. For `engine_type` of `RabbitMQ`, Amazon MQ does not return broker users preventing this resource from making user updates and drift detection. Detailed below. The following arguments are optional:
      • 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.