AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.mq.getBroker
Explore with Pulumi AI
Provides information about a MQ Broker.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const brokerId = config.get("brokerId") || "";
const brokerName = config.get("brokerName") || "";
const byId = aws.mq.getBroker({
    brokerId: brokerId,
});
const byName = aws.mq.getBroker({
    brokerName: brokerName,
});
import pulumi
import pulumi_aws as aws
config = pulumi.Config()
broker_id = config.get("brokerId")
if broker_id is None:
    broker_id = ""
broker_name = config.get("brokerName")
if broker_name is None:
    broker_name = ""
by_id = aws.mq.get_broker(broker_id=broker_id)
by_name = aws.mq.get_broker(broker_name=broker_name)
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/mq"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		brokerId := ""
		if param := cfg.Get("brokerId"); param != "" {
			brokerId = param
		}
		brokerName := ""
		if param := cfg.Get("brokerName"); param != "" {
			brokerName = param
		}
		_, err := mq.LookupBroker(ctx, &mq.LookupBrokerArgs{
			BrokerId: pulumi.StringRef(brokerId),
		}, nil)
		if err != nil {
			return err
		}
		_, err = mq.LookupBroker(ctx, &mq.LookupBrokerArgs{
			BrokerName: pulumi.StringRef(brokerName),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var brokerId = config.Get("brokerId") ?? "";
    var brokerName = config.Get("brokerName") ?? "";
    var byId = Aws.Mq.GetBroker.Invoke(new()
    {
        BrokerId = brokerId,
    });
    var byName = Aws.Mq.GetBroker.Invoke(new()
    {
        BrokerName = brokerName,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.mq.MqFunctions;
import com.pulumi.aws.mq.inputs.GetBrokerArgs;
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) {
        final var config = ctx.config();
        final var brokerId = config.get("brokerId").orElse("");
        final var brokerName = config.get("brokerName").orElse("");
        final var byId = MqFunctions.getBroker(GetBrokerArgs.builder()
            .brokerId(brokerId)
            .build());
        final var byName = MqFunctions.getBroker(GetBrokerArgs.builder()
            .brokerName(brokerName)
            .build());
    }
}
configuration:
  brokerId:
    type: string
    default: ""
  brokerName:
    type: string
    default: ""
variables:
  byId:
    fn::invoke:
      function: aws:mq:getBroker
      arguments:
        brokerId: ${brokerId}
  byName:
    fn::invoke:
      function: aws:mq:getBroker
      arguments:
        brokerName: ${brokerName}
Using getBroker
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBroker(args: GetBrokerArgs, opts?: InvokeOptions): Promise<GetBrokerResult>
function getBrokerOutput(args: GetBrokerOutputArgs, opts?: InvokeOptions): Output<GetBrokerResult>def get_broker(broker_id: Optional[str] = None,
               broker_name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None,
               opts: Optional[InvokeOptions] = None) -> GetBrokerResult
def get_broker_output(broker_id: Optional[pulumi.Input[str]] = None,
               broker_name: Optional[pulumi.Input[str]] = None,
               tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetBrokerResult]func LookupBroker(ctx *Context, args *LookupBrokerArgs, opts ...InvokeOption) (*LookupBrokerResult, error)
func LookupBrokerOutput(ctx *Context, args *LookupBrokerOutputArgs, opts ...InvokeOption) LookupBrokerResultOutput> Note: This function is named LookupBroker in the Go SDK.
public static class GetBroker 
{
    public static Task<GetBrokerResult> InvokeAsync(GetBrokerArgs args, InvokeOptions? opts = null)
    public static Output<GetBrokerResult> Invoke(GetBrokerInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBrokerResult> getBroker(GetBrokerArgs args, InvokeOptions options)
public static Output<GetBrokerResult> getBroker(GetBrokerArgs args, InvokeOptions options)
fn::invoke:
  function: aws:mq/getBroker:getBroker
  arguments:
    # arguments dictionaryThe following arguments are supported:
- BrokerId string
- Unique id of the mq broker.
- BrokerName string
- Unique name of the mq broker.
- Dictionary<string, string>
- BrokerId string
- Unique id of the mq broker.
- BrokerName string
- Unique name of the mq broker.
- map[string]string
- brokerId String
- Unique id of the mq broker.
- brokerName String
- Unique name of the mq broker.
- Map<String,String>
- brokerId string
- Unique id of the mq broker.
- brokerName string
- Unique name of the mq broker.
- {[key: string]: string}
- broker_id str
- Unique id of the mq broker.
- broker_name str
- Unique name of the mq broker.
- Mapping[str, str]
- brokerId String
- Unique id of the mq broker.
- brokerName String
- Unique name of the mq broker.
- Map<String>
getBroker Result
The following output properties are available:
- Arn string
- AuthenticationStrategy string
- AutoMinor boolVersion Upgrade 
- BrokerId string
- BrokerName string
- Configuration
GetBroker Configuration 
- DeploymentMode string
- EncryptionOptions List<GetBroker Encryption Option> 
- EngineType string
- EngineVersion string
- HostInstance stringType 
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<GetBroker Instance> 
- LdapServer List<GetMetadatas Broker Ldap Server Metadata> 
- Logs
GetBroker Logs 
- MaintenanceWindow GetStart Time Broker Maintenance Window Start Time 
- PubliclyAccessible bool
- SecurityGroups List<string>
- StorageType string
- SubnetIds List<string>
- Dictionary<string, string>
- Users
List<GetBroker User> 
- Arn string
- AuthenticationStrategy string
- AutoMinor boolVersion Upgrade 
- BrokerId string
- BrokerName string
- Configuration
GetBroker Configuration 
- DeploymentMode string
- EncryptionOptions []GetBroker Encryption Option 
- EngineType string
- EngineVersion string
- HostInstance stringType 
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]GetBroker Instance 
- LdapServer []GetMetadatas Broker Ldap Server Metadata 
- Logs
GetBroker Logs 
- MaintenanceWindow GetStart Time Broker Maintenance Window Start Time 
- PubliclyAccessible bool
- SecurityGroups []string
- StorageType string
- SubnetIds []string
- map[string]string
- Users
[]GetBroker User 
- arn String
- authenticationStrategy String
- autoMinor BooleanVersion Upgrade 
- brokerId String
- brokerName String
- configuration
GetBroker Configuration 
- deploymentMode String
- encryptionOptions List<GetBroker Encryption Option> 
- engineType String
- engineVersion String
- hostInstance StringType 
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<GetBroker Instance> 
- ldapServer List<GetMetadatas Broker Ldap Server Metadata> 
- logs
GetBroker Logs 
- maintenanceWindow GetStart Time Broker Maintenance Window Start Time 
- publiclyAccessible Boolean
- securityGroups List<String>
- storageType String
- subnetIds List<String>
- Map<String,String>
- users
List<GetBroker User> 
- arn string
- authenticationStrategy string
- autoMinor booleanVersion Upgrade 
- brokerId string
- brokerName string
- configuration
GetBroker Configuration 
- deploymentMode string
- encryptionOptions GetBroker Encryption Option[] 
- engineType string
- engineVersion string
- hostInstance stringType 
- id string
- The provider-assigned unique ID for this managed resource.
- instances
GetBroker Instance[] 
- ldapServer GetMetadatas Broker Ldap Server Metadata[] 
- logs
GetBroker Logs 
- maintenanceWindow GetStart Time Broker Maintenance Window Start Time 
- publiclyAccessible boolean
- securityGroups string[]
- storageType string
- subnetIds string[]
- {[key: string]: string}
- users
GetBroker User[] 
- arn str
- authentication_strategy str
- auto_minor_ boolversion_ upgrade 
- broker_id str
- broker_name str
- configuration
GetBroker Configuration 
- deployment_mode str
- encryption_options Sequence[GetBroker Encryption Option] 
- engine_type str
- engine_version str
- host_instance_ strtype 
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[GetBroker Instance] 
- ldap_server_ Sequence[Getmetadatas Broker Ldap Server Metadata] 
- logs
GetBroker Logs 
- maintenance_window_ Getstart_ time Broker Maintenance Window Start Time 
- publicly_accessible bool
- security_groups Sequence[str]
- storage_type str
- subnet_ids Sequence[str]
- Mapping[str, str]
- users
Sequence[GetBroker User] 
- arn String
- authenticationStrategy String
- autoMinor BooleanVersion Upgrade 
- brokerId String
- brokerName String
- configuration Property Map
- deploymentMode String
- encryptionOptions List<Property Map>
- engineType String
- engineVersion String
- hostInstance StringType 
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
- ldapServer List<Property Map>Metadatas 
- logs Property Map
- maintenanceWindow Property MapStart Time 
- publiclyAccessible Boolean
- securityGroups List<String>
- storageType String
- subnetIds List<String>
- Map<String>
- users List<Property Map>
Supporting Types
GetBrokerConfiguration  
GetBrokerEncryptionOption   
- KmsKey stringId 
- UseAws boolOwned Key 
- KmsKey stringId 
- UseAws boolOwned Key 
- kmsKey StringId 
- useAws BooleanOwned Key 
- kmsKey stringId 
- useAws booleanOwned Key 
- kms_key_ strid 
- use_aws_ boolowned_ key 
- kmsKey StringId 
- useAws BooleanOwned Key 
GetBrokerInstance  
- ConsoleUrl string
- Endpoints List<string>
- IpAddress string
- ConsoleUrl string
- Endpoints []string
- IpAddress string
- consoleUrl String
- endpoints List<String>
- ipAddress String
- consoleUrl string
- endpoints string[]
- ipAddress string
- console_url str
- endpoints Sequence[str]
- ip_address str
- consoleUrl String
- endpoints List<String>
- ipAddress String
GetBrokerLdapServerMetadata    
- Hosts List<string>
- RoleBase string
- RoleName string
- RoleSearch stringMatching 
- RoleSearch boolSubtree 
- ServiceAccount stringPassword 
- ServiceAccount stringUsername 
- UserBase string
- UserRole stringName 
- UserSearch stringMatching 
- UserSearch boolSubtree 
- Hosts []string
- RoleBase string
- RoleName string
- RoleSearch stringMatching 
- RoleSearch boolSubtree 
- ServiceAccount stringPassword 
- ServiceAccount stringUsername 
- UserBase string
- UserRole stringName 
- UserSearch stringMatching 
- UserSearch boolSubtree 
- hosts List<String>
- roleBase String
- roleName String
- roleSearch StringMatching 
- roleSearch BooleanSubtree 
- serviceAccount StringPassword 
- serviceAccount StringUsername 
- userBase String
- userRole StringName 
- userSearch StringMatching 
- userSearch BooleanSubtree 
- hosts string[]
- roleBase string
- roleName string
- roleSearch stringMatching 
- roleSearch booleanSubtree 
- serviceAccount stringPassword 
- serviceAccount stringUsername 
- userBase string
- userRole stringName 
- userSearch stringMatching 
- userSearch booleanSubtree 
- hosts Sequence[str]
- role_base str
- role_name str
- role_search_ strmatching 
- role_search_ boolsubtree 
- service_account_ strpassword 
- service_account_ strusername 
- user_base str
- user_role_ strname 
- user_search_ strmatching 
- user_search_ boolsubtree 
- hosts List<String>
- roleBase String
- roleName String
- roleSearch StringMatching 
- roleSearch BooleanSubtree 
- serviceAccount StringPassword 
- serviceAccount StringUsername 
- userBase String
- userRole StringName 
- userSearch StringMatching 
- userSearch BooleanSubtree 
GetBrokerLogs  
GetBrokerMaintenanceWindowStartTime     
- day_of_ strweek 
- time_of_ strday 
- time_zone str
GetBrokerUser  
- ConsoleAccess bool
- Groups List<string>
- ReplicationUser bool
- Username string
- ConsoleAccess bool
- Groups []string
- ReplicationUser bool
- Username string
- consoleAccess Boolean
- groups List<String>
- replicationUser Boolean
- username String
- consoleAccess boolean
- groups string[]
- replicationUser boolean
- username string
- console_access bool
- groups Sequence[str]
- replication_user bool
- username str
- consoleAccess Boolean
- groups List<String>
- replicationUser Boolean
- username String
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.