LogStreamProps

class aws_cdk.aws_logs.LogStreamProps(*, log_group, log_stream_name=None, removal_policy=None)

Bases: object

Properties for a LogStream.

Parameters:
  • log_group (ILogGroup) – The log group to create a log stream for.

  • log_stream_name (Optional[str]) – The name of the log stream to create. The name must be unique within the log group. Default: Automatically generated

  • removal_policy (Optional[RemovalPolicy]) – 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. Default: RemovalPolicy.Retain

ExampleMetadata:

fixture=_generated

Example:

# 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

# log_group: logs.LogGroup

log_stream_props = logs.LogStreamProps(
    log_group=log_group,

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

Attributes

log_group

The log group to create a log stream for.

log_stream_name

The name of the log stream to create.

The name must be unique within the log group.

Default:

Automatically generated

removal_policy

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.

Default:

RemovalPolicy.Retain