LogGroupArgs

data class LogGroupArgs(val kmsKeyId: Output<String>? = null, val logGroupClass: Output<String>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val retentionInDays: Output<Int>? = null, val skipDestroy: Output<Boolean>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<LogGroupArgs>

Provides a CloudWatch Log Group resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const yada = new aws.cloudwatch.LogGroup("yada", {
name: "Yada",
tags: {
Environment: "production",
Application: "serviceA",
},
});
import pulumi
import pulumi_aws as aws
yada = aws.cloudwatch.LogGroup("yada",
name="Yada",
tags={
"Environment": "production",
"Application": "serviceA",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var yada = new Aws.CloudWatch.LogGroup("yada", new()
{
Name = "Yada",
Tags =
{
{ "Environment", "production" },
{ "Application", "serviceA" },
},
});
});
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.NewLogGroup(ctx, "yada", &cloudwatch.LogGroupArgs{
Name: pulumi.String("Yada"),
Tags: pulumi.StringMap{
"Environment": pulumi.String("production"),
"Application": pulumi.String("serviceA"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogGroup;
import com.pulumi.aws.cloudwatch.LogGroupArgs;
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) {
var yada = new LogGroup("yada", LogGroupArgs.builder()
.name("Yada")
.tags(Map.ofEntries(
Map.entry("Environment", "production"),
Map.entry("Application", "serviceA")
))
.build());
}
}
resources:
yada:
type: aws:cloudwatch:LogGroup
properties:
name: Yada
tags:
Environment: production
Application: serviceA

Import

Using pulumi import, import Cloudwatch Log Groups using the name. For example:

$ pulumi import aws:cloudwatch/logGroup:LogGroup test_group yada

Constructors

Link copied to clipboard
constructor(kmsKeyId: Output<String>? = null, logGroupClass: Output<String>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, retentionInDays: Output<Int>? = null, skipDestroy: Output<Boolean>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val kmsKeyId: Output<String>? = null

The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.

Link copied to clipboard
val logGroupClass: Output<String>? = null

Specified the log class of the log group. Possible values are: STANDARD or INFREQUENT_ACCESS.

Link copied to clipboard
val name: Output<String>? = null

The name of the log group. If omitted, this provider will assign a random, unique name.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val retentionInDays: Output<Int>? = null

Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653, and 0. If you select 0, the events in the log group are always retained and never expire.

Link copied to clipboard
val skipDestroy: Output<Boolean>? = null

Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the state.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Functions

Link copied to clipboard
open override fun toJava(): LogGroupArgs