Skip to content

Conversation

@nogueiraanderson
Copy link
Contributor

@nogueiraanderson nogueiraanderson commented Oct 21, 2025

Summary

Automated Lambda that cleans up expired OpenShift/ROSA clusters. Runs every 15 minutes, scans for expired clusters, deletes all resources (VPC, ELB, Route53, S3, EC2).

Jira: PMM-14303

What It Does

  • Detects OpenShift/ROSA clusters via tags and master node naming
  • Checks TTL expiration (creation-time + delete-cluster-after-hours)
  • Deletes resources in dependency order
  • Supports multi-region scanning
  • DRY_RUN mode by default

Technical Details

  • Python 3.13 on ARM64, 1024MB, 600s timeout
  • CDK infrastructure as code
  • CloudWatch metrics and SNS notifications
  • 27 unit tests + integration tests

Deployment

just install && just bootstrap
just deploy                    # Deploy in DRY_RUN mode
just deploy us-east-2          # Scan specific region
AWS_REGION=us-west-1 just deploy  # Deploy Lambda to different region
just logs                      # Monitor execution

@nogueiraanderson nogueiraanderson force-pushed the feature/openshift-only-cleanup branch from 7c39314 to b9e80ab Compare October 21, 2025 23:26
- Load balancers: add ARN, type, VPC ID to logs
- Route53: log each DNS record with name, type, zone ID
- S3: log each object deletion with bucket and key

Provides complete audit trail for compliance and debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants