LogGroupProps

class aws_cdk.aws_logs.LogGroupProps(*, log_group_name=None, removal_policy=None, retention=None)

Bases: object

__init__(*, log_group_name=None, removal_policy=None, retention=None)

Properties for a LogGroup.

Parameters
  • log_group_name (Optional[str]) – Name of the log group. Default: Automatically generated

  • removal_policy (Optional[RemovalPolicy]) – Determine the removal policy of this log group. 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 (Optional[RetentionDays]) – How long, in days, the log contents will be retained. To retain all logs, set this value to RetentionDays.INFINITE. Default: RetentionDays.TWO_YEARS

Attributes

log_group_name

Name of the log group.

default :default: Automatically generated

Return type

Optional[str]

removal_policy

Determine the removal policy of this log group.

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 :default: RemovalPolicy.Retain

Return type

Optional[RemovalPolicy]

retention

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

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

default :default: RetentionDays.TWO_YEARS

Return type

Optional[RetentionDays]