AWS Classic
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:
- Log
Group stringName Prefix The group prefix of the Cloudwatch log groups to list
- Log
Group stringName Prefix The group prefix of the Cloudwatch log groups to list
- log
Group StringName Prefix The group prefix of the Cloudwatch log groups to list
- log
Group stringName Prefix The group prefix of the Cloudwatch log groups to list
- log_
group_ strname_ prefix The group prefix of the Cloudwatch log groups to list
- log
Group StringName Prefix 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.
- 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
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.