# LogStreamProps

Properties for a LogStream.

Used as props by: [LogStream](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogStream.html)

- Source: [`aws-logs/lib/log-stream.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-logs/lib/log-stream.ts#L39)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

```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,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_logs as logs
from aws_cdk.interfaces import aws_logs as interfaces_logs

# log_group_ref: interfaces_logs.ILogGroupRef

log_stream_props = logs.LogStreamProps(
    log_group=log_group_ref,

    # the properties below are optional
    log_stream_name="logStreamName",
    removal_policy=cdk.RemovalPolicy.DESTROY
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.logs.*;
import software.amazon.awscdk.interfaces.logs.*;

ILogGroupRef logGroupRef;

LogStreamProps logStreamProps = LogStreamProps.builder()
        .logGroup(logGroupRef)

        // the properties below are optional
        .logStreamName("logStreamName")
        .removalPolicy(RemovalPolicy.DESTROY)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Logs;
using Amazon.CDK.Interfaces.Logs;

ILogGroupRef logGroupRef;

var logStreamProps = new LogStreamProps {
    LogGroup = logGroupRef,

    // the properties below are optional
    LogStreamName = "logStreamName",
    RemovalPolicy = RemovalPolicy.DESTROY
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var logGroupRef ILogGroupRef

logStreamProps := &LogStreamProps{
	LogGroup: logGroupRef,

	// the properties below are optional
	LogStreamName: jsii.String("logStreamName"),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
}
```

## Properties

- `logGroup`: [ILogGroupRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_logs.ILogGroupRef.html) (required) — The log group to create a log stream for.

- `logStreamName`: string — The name of the log stream to create.

  **Default:** Automatically generated

  The name must be unique within the log group.

- `removalPolicy`: [RemovalPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = 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.
