# CustomResourceLogRetention

Manages log retention for AWS-vended custom resources.

This feature is currently experimental.

Implements: [IAspect](/cdk/api/v2/docs/aws-cdk-lib.IAspect.html)

- Source: [`custom-resources/lib/custom-resource-config/custom-resource-config.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/custom-resources/lib/custom-resource-config/custom-resource-config.ts#L70)
- Type last changed: v2.154.0 · 22 Aug 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
import { custom_resources } from 'aws-cdk-lib';
const customResourceLogRetention = new custom_resources.CustomResourceLogRetention(logs.RetentionDays.ONE_DAY);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs
from aws_cdk import custom_resources

custom_resource_log_retention = custom_resources.CustomResourceLogRetention(logs.RetentionDays.ONE_DAY)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;
import software.amazon.awscdk.customresources.*;

CustomResourceLogRetention customResourceLogRetention = new CustomResourceLogRetention(RetentionDays.ONE_DAY);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;
using Amazon.CDK.CustomResources;

var customResourceLogRetention = new CustomResourceLogRetention(RetentionDays.ONE_DAY);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

customResourceLogRetention := awscdk.Custom_resources.NewCustomResourceLogRetention(awscdk.Aws_logs.RetentionDays_ONE_DAY)
```

## Initializer

TypeScript:

```ts
new CustomResourceLogRetention(setLogRetention: RetentionDays)
```

Python:

```python
CustomResourceLogRetention(set_log_retention: RetentionDays)
```

Java:

```java
new CustomResourceLogRetention(RetentionDays setLogRetention)
```

C# / .NET:

```csharp
new CustomResourceLogRetention(RetentionDays setLogRetention)
```

Golang:

```go
NewCustomResourceLogRetention(SetLogRetention RetentionDays)
```

## Methods

- `visit(node: IConstruct): void` — All aspects can visit an IConstruct.
