1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Queue
  5. getConsumerGroups
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
oci logo
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi

    This data source provides the list of Consumer Groups in Oracle Cloud Infrastructure Queue service.

    Returns a list of consumer groups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testConsumerGroups = oci.Queue.getConsumerGroups({
        displayName: consumerGroupDisplayName,
        id: consumerGroupId,
        queueId: testQueue.id,
        state: consumerGroupState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_consumer_groups = oci.Queue.get_consumer_groups(display_name=consumer_group_display_name,
        id=consumer_group_id,
        queue_id=test_queue["id"],
        state=consumer_group_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/queue"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := queue.GetConsumerGroups(ctx, &queue.GetConsumerGroupsArgs{
    			DisplayName: pulumi.StringRef(consumerGroupDisplayName),
    			Id:          pulumi.StringRef(consumerGroupId),
    			QueueId:     pulumi.StringRef(testQueue.Id),
    			State:       pulumi.StringRef(consumerGroupState),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testConsumerGroups = Oci.Queue.GetConsumerGroups.Invoke(new()
        {
            DisplayName = consumerGroupDisplayName,
            Id = consumerGroupId,
            QueueId = testQueue.Id,
            State = consumerGroupState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Queue.QueueFunctions;
    import com.pulumi.oci.Queue.inputs.GetConsumerGroupsArgs;
    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 testConsumerGroups = QueueFunctions.getConsumerGroups(GetConsumerGroupsArgs.builder()
                .displayName(consumerGroupDisplayName)
                .id(consumerGroupId)
                .queueId(testQueue.id())
                .state(consumerGroupState)
                .build());
    
        }
    }
    
    variables:
      testConsumerGroups:
        fn::invoke:
          function: oci:Queue:getConsumerGroups
          arguments:
            displayName: ${consumerGroupDisplayName}
            id: ${consumerGroupId}
            queueId: ${testQueue.id}
            state: ${consumerGroupState}
    

    Using getConsumerGroups

    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 getConsumerGroups(args: GetConsumerGroupsArgs, opts?: InvokeOptions): Promise<GetConsumerGroupsResult>
    function getConsumerGroupsOutput(args: GetConsumerGroupsOutputArgs, opts?: InvokeOptions): Output<GetConsumerGroupsResult>
    def get_consumer_groups(display_name: Optional[str] = None,
                            filters: Optional[Sequence[GetConsumerGroupsFilter]] = None,
                            id: Optional[str] = None,
                            queue_id: Optional[str] = None,
                            state: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetConsumerGroupsResult
    def get_consumer_groups_output(display_name: Optional[pulumi.Input[str]] = None,
                            filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetConsumerGroupsFilterArgs]]]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            queue_id: Optional[pulumi.Input[str]] = None,
                            state: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetConsumerGroupsResult]
    func GetConsumerGroups(ctx *Context, args *GetConsumerGroupsArgs, opts ...InvokeOption) (*GetConsumerGroupsResult, error)
    func GetConsumerGroupsOutput(ctx *Context, args *GetConsumerGroupsOutputArgs, opts ...InvokeOption) GetConsumerGroupsResultOutput

    > Note: This function is named GetConsumerGroups in the Go SDK.

    public static class GetConsumerGroups 
    {
        public static Task<GetConsumerGroupsResult> InvokeAsync(GetConsumerGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetConsumerGroupsResult> Invoke(GetConsumerGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
    public static Output<GetConsumerGroupsResult> getConsumerGroups(GetConsumerGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:Queue/getConsumerGroups:getConsumerGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters List<GetConsumerGroupsFilter>
    Id string
    The unique consumer group identifier.
    QueueId string
    The unique queue identifier.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters []GetConsumerGroupsFilter
    Id string
    The unique consumer group identifier.
    QueueId string
    The unique queue identifier.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<GetConsumerGroupsFilter>
    id String
    The unique consumer group identifier.
    queueId String
    The unique queue identifier.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    displayName string
    A filter to return only resources that match the entire display name given.
    filters GetConsumerGroupsFilter[]
    id string
    The unique consumer group identifier.
    queueId string
    The unique queue identifier.
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    display_name str
    A filter to return only resources that match the entire display name given.
    filters Sequence[GetConsumerGroupsFilter]
    id str
    The unique consumer group identifier.
    queue_id str
    The unique queue identifier.
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<Property Map>
    id String
    The unique consumer group identifier.
    queueId String
    The unique queue identifier.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.

    getConsumerGroups Result

    The following output properties are available:

    ConsumerGroupCollections List<GetConsumerGroupsConsumerGroupCollection>
    The list of consumer_group_collection.
    DisplayName string
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    Filters List<GetConsumerGroupsFilter>
    Id string
    A unique identifier for the consumer group that is immutable on creation.
    QueueId string
    The OCID of the associated queue.
    State string
    The current state of the consumer group.
    ConsumerGroupCollections []GetConsumerGroupsConsumerGroupCollection
    The list of consumer_group_collection.
    DisplayName string
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    Filters []GetConsumerGroupsFilter
    Id string
    A unique identifier for the consumer group that is immutable on creation.
    QueueId string
    The OCID of the associated queue.
    State string
    The current state of the consumer group.
    consumerGroupCollections List<GetConsumerGroupsConsumerGroupCollection>
    The list of consumer_group_collection.
    displayName String
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    filters List<GetConsumerGroupsFilter>
    id String
    A unique identifier for the consumer group that is immutable on creation.
    queueId String
    The OCID of the associated queue.
    state String
    The current state of the consumer group.
    consumerGroupCollections GetConsumerGroupsConsumerGroupCollection[]
    The list of consumer_group_collection.
    displayName string
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    filters GetConsumerGroupsFilter[]
    id string
    A unique identifier for the consumer group that is immutable on creation.
    queueId string
    The OCID of the associated queue.
    state string
    The current state of the consumer group.
    consumer_group_collections Sequence[GetConsumerGroupsConsumerGroupCollection]
    The list of consumer_group_collection.
    display_name str
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    filters Sequence[GetConsumerGroupsFilter]
    id str
    A unique identifier for the consumer group that is immutable on creation.
    queue_id str
    The OCID of the associated queue.
    state str
    The current state of the consumer group.
    consumerGroupCollections List<Property Map>
    The list of consumer_group_collection.
    displayName String
    A user-friendly name for the consumer group. It has to be unique within the same queue in a case-insensitive manner. It's changeable. Avoid entering confidential information.
    filters List<Property Map>
    id String
    A unique identifier for the consumer group that is immutable on creation.
    queueId String
    The OCID of the associated queue.
    state String
    The current state of the consumer group.

    Supporting Types

    GetConsumerGroupsConsumerGroupCollection

    GetConsumerGroupsConsumerGroupCollectionItem

    ConsumerGroupFilter string
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    DeadLetterQueueDeliveryCount int
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags Dictionary<string, string>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    The unique consumer group identifier.
    IsEnabled bool
    LifecycleDetails string
    Any additional details about the current state of the consumer group.
    QueueId string
    The unique queue identifier.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    TimeUpdated string
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    ConsumerGroupFilter string
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    DeadLetterQueueDeliveryCount int
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags map[string]string
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    The unique consumer group identifier.
    IsEnabled bool
    LifecycleDetails string
    Any additional details about the current state of the consumer group.
    QueueId string
    The unique queue identifier.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    TimeUpdated string
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    consumerGroupFilter String
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    deadLetterQueueDeliveryCount Integer
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String,String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    The unique consumer group identifier.
    isEnabled Boolean
    lifecycleDetails String
    Any additional details about the current state of the consumer group.
    queueId String
    The unique queue identifier.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    timeUpdated String
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    consumerGroupFilter string
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    deadLetterQueueDeliveryCount number
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    displayName string
    A filter to return only resources that match the entire display name given.
    freeformTags {[key: string]: string}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id string
    The unique consumer group identifier.
    isEnabled boolean
    lifecycleDetails string
    Any additional details about the current state of the consumer group.
    queueId string
    The unique queue identifier.
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    timeUpdated string
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    consumer_group_filter str
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    dead_letter_queue_delivery_count int
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    display_name str
    A filter to return only resources that match the entire display name given.
    freeform_tags Mapping[str, str]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id str
    The unique consumer group identifier.
    is_enabled bool
    lifecycle_details str
    Any additional details about the current state of the consumer group.
    queue_id str
    The unique queue identifier.
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    time_updated str
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    consumerGroupFilter String
    The filter used by the consumer group. Only messages matching the filter will be available by consumers of the consumer group. An empty value means that all messages will be available in the group. The primary consumer group cannot have any filter.
    deadLetterQueueDeliveryCount Number
    The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn't set, it will be using the value defined at the queue level.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    The unique consumer group identifier.
    isEnabled Boolean
    lifecycleDetails String
    Any additional details about the current state of the consumer group.
    queueId String
    The unique queue identifier.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The time that the consumer group was created, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z
    timeUpdated String
    The time that the consumer group was updated, expressed in RFC 3339 timestamp format. Example: 2018-04-20T00:00:07.405Z

    GetConsumerGroupsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate