Skip to content
v2.275.0

LogStreamProps Struct ​

Properties for a LogStream.

Example ​

ts
// 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';
import { aws_logs as interfaces_logs } from 'aws-cdk-lib/interfaces';

declare const logGroupRef: interfaces_logs.ILogGroupRef;
const logStreamProps: logs.LogStreamProps = {
  logGroup: logGroupRef,

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

Properties ​

logGroupILogGroupReflog_groupILogGroupReflogGroupILogGroupRefLogGroupILogGroupRefLogGroupILogGroupRefrequired#
The log group to create a log stream for.
logStreamNameoptionalstringlog_stream_nameoptionalstrlogStreamNameoptionalStringLogStreamNameoptionalstringLogStreamNameoptional*string#
The name of the log stream to create.

Default: Automatically generated

The name must be unique within the log group.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= 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.