Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

Scheduled cleanup job

What is a VPC: your own private network inside one AWS Region, example ThreeTierVpc 10.0.0.0/16.

Scheduled cleanup job Apps delete old sessions and temp rows at night. A forever while-loop on one EC2 dies with the instance. EventBridge schedule (cron or rate) invokes Lambda. Lambda finds old DynamoDB items and deletes or archives them. Table with createdAt or expiresAt, Lambda role DeleteItem/Scan or Query, rule cron(0 21 * * ? *) Asia/Calcutta → target Lambda. Seed 3 old rows; wait for the r
Scheduled cleanup job · Download PNG
Read card text

What this card says

Why do we need it?

Apps delete old sessions and temp rows at night. A forever while-loop on one EC2 dies with the instance.

What is it?

EventBridge schedule (cron or rate) invokes Lambda. Lambda finds old DynamoDB items and deletes or archives them.

How to do it

Table with createdAt or expiresAt, Lambda role DeleteItem/Scan or Query, rule cron(0 21 * * ? *) Asia/Calcutta → target Lambda.

cron(0 21 * * ? *)

Example

Seed 3 old rows; wait for the rule (or run Test); rows disappear; then disable the rule before you leave.

See all AWS revision cards