AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

getLogGroup

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.CloudWatch.GetLogGroup.InvokeAsync(new Aws.CloudWatch.GetLogGroupArgs
        {
            Name = "MyImportantLogs",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(CloudwatchFunctions.getLogGroup(GetLogGroupArgs.builder()
            .name("MyImportantLogs")
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudwatch.get_log_group(name="MyImportantLogs")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.cloudwatch.getLogGroup({
    name: "MyImportantLogs",
}));
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

The name of the Cloudwatch log group

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Name string

The name of the Cloudwatch log group

Tags map[string]string

A map of tags to assign to the resource.

name String

The name of the Cloudwatch log group

tags Map<String,String>

A map of tags to assign to the resource.

name string

The name of the Cloudwatch log group

tags {[key: string]: string}

A map of tags to assign to the resource.

name str

The name of the Cloudwatch log group

tags Mapping[str, str]

A map of tags to assign to the resource.

name String

The name of the Cloudwatch log group

tags Map<String>

A map of tags to assign to the resource.

getLogGroup Result

The following output properties are available:

Arn string

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

Name string
RetentionInDays int

The number of days log events retained in the specified log group.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Arn string

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

Name string
RetentionInDays int

The number of days log events retained in the specified log group.

Tags map[string]string

A map of tags to assign to the resource.

arn String

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

name String
retentionInDays Integer

The number of days log events retained in the specified log group.

tags Map<String,String>

A map of tags to assign to the resource.

arn string

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

name string
retentionInDays number

The number of days log events retained in the specified log group.

tags {[key: string]: string}

A map of tags to assign to the resource.

arn str

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

name str
retention_in_days int

The number of days log events retained in the specified log group.

tags Mapping[str, str]

A map of tags to assign to the resource.

arn String

The 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

The 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

The ARN of the KMS Key to use when encrypting log data.

name String
retentionInDays Number

The number of days log events retained in the specified log group.

tags Map<String>

A map of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.