aws / aws/aws-cdk

(aws-cloudfront): Lambda at Edge Cloudwatch log groups retention

Open
#12,690 7 comments 27 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudfront effort/large feature-request feature/service-integration p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

When creating a new lambda at edge, the retention policy is ignored for all the regional loggroups created causing the loggroups to never expire

### Reproduction Steps

1. Create a lambda function:

```
const originRequestFunction = new Function(this, 'originRequestFunction', {
...
logRetention: RetentionDays.TWO_WEEKS,
});
```

2. Associate the lambda function to cloudfront:

```
lambdaFunctionAssociations: [
{
eventType: LambdaEdgeEventType.ORIGIN_REQUEST,
lambdaFunction: Version.fromVersionArn(
this,
....
}
]
```

### What did you expect to happen?

The regional loggroups (regional-cache) should follow the retention period specified in the lambda function definition

### What actually happened?

The regional loggroups don't have any expiration

### Environment

- **CDK CLI Version :** 1.60
- **Framework Version:** 1.60
- **Node.js Version:** 12.x
- **OS :** AmazonLinux
- **Language (Version):** TypeScript

---

This is :bug: Bug Report

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the TypeScript Lambda@Edge example with logRetention set to two weeks, then trace the aws-cloudfront Lambda@Edge association and its regional log-group handling. Done means the regional-cache log groups created for the edge function receive the retention period specified on the function.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.