RetentionDays
- class aws_cdk.aws_logs.RetentionDays(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
How long, in days, the log contents will be retained.
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_iam as iam import aws_cdk.aws_logs as logs # my_logs_publishing_role: iam.Role # vpc: ec2.Vpc cluster = docdb.DatabaseCluster(self, "Database", master_user=docdb.Login( username="myuser" ), instance_type=ec2.InstanceType.of(ec2.InstanceClass.MEMORY5, ec2.InstanceSize.LARGE), vpc_subnets=ec2.SubnetSelection( subnet_type=ec2.SubnetType.PUBLIC ), vpc=vpc, export_profiler_logs_to_cloud_watch=True, # Enable sending profiler logs export_audit_logs_to_cloud_watch=True, # Enable sending audit logs cloud_watch_logs_retention=logs.RetentionDays.THREE_MONTHS, # Optional - default is to never expire logs cloud_watch_logs_retention_role=my_logs_publishing_role )
Attributes
- EIGHTEEN_MONTHS
18 months.
- EIGHT_YEARS
8 years.
- FIVE_DAYS
5 days.
- FIVE_MONTHS
5 months.
- FIVE_YEARS
5 years.
- FOUR_MONTHS
4 months.
- INFINITE
Retain logs forever.
- NINE_YEARS
9 years.
- ONE_DAY
1 day.
- ONE_MONTH
1 month.
- ONE_WEEK
1 week.
- ONE_YEAR
1 year.
- SEVEN_YEARS
7 years.
- SIX_MONTHS
6 months.
- SIX_YEARS
6 years.
- TEN_YEARS
10 years.
- THIRTEEN_MONTHS
13 months.
- THREE_DAYS
3 days.
- THREE_MONTHS
3 months.
- THREE_YEARS
3 years.
- TWO_MONTHS
2 months.
- TWO_WEEKS
2 weeks.
- TWO_YEARS
2 years.