RetentionDays Enum
How long, in days, the log contents will be retained.
| Source | aws-logs/lib/log-group.ts |
|---|---|
| Type last changed |
Example
ts
const pipelineLogGroup = new logs.LogGroup(this, 'PipelineLogGroup', {
logGroupName: '/custom/imagebuilder/pipeline/logs',
retention: logs.RetentionDays.ONE_MONTH
});
const imageLogGroup = new logs.LogGroup(this, 'ImageLogGroup', {
logGroupName: '/custom/imagebuilder/image/logs',
retention: logs.RetentionDays.ONE_WEEK
});
const loggedPipeline = new imagebuilder.ImagePipeline(this, 'LoggedPipeline', {
recipe: exampleImageRecipe,
imagePipelineLogGroup: pipelineLogGroup,
imageLogGroup: imageLogGroup
});
python
pipeline_log_group = logs.LogGroup(self, "PipelineLogGroup",
log_group_name="/custom/imagebuilder/pipeline/logs",
retention=logs.RetentionDays.ONE_MONTH
)
image_log_group = logs.LogGroup(self, "ImageLogGroup",
log_group_name="/custom/imagebuilder/image/logs",
retention=logs.RetentionDays.ONE_WEEK
)
logged_pipeline = imagebuilder.ImagePipeline(self, "LoggedPipeline",
recipe=example_image_recipe,
image_pipeline_log_group=pipeline_log_group,
image_log_group=image_log_group
)
java
LogGroup pipelineLogGroup = LogGroup.Builder.create(this, "PipelineLogGroup")
.logGroupName("/custom/imagebuilder/pipeline/logs")
.retention(RetentionDays.ONE_MONTH)
.build();
LogGroup imageLogGroup = LogGroup.Builder.create(this, "ImageLogGroup")
.logGroupName("/custom/imagebuilder/image/logs")
.retention(RetentionDays.ONE_WEEK)
.build();
ImagePipeline loggedPipeline = ImagePipeline.Builder.create(this, "LoggedPipeline")
.recipe(exampleImageRecipe)
.imagePipelineLogGroup(pipelineLogGroup)
.imageLogGroup(imageLogGroup)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var pipelineLogGroup = new LogGroup(this, "PipelineLogGroup", new LogGroupProps {
LogGroupName = "/custom/imagebuilder/pipeline/logs",
Retention = RetentionDays.ONE_MONTH
});
var imageLogGroup = new LogGroup(this, "ImageLogGroup", new LogGroupProps {
LogGroupName = "/custom/imagebuilder/image/logs",
Retention = RetentionDays.ONE_WEEK
});
var loggedPipeline = new ImagePipeline(this, "LoggedPipeline", new ImagePipelineProps {
Recipe = exampleImageRecipe,
ImagePipelineLogGroup = pipelineLogGroup,
ImageLogGroup = imageLogGroup
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
pipelineLogGroup := logs.NewLogGroup(this, jsii.String("PipelineLogGroup"), &LogGroupProps{
LogGroupName: jsii.String("/custom/imagebuilder/pipeline/logs"),
Retention: logs.RetentionDays_ONE_MONTH,
})
imageLogGroup := logs.NewLogGroup(this, jsii.String("ImageLogGroup"), &LogGroupProps{
LogGroupName: jsii.String("/custom/imagebuilder/image/logs"),
Retention: logs.RetentionDays_ONE_WEEK,
})
loggedPipeline := imagebuilder.NewImagePipeline(this, jsii.String("LoggedPipeline"), &ImagePipelineProps{
Recipe: exampleImageRecipe,
ImagePipelineLogGroup: pipelineLogGroup,
ImageLogGroup: imageLogGroup,
})
Members
| Member | Description |
|---|---|
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. |
Referenced by
AppSyncLogConfig.retentionretentionretentionRetentionRetentionAwsCustomResourceProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionAwsLogDriverProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionBucketDeploymentProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionDatabaseClusterFromSnapshotProps.cloudwatchLogsRetentioncloudwatch_logs_retentioncloudwatchLogsRetentionCloudwatchLogsRetentionCloudwatchLogsRetentionDatabaseClusterProps.cloudwatchLogsRetentioncloudwatch_logs_retentioncloudwatchLogsRetentionCloudwatchLogsRetentionCloudwatchLogsRetentionDatabaseClusterProps.cloudwatchLogsRetentioncloudwatch_logs_retentioncloudwatchLogsRetentionCloudwatchLogsRetentionCloudwatchLogsRetentionDatabaseClusterProps.cloudWatchLogsRetentioncloud_watch_logs_retentioncloudWatchLogsRetentionCloudWatchLogsRetentionCloudWatchLogsRetentionDatabaseInstanceNewProps.cloudwatchLogsRetentioncloudwatch_logs_retentioncloudwatchLogsRetentionCloudwatchLogsRetentionCloudwatchLogsRetentionFunctionOptions.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionLambdaFunctionProviderProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionLambdaInvokeFunctionProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionLogConfig.retentionretentionretentionRetentionRetentionLogGroupProps.retentionretentionretentionRetentionRetentionLogRetentionProps.retentionretentionretentionRetentionRetentionProviderProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionSlackChannelConfigurationProps.logRetentionlog_retentionlogRetentionLogRetentionLogRetentionTrailProps.cloudWatchLogsRetentioncloud_watch_logs_retentioncloudWatchLogsRetentionCloudWatchLogsRetentionCloudWatchLogsRetention