Enum RetentionDays

java.lang.Object
java.lang.Enum<RetentionDays>
software.amazon.awscdk.services.logs.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();
 
  • Enum Constant Details

    • ONE_DAY

      @Stability(Stable) public static final RetentionDays ONE_DAY
      1 day.
    • THREE_DAYS

      @Stability(Stable) public static final RetentionDays THREE_DAYS
      3 days.
    • FIVE_DAYS

      @Stability(Stable) public static final RetentionDays FIVE_DAYS
      5 days.
    • ONE_WEEK

      @Stability(Stable) public static final RetentionDays ONE_WEEK
      1 week.
    • TWO_WEEKS

      @Stability(Stable) public static final RetentionDays TWO_WEEKS
      2 weeks.
    • ONE_MONTH

      @Stability(Stable) public static final RetentionDays ONE_MONTH
      1 month.
    • TWO_MONTHS

      @Stability(Stable) public static final RetentionDays TWO_MONTHS
      2 months.
    • THREE_MONTHS

      @Stability(Stable) public static final RetentionDays THREE_MONTHS
      3 months.
    • FOUR_MONTHS

      @Stability(Stable) public static final RetentionDays FOUR_MONTHS
      4 months.
    • FIVE_MONTHS

      @Stability(Stable) public static final RetentionDays FIVE_MONTHS
      5 months.
    • SIX_MONTHS

      @Stability(Stable) public static final RetentionDays SIX_MONTHS
      6 months.
    • ONE_YEAR

      @Stability(Stable) public static final RetentionDays ONE_YEAR
      1 year.
    • THIRTEEN_MONTHS

      @Stability(Stable) public static final RetentionDays THIRTEEN_MONTHS
      13 months.
    • EIGHTEEN_MONTHS

      @Stability(Stable) public static final RetentionDays EIGHTEEN_MONTHS
      18 months.
    • TWO_YEARS

      @Stability(Stable) public static final RetentionDays TWO_YEARS
      2 years.
    • THREE_YEARS

      @Stability(Stable) public static final RetentionDays THREE_YEARS
      3 years.
    • FIVE_YEARS

      @Stability(Stable) public static final RetentionDays FIVE_YEARS
      5 years.
    • SIX_YEARS

      @Stability(Stable) public static final RetentionDays SIX_YEARS
      6 years.
    • SEVEN_YEARS

      @Stability(Stable) public static final RetentionDays SEVEN_YEARS
      7 years.
    • EIGHT_YEARS

      @Stability(Stable) public static final RetentionDays EIGHT_YEARS
      8 years.
    • NINE_YEARS

      @Stability(Stable) public static final RetentionDays NINE_YEARS
      9 years.
    • TEN_YEARS

      @Stability(Stable) public static final RetentionDays TEN_YEARS
      10 years.
    • INFINITE

      @Stability(Stable) public static final RetentionDays INFINITE
      Retain logs forever.
  • Method Details

    • values

      public static RetentionDays[] 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

      public static RetentionDays valueOf(String name)
      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 name
      NullPointerException - if the argument is null