aws-cdk-lib.aws_logs.LogStreamProps

interface LogStreamProps

LanguageType name
.NETAmazon.CDK.AWS.Logs.LogStreamProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogs#LogStreamProps
Javasoftware.amazon.awscdk.services.logs.LogStreamProps
Pythonaws_cdk.aws_logs.LogStreamProps
TypeScript (source)aws-cdk-lib » aws_logs » LogStreamProps

Properties for a LogStream.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';

declare const logGroup: logs.LogGroup;
const logStreamProps: logs.LogStreamProps = {
  logGroup: logGroup,

  // the properties below are optional
  logStreamName: 'logStreamName',
  removalPolicy: cdk.RemovalPolicy.DESTROY,
};

Properties

NameTypeDescription
logGroupILogGroupThe log group to create a log stream for.
logStreamName?stringThe name of the log stream to create.
removalPolicy?RemovalPolicyDetermine what happens when the log stream resource is removed from the app.

logGroup

Type: ILogGroup

The log group to create a log stream for.


logStreamName?

Type: string (optional, default: Automatically generated)

The name of the log stream to create.

The name must be unique within the log group.


removalPolicy?

Type: RemovalPolicy (optional, default: RemovalPolicy.Retain)

Determine what happens when the log stream resource is removed from the app.

Normally you want to retain the log stream so you can diagnose issues from logs even after a deployment that no longer includes the log stream.

The date-based retention policy of your log group will age out the logs after a certain time.