Show / Hide Table of Contents

Class LogGroupProps

Properties for a LogGroup.

Inheritance
object
LogGroupProps
Implements
ILogGroupProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LogGroupProps : ILogGroupProps
Syntax (vb)
Public Class LogGroupProps Implements ILogGroupProps
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.KinesisFirehose;


            var logGroupDestination = new LogGroup(this, "LogGroupLambdaAudit", new LogGroupProps {
                LogGroupName = "auditDestinationForCDK"
            });

            var bucket = new Bucket(this, "audit-bucket");
            var s3Destination = new S3Bucket(bucket);

            var deliveryStream = new DeliveryStream(this, "Delivery Stream", new DeliveryStreamProps {
                Destination = s3Destination
            });

            var dataProtectionPolicy = new DataProtectionPolicy(new DataProtectionPolicyProps {
                Name = "data protection policy",
                Description = "policy description",
                Identifiers = new [] { DataIdentifier.DRIVERSLICENSE_US,  // managed data identifier
                    new DataIdentifier("EmailAddress"),  // forward compatibility for new managed data identifiers
                    new CustomDataIdentifier("EmployeeId", "EmployeeId-\\d{9}") },  // custom data identifier
                LogGroupAuditDestination = logGroupDestination,
                S3BucketAuditDestination = bucket,
                DeliveryStreamNameAuditDestination = deliveryStream.DeliveryStreamName
            });

            new LogGroup(this, "LogGroupLambda", new LogGroupProps {
                LogGroupName = "cdkIntegLogGroup",
                DataProtectionPolicy = dataProtectionPolicy
            });

Synopsis

Constructors

LogGroupProps()

Properties for a LogGroup.

Properties

DataProtectionPolicy

Data Protection Policy for this log group.

EncryptionKey

The KMS customer managed key to encrypt the log group with.

FieldIndexPolicies

Field Index Policies for this log group.

LogGroupClass

The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS.

LogGroupName

Name of the log group.

RemovalPolicy

Determine the removal policy of this log group.

Retention

How long, in days, the log contents will be retained.

Constructors

LogGroupProps()

Properties for a LogGroup.

public LogGroupProps()
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.KinesisFirehose;


            var logGroupDestination = new LogGroup(this, "LogGroupLambdaAudit", new LogGroupProps {
                LogGroupName = "auditDestinationForCDK"
            });

            var bucket = new Bucket(this, "audit-bucket");
            var s3Destination = new S3Bucket(bucket);

            var deliveryStream = new DeliveryStream(this, "Delivery Stream", new DeliveryStreamProps {
                Destination = s3Destination
            });

            var dataProtectionPolicy = new DataProtectionPolicy(new DataProtectionPolicyProps {
                Name = "data protection policy",
                Description = "policy description",
                Identifiers = new [] { DataIdentifier.DRIVERSLICENSE_US,  // managed data identifier
                    new DataIdentifier("EmailAddress"),  // forward compatibility for new managed data identifiers
                    new CustomDataIdentifier("EmployeeId", "EmployeeId-\\d{9}") },  // custom data identifier
                LogGroupAuditDestination = logGroupDestination,
                S3BucketAuditDestination = bucket,
                DeliveryStreamNameAuditDestination = deliveryStream.DeliveryStreamName
            });

            new LogGroup(this, "LogGroupLambda", new LogGroupProps {
                LogGroupName = "cdkIntegLogGroup",
                DataProtectionPolicy = dataProtectionPolicy
            });

Properties

DataProtectionPolicy

Data Protection Policy for this log group.

public DataProtectionPolicy? DataProtectionPolicy { get; set; }
Property Value

DataProtectionPolicy

Remarks

Default: - no data protection policy

EncryptionKey

The KMS customer managed key to encrypt the log group with.

public IKey? EncryptionKey { get; set; }
Property Value

IKey

Remarks

Default: Server-side encryption managed by the CloudWatch Logs service

FieldIndexPolicies

Field Index Policies for this log group.

public FieldIndexPolicy[]? FieldIndexPolicies { get; set; }
Property Value

FieldIndexPolicy[]

Remarks

Default: - no field index policies for this log group.

LogGroupClass

The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS.

public LogGroupClass? LogGroupClass { get; set; }
Property Value

LogGroupClass?

Remarks

INFREQUENT_ACCESS class provides customers a cost-effective way to consolidate logs which supports querying using Logs Insights. The logGroupClass property cannot be changed once the log group is created.

Default: LogGroupClass.STANDARD

LogGroupName

Name of the log group.

public string? LogGroupName { get; set; }
Property Value

string

Remarks

Default: Automatically generated

RemovalPolicy

Determine the removal policy of this log group.

public RemovalPolicy? RemovalPolicy { get; set; }
Property Value

RemovalPolicy?

Remarks

Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs.

Default: RemovalPolicy.Retain

Retention

How long, in days, the log contents will be retained.

public RetentionDays? Retention { get; set; }
Property Value

RetentionDays?

Remarks

To retain all logs, set this value to RetentionDays.INFINITE.

Default: RetentionDays.TWO_YEARS

Implements

ILogGroupProps
Back to top Generated by DocFX