1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Logging
  5. getLogGroups
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.Logging.getLogGroups

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    This data source provides the list of Log Groups in Oracle Cloud Infrastructure Logging service.

    Lists all log groups for the specified compartment or tenancy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testLogGroups = oci.Logging.getLogGroups({
        compartmentId: compartmentId,
        displayName: logGroupDisplayName,
        isCompartmentIdInSubtree: logGroupIsCompartmentIdInSubtree,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_log_groups = oci.Logging.get_log_groups(compartment_id=compartment_id,
        display_name=log_group_display_name,
        is_compartment_id_in_subtree=log_group_is_compartment_id_in_subtree)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Logging"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Logging.GetLogGroups(ctx, &logging.GetLogGroupsArgs{
    			CompartmentId:            compartmentId,
    			DisplayName:              pulumi.StringRef(logGroupDisplayName),
    			IsCompartmentIdInSubtree: pulumi.BoolRef(logGroupIsCompartmentIdInSubtree),
    		}, 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 testLogGroups = Oci.Logging.GetLogGroups.Invoke(new()
        {
            CompartmentId = compartmentId,
            DisplayName = logGroupDisplayName,
            IsCompartmentIdInSubtree = logGroupIsCompartmentIdInSubtree,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Logging.LoggingFunctions;
    import com.pulumi.oci.Logging.inputs.GetLogGroupsArgs;
    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 testLogGroups = LoggingFunctions.getLogGroups(GetLogGroupsArgs.builder()
                .compartmentId(compartmentId)
                .displayName(logGroupDisplayName)
                .isCompartmentIdInSubtree(logGroupIsCompartmentIdInSubtree)
                .build());
    
        }
    }
    
    variables:
      testLogGroups:
        fn::invoke:
          Function: oci:Logging:getLogGroups
          Arguments:
            compartmentId: ${compartmentId}
            displayName: ${logGroupDisplayName}
            isCompartmentIdInSubtree: ${logGroupIsCompartmentIdInSubtree}
    

    Using getLogGroups

    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 getLogGroups(args: GetLogGroupsArgs, opts?: InvokeOptions): Promise<GetLogGroupsResult>
    function getLogGroupsOutput(args: GetLogGroupsOutputArgs, opts?: InvokeOptions): Output<GetLogGroupsResult>
    def get_log_groups(compartment_id: Optional[str] = None,
                       display_name: Optional[str] = None,
                       filters: Optional[Sequence[_logging.GetLogGroupsFilter]] = None,
                       is_compartment_id_in_subtree: Optional[bool] = None,
                       opts: Optional[InvokeOptions] = None) -> GetLogGroupsResult
    def get_log_groups_output(compartment_id: Optional[pulumi.Input[str]] = None,
                       display_name: Optional[pulumi.Input[str]] = None,
                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[_logging.GetLogGroupsFilterArgs]]]] = None,
                       is_compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetLogGroupsResult]
    func GetLogGroups(ctx *Context, args *GetLogGroupsArgs, opts ...InvokeOption) (*GetLogGroupsResult, error)
    func GetLogGroupsOutput(ctx *Context, args *GetLogGroupsOutputArgs, opts ...InvokeOption) GetLogGroupsResultOutput

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

    public static class GetLogGroups 
    {
        public static Task<GetLogGroupsResult> InvokeAsync(GetLogGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetLogGroupsResult> Invoke(GetLogGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogGroupsResult> getLogGroups(GetLogGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Logging/getLogGroups:getLogGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    DisplayName string
    Resource name.
    Filters List<GetLogGroupsFilter>
    IsCompartmentIdInSubtree bool
    Specifies whether or not nested compartments should be traversed. Defaults to false.
    CompartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    DisplayName string
    Resource name.
    Filters []GetLogGroupsFilter
    IsCompartmentIdInSubtree bool
    Specifies whether or not nested compartments should be traversed. Defaults to false.
    compartmentId String
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    displayName String
    Resource name.
    filters List<GetLogGroupsFilter>
    isCompartmentIdInSubtree Boolean
    Specifies whether or not nested compartments should be traversed. Defaults to false.
    compartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    displayName string
    Resource name.
    filters GetLogGroupsFilter[]
    isCompartmentIdInSubtree boolean
    Specifies whether or not nested compartments should be traversed. Defaults to false.
    compartment_id str
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    display_name str
    Resource name.
    filters Sequence[logging.GetLogGroupsFilter]
    is_compartment_id_in_subtree bool
    Specifies whether or not nested compartments should be traversed. Defaults to false.
    compartmentId String
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    displayName String
    Resource name.
    filters List<Property Map>
    isCompartmentIdInSubtree Boolean
    Specifies whether or not nested compartments should be traversed. Defaults to false.

    getLogGroups Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    LogGroups List<GetLogGroupsLogGroup>
    The list of log_groups.
    DisplayName string
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    Filters List<GetLogGroupsFilter>
    IsCompartmentIdInSubtree bool
    CompartmentId string
    The OCID of the compartment that the resource belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    LogGroups []GetLogGroupsLogGroup
    The list of log_groups.
    DisplayName string
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    Filters []GetLogGroupsFilter
    IsCompartmentIdInSubtree bool
    compartmentId String
    The OCID of the compartment that the resource belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    logGroups List<GetLogGroupsLogGroup>
    The list of log_groups.
    displayName String
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    filters List<GetLogGroupsFilter>
    isCompartmentIdInSubtree Boolean
    compartmentId string
    The OCID of the compartment that the resource belongs to.
    id string
    The provider-assigned unique ID for this managed resource.
    logGroups GetLogGroupsLogGroup[]
    The list of log_groups.
    displayName string
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    filters GetLogGroupsFilter[]
    isCompartmentIdInSubtree boolean
    compartment_id str
    The OCID of the compartment that the resource belongs to.
    id str
    The provider-assigned unique ID for this managed resource.
    log_groups Sequence[logging.GetLogGroupsLogGroup]
    The list of log_groups.
    display_name str
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    filters Sequence[logging.GetLogGroupsFilter]
    is_compartment_id_in_subtree bool
    compartmentId String
    The OCID of the compartment that the resource belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    logGroups List<Property Map>
    The list of log_groups.
    displayName String
    The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.
    filters List<Property Map>
    isCompartmentIdInSubtree Boolean

    Supporting Types

    GetLogGroupsFilter

    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

    GetLogGroupsLogGroup

    CompartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    Description for this resource.
    DisplayName string
    Resource name.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the resource.
    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    CompartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    Description string
    Description for this resource.
    DisplayName string
    Resource name.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the resource.
    State string
    The log group object state.
    TimeCreated string
    Time the resource was created.
    TimeLastModified string
    Time the resource was last modified.
    compartmentId String
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    Description for this resource.
    displayName String
    Resource name.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the resource.
    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.
    compartmentId string
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description string
    Description for this resource.
    displayName string
    Resource name.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the resource.
    state string
    The log group object state.
    timeCreated string
    Time the resource was created.
    timeLastModified string
    Time the resource was last modified.
    compartment_id str
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description str
    Description for this resource.
    display_name str
    Resource name.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of the resource.
    state str
    The log group object state.
    time_created str
    Time the resource was created.
    time_last_modified str
    Time the resource was last modified.
    compartmentId String
    Compartment OCID to list resources in. See compartmentIdInSubtree for nested compartments traversal.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    description String
    Description for this resource.
    displayName String
    Resource name.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the resource.
    state String
    The log group object state.
    timeCreated String
    Time the resource was created.
    timeLastModified String
    Time the resource was last modified.

    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 v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi