1. Packages
  2. AWS Classic
  3. API Docs
  4. cloudwatch
  5. getLogGroup

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

aws.cloudwatch.getLogGroup

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi

    Use this data source to get information about an AWS Cloudwatch Log Group

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.cloudwatch.getLogGroup({
        name: "MyImportantLogs",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudwatch.get_log_group(name="MyImportantLogs")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudwatch.LookupLogGroup(ctx, &cloudwatch.LookupLogGroupArgs{
    			Name: "MyImportantLogs",
    		}, 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 example = Aws.CloudWatch.GetLogGroup.Invoke(new()
        {
            Name = "MyImportantLogs",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudwatch.CloudwatchFunctions;
    import com.pulumi.aws.cloudwatch.inputs.GetLogGroupArgs;
    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 example = CloudwatchFunctions.getLogGroup(GetLogGroupArgs.builder()
                .name("MyImportantLogs")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:cloudwatch:getLogGroup
          Arguments:
            name: MyImportantLogs
    

    Using getLogGroup

    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 getLogGroup(args: GetLogGroupArgs, opts?: InvokeOptions): Promise<GetLogGroupResult>
    function getLogGroupOutput(args: GetLogGroupOutputArgs, opts?: InvokeOptions): Output<GetLogGroupResult>
    def get_log_group(name: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetLogGroupResult
    def get_log_group_output(name: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetLogGroupResult]
    func LookupLogGroup(ctx *Context, args *LookupLogGroupArgs, opts ...InvokeOption) (*LookupLogGroupResult, error)
    func LookupLogGroupOutput(ctx *Context, args *LookupLogGroupOutputArgs, opts ...InvokeOption) LookupLogGroupResultOutput

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

    public static class GetLogGroup 
    {
        public static Task<GetLogGroupResult> InvokeAsync(GetLogGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetLogGroupResult> Invoke(GetLogGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogGroupResult> getLogGroup(GetLogGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:cloudwatch/getLogGroup:getLogGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name of the Cloudwatch log group
    Tags Dictionary<string, string>
    Map of tags to assign to the resource.
    Name string
    Name of the Cloudwatch log group
    Tags map[string]string
    Map of tags to assign to the resource.
    name String
    Name of the Cloudwatch log group
    tags Map<String,String>
    Map of tags to assign to the resource.
    name string
    Name of the Cloudwatch log group
    tags {[key: string]: string}
    Map of tags to assign to the resource.
    name str
    Name of the Cloudwatch log group
    tags Mapping[str, str]
    Map of tags to assign to the resource.
    name String
    Name of the Cloudwatch log group
    tags Map<String>
    Map of tags to assign to the resource.

    getLogGroup Result

    The following output properties are available:

    Arn string
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    CreationTime int
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    KmsKeyId string
    ARN of the KMS Key to use when encrypting log data.
    LogGroupClass string
    The log class of the log group.
    Name string
    RetentionInDays int
    Number of days log events retained in the specified log group.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource.
    Arn string
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    CreationTime int
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    KmsKeyId string
    ARN of the KMS Key to use when encrypting log data.
    LogGroupClass string
    The log class of the log group.
    Name string
    RetentionInDays int
    Number of days log events retained in the specified log group.
    Tags map[string]string
    Map of tags to assign to the resource.
    arn String
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    creationTime Integer
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    kmsKeyId String
    ARN of the KMS Key to use when encrypting log data.
    logGroupClass String
    The log class of the log group.
    name String
    retentionInDays Integer
    Number of days log events retained in the specified log group.
    tags Map<String,String>
    Map of tags to assign to the resource.
    arn string
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    creationTime number
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    kmsKeyId string
    ARN of the KMS Key to use when encrypting log data.
    logGroupClass string
    The log class of the log group.
    name string
    retentionInDays number
    Number of days log events retained in the specified log group.
    tags {[key: string]: string}
    Map of tags to assign to the resource.
    arn str
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    creation_time int
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    kms_key_id str
    ARN of the KMS Key to use when encrypting log data.
    log_group_class str
    The log class of the log group.
    name str
    retention_in_days int
    Number of days log events retained in the specified log group.
    tags Mapping[str, str]
    Map of tags to assign to the resource.
    arn String
    ARN of the Cloudwatch log group. Any :* suffix added by the API, denoting all CloudWatch Log Streams under the CloudWatch Log Group, is removed for greater compatibility with other AWS services that do not accept the suffix.
    creationTime Number
    Creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    kmsKeyId String
    ARN of the KMS Key to use when encrypting log data.
    logGroupClass String
    The log class of the log group.
    name String
    retentionInDays Number
    Number of days log events retained in the specified log group.
    tags Map<String>
    Map of tags to assign to the resource.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.28.1 published on Thursday, Mar 28, 2024 by Pulumi