AWS Classic

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

getLogGroups

Use this data source to get a list of AWS Cloudwatch Log Groups

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.CloudWatch.GetLogGroups.InvokeAsync(new Aws.CloudWatch.GetLogGroupsArgs
        {
            LogGroupNamePrefix = "/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.GetLogGroups(ctx, &cloudwatch.GetLogGroupsArgs{
			LogGroupNamePrefix: pulumi.StringRef("/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.getLogGroups(GetLogGroupsArgs.builder()
            .logGroupNamePrefix("/MyImportantLogs")
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

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

const example = pulumi.output(aws.cloudwatch.getLogGroups({
    logGroupNamePrefix: "/MyImportantLogs",
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:cloudwatch:getLogGroups
      Arguments:
        logGroupNamePrefix: /MyImportantLogs

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(log_group_name_prefix: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetLogGroupsResult
def get_log_groups_output(log_group_name_prefix: Optional[pulumi.Input[str]] = 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: aws:cloudwatch/getLogGroups:getLogGroups
  Arguments:
    # Arguments dictionary

The following arguments are supported:

LogGroupNamePrefix string

The group prefix of the Cloudwatch log groups to list

LogGroupNamePrefix string

The group prefix of the Cloudwatch log groups to list

logGroupNamePrefix String

The group prefix of the Cloudwatch log groups to list

logGroupNamePrefix string

The group prefix of the Cloudwatch log groups to list

log_group_name_prefix str

The group prefix of the Cloudwatch log groups to list

logGroupNamePrefix String

The group prefix of the Cloudwatch log groups to list

getLogGroups Result

The following output properties are available:

Arns List<string>

Set of ARNs of the Cloudwatch log groups

Id string

The provider-assigned unique ID for this managed resource.

LogGroupNames List<string>

Set of names of the Cloudwatch log groups

LogGroupNamePrefix string
Arns []string

Set of ARNs of the Cloudwatch log groups

Id string

The provider-assigned unique ID for this managed resource.

LogGroupNames []string

Set of names of the Cloudwatch log groups

LogGroupNamePrefix string
arns List<String>

Set of ARNs of the Cloudwatch log groups

id String

The provider-assigned unique ID for this managed resource.

logGroupNames List<String>

Set of names of the Cloudwatch log groups

logGroupNamePrefix String
arns string[]

Set of ARNs of the Cloudwatch log groups

id string

The provider-assigned unique ID for this managed resource.

logGroupNames string[]

Set of names of the Cloudwatch log groups

logGroupNamePrefix string
arns Sequence[str]

Set of ARNs of the Cloudwatch log groups

id str

The provider-assigned unique ID for this managed resource.

log_group_names Sequence[str]

Set of names of the Cloudwatch log groups

log_group_name_prefix str
arns List<String>

Set of ARNs of the Cloudwatch log groups

id String

The provider-assigned unique ID for this managed resource.

logGroupNames List<String>

Set of names of the Cloudwatch log groups

logGroupNamePrefix String

Package Details

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

This Pulumi package is based on the aws Terraform Provider.