LogRetention¶
-
class
aws_cdk.aws_logs.
LogRetention
(scope, id, *, log_group_name, retention, log_group_region=None, log_retention_retry_options=None, role=None)¶ Bases:
aws_cdk.core.Construct
Creates a custom resource to control the retention policy of a CloudWatch Logs log group.
The log group is created if it doesn’t already exist. The policy is removed when
retentionDays
isundefined
or equal toInfinity
. Log group can be created in the region that is different from stack region by specifyinglogGroupRegion
- Parameters
scope (
Construct
) –id (
str
) –log_group_name (
str
) – The log group name.retention (
RetentionDays
) – The number of days log events are kept in CloudWatch Logs.log_group_region (
Optional
[str
]) – The region where the log group should be created. Default: - same region as the stacklog_retention_retry_options (
Optional
[LogRetentionRetryOptions
]) – Retry options for all AWS API calls. Default: - AWS SDK default retry optionsrole (
Optional
[IRole
]) – The IAM role for the Lambda function associated with the custom resource. Default: - A new role is created
Methods
-
to_string
()¶ Returns a string representation of this construct.
- Return type
str
Attributes
-
log_group_arn
¶ The ARN of the LogGroup.
- Return type
str
-
node
¶ The construct tree node associated with this construct.
- Return type
Static Methods
-
classmethod
is_construct
(x)¶ Return whether the given object is a Construct.
- Parameters
x (
Any
) –- Return type
bool