aws / aws/aws-cdk

(ec2): vpc flow logs bucket destroy

Open
#21,551 10 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the bug

Unable to destroy the bucket into which VPC flow logs are directed. The bucket is never empty. The logging bucket is shared a log repository, and stores access logs from other s3 buckets as well as vpc flow logs, although under different keys.
Though the other buckets are destroyed, the vpc flow logs continue to populate the bucket, even after all other components of the stack have been deleted and the bucket delete fails, as the bucket is not empty

### Expected Behavior

VPC should suspend sending logs to the bucket once the cloud formation delete has been triggered. The bucket should then be emptied by the appropriate lambda and removed as per removal policy

### Current Behavior

bucket not deleted, stack delete fails

### Reproduction Steps

create a shared logging bucket, and attach that bucket to other s3 instances as well as VPC flow log. Cdk destroy will say bucket cannot be deleted and delete failed

### Possible Solution

a closing lambda, that empties the bucket after the vpc has been delete and then removes the vpc

### Additional Information/Context

_No response_

### CDK CLI Version

2.35

### Framework Version

_No response_

### Node.js Version

16.3.2

### OS

AMI linux 2

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Start by reproducing deletion with a shared logging bucket receiving VPC flow logs, then trace the CDK EC2/VPC flow-log and S3 bucket lifecycle entry points; done means the flow logs stop during deletion and the bucket is emptied and removed successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.