Class RetentionDays
How long, in days, the log contents will be retained.
Inheritance
System.Object
RetentionDays
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.AWS.Logs.dll
Syntax (csharp)
public sealed class RetentionDays : Enum
Syntax (vb)
Public NotInheritable Class RetentionDays
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Logs;
Role myLogsPublishingRole;
Vpc vpc;
// Exporting logs from a cluster
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.Aurora(new AuroraClusterEngineProps {
Version = AuroraEngineVersion.VER_1_17_9
}),
InstanceProps = new InstanceProps {
Vpc = vpc
},
CloudwatchLogsExports = new [] { "error", "general", "slowquery", "audit" }, // Export all available MySQL-based logs
CloudwatchLogsRetention = RetentionDays.THREE_MONTHS, // Optional - default is to never expire logs
CloudwatchLogsRetentionRole = myLogsPublishingRole
});
// Exporting logs from an instance
var instance = new DatabaseInstance(this, "Instance", new DatabaseInstanceProps {
Engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps {
Version = PostgresEngineVersion.VER_12_3
}),
Vpc = vpc,
CloudwatchLogsExports = new [] { "postgresql" }
});
Synopsis
Fields
EIGHT_YEARS | 8 years. |
EIGHTEEN_MONTHS | 18 months. |
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. |
TWO_MONTHS | 2 months. |
TWO_WEEKS | 2 weeks. |
TWO_YEARS | 2 years. |
value__ |
Fields
EIGHT_YEARS
EIGHTEEN_MONTHS
FIVE_DAYS
FIVE_MONTHS
FIVE_YEARS
FOUR_MONTHS
INFINITE
NINE_YEARS
ONE_DAY
ONE_MONTH
ONE_WEEK
ONE_YEAR
SEVEN_YEARS
SIX_MONTHS
SIX_YEARS
TEN_YEARS
THIRTEEN_MONTHS
THREE_DAYS
THREE_MONTHS
TWO_MONTHS
TWO_WEEKS
TWO_YEARS
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |