Enum RetentionDays
- All Implemented Interfaces:
Serializable
,Comparable<RetentionDays>
,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:04.298Z")
@Stability(Stable)
public enum RetentionDays
extends Enum<RetentionDays>
How long, in days, the log contents will be retained.
Example:
import software.amazon.awscdk.services.iam.*; import software.amazon.awscdk.services.logs.*; Role myLogsPublishingRole; Vpc vpc; DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database") .masterUser(Login.builder() .username("myuser") .build()) .instanceType(InstanceType.of(InstanceClass.MEMORY5, InstanceSize.LARGE)) .vpcSubnets(SubnetSelection.builder() .subnetType(SubnetType.PUBLIC) .build()) .vpc(vpc) .exportProfilerLogsToCloudWatch(true) // Enable sending profiler logs .exportAuditLogsToCloudWatch(true) // Enable sending audit logs .cloudWatchLogsRetention(RetentionDays.THREE_MONTHS) // Optional - default is to never expire logs .cloudWatchLogsRetentionRole(myLogsPublishingRole) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription8 years.18 months.5 days.5 months.5 years.4 months.Retain logs forever.9 years.1 day.1 month.1 week.1 year.7 years.6 months.6 years.10 years.13 months.3 days.3 months.3 years.2 months.2 weeks.2 years. -
Method Summary
Modifier and TypeMethodDescriptionstatic RetentionDays
Returns the enum constant of this type with the specified name.static RetentionDays[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ONE_DAY
1 day. -
THREE_DAYS
3 days. -
FIVE_DAYS
5 days. -
ONE_WEEK
1 week. -
TWO_WEEKS
2 weeks. -
ONE_MONTH
1 month. -
TWO_MONTHS
2 months. -
THREE_MONTHS
3 months. -
FOUR_MONTHS
4 months. -
FIVE_MONTHS
5 months. -
SIX_MONTHS
6 months. -
ONE_YEAR
1 year. -
THIRTEEN_MONTHS
13 months. -
EIGHTEEN_MONTHS
18 months. -
TWO_YEARS
2 years. -
THREE_YEARS
3 years. -
FIVE_YEARS
5 years. -
SIX_YEARS
6 years. -
SEVEN_YEARS
7 years. -
EIGHT_YEARS
8 years. -
NINE_YEARS
9 years. -
TEN_YEARS
10 years. -
INFINITE
Retain logs forever.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-