Package com.pulumi.aws.mq
Class Broker
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.mq.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()); } }
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()); } }
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()); } }
-
-
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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
applyImmediately()
com.pulumi.core.Output<java.lang.String>
arn()
com.pulumi.core.Output<java.lang.String>
authenticationStrategy()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
autoMinorVersionUpgrade()
com.pulumi.core.Output<java.lang.String>
brokerName()
com.pulumi.core.Output<BrokerConfiguration>
configuration()
com.pulumi.core.Output<java.lang.String>
dataReplicationMode()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
dataReplicationPrimaryBrokerArn()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
deploymentMode()
com.pulumi.core.Output<java.util.Optional<BrokerEncryptionOptions>>
encryptionOptions()
com.pulumi.core.Output<java.lang.String>
engineType()
com.pulumi.core.Output<java.lang.String>
engineVersion()
static Broker
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, BrokerState state, 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.com.pulumi.core.Output<java.lang.String>
hostInstanceType()
com.pulumi.core.Output<java.util.List<BrokerInstance>>
instances()
com.pulumi.core.Output<java.util.Optional<BrokerLdapServerMetadata>>
ldapServerMetadata()
com.pulumi.core.Output<java.util.Optional<BrokerLogs>>
logs()
com.pulumi.core.Output<BrokerMaintenanceWindowStartTime>
maintenanceWindowStartTime()
com.pulumi.core.Output<java.lang.String>
pendingDataReplicationMode()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
publiclyAccessible()
com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>
securityGroups()
com.pulumi.core.Output<java.lang.String>
storageType()
com.pulumi.core.Output<java.util.List<java.lang.String>>
subnetIds()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
tags()
com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>
tagsAll()
com.pulumi.core.Output<java.util.List<BrokerUser>>
users()
-
-
-
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.
-
-