# LogRetentionProps

Construction properties for a LogRetention.

Extends: LogRetentionProps
Used as props by: LogRetention

- Source: [`aws-logs/lib/log-retention.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-logs/lib/log-retention.ts#L13)
- Type last changed: v2.37.0 · 9 Aug 2022

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';

declare const role: iam.Role;
const logRetentionProps: logs.LogRetentionProps = {
  logGroupName: 'logGroupName',
  retention: logs.RetentionDays.ONE_DAY,

  // the properties below are optional
  logGroupRegion: 'logGroupRegion',
  logRetentionRetryOptions: {
    base: cdk.Duration.minutes(30),
    maxRetries: 123,
  },
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  role: role,
};
```

## Properties

- `logGroupName`: string (required) — The log group name.

- `logGroupRegion`: string — The region where the log group should be created.

  **Default:** same region as the stack

- `logRetentionRetryOptions`: [LogRetentionRetryOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogRetentionRetryOptions.html) — Retry options for all AWS API calls.

  **Default:** AWS SDK default retry options

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.RETAIN — The removalPolicy for the log group when the stack is deleted.

- `retention`: [RetentionDays](/cdk/api/v2/docs/aws-cdk-lib.aws_logs.RetentionDays.html) (required) — The number of days log events are kept in CloudWatch Logs.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The IAM role for the Lambda function associated with the custom resource.

  **Default:** A new role is created
