AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.cloudwatch.getLogGroups
Explore with Pulumi AI
Use this data source to get a list of AWS Cloudwatch Log Groups
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.cloudwatch.getLogGroups({
logGroupNamePrefix: "/MyImportantLogs",
});
import pulumi
import pulumi_aws as aws
example = aws.cloudwatch.get_log_groups(log_group_name_prefix="/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.GetLogGroups(ctx, &cloudwatch.GetLogGroupsArgs{
LogGroupNamePrefix: pulumi.StringRef("/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.GetLogGroups.Invoke(new()
{
LogGroupNamePrefix = "/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.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 example = CloudwatchFunctions.getLogGroups(GetLogGroupsArgs.builder()
.logGroupNamePrefix("/MyImportantLogs")
.build());
}
}
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:
- Log
Group stringName Prefix - Group prefix of the Cloudwatch log groups to list
- Log
Group stringName Prefix - Group prefix of the Cloudwatch log groups to list
- log
Group StringName Prefix - Group prefix of the Cloudwatch log groups to list
- log
Group stringName Prefix - Group prefix of the Cloudwatch log groups to list
- log_
group_ strname_ prefix - Group prefix of the Cloudwatch log groups to list
- log
Group StringName Prefix - 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.
- Log
Group List<string>Names - Set of names of the Cloudwatch log groups
- Log
Group stringName Prefix
- Arns []string
- Set of ARNs of the Cloudwatch log groups
- Id string
- The provider-assigned unique ID for this managed resource.
- Log
Group []stringNames - Set of names of the Cloudwatch log groups
- Log
Group stringName Prefix
- arns List<String>
- Set of ARNs of the Cloudwatch log groups
- id String
- The provider-assigned unique ID for this managed resource.
- log
Group List<String>Names - Set of names of the Cloudwatch log groups
- log
Group StringName Prefix
- arns string[]
- Set of ARNs of the Cloudwatch log groups
- id string
- The provider-assigned unique ID for this managed resource.
- log
Group string[]Names - Set of names of the Cloudwatch log groups
- log
Group stringName Prefix
- arns Sequence[str]
- Set of ARNs of the Cloudwatch log groups
- id str
- The provider-assigned unique ID for this managed resource.
- log_
group_ Sequence[str]names - Set of names of the Cloudwatch log groups
- log_
group_ strname_ prefix
- arns List<String>
- Set of ARNs of the Cloudwatch log groups
- id String
- The provider-assigned unique ID for this managed resource.
- log
Group List<String>Names - Set of names of the Cloudwatch log groups
- log
Group StringName Prefix
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.