This repo has been archived. Some of the useful functions have move to: USDOT-SDC/dev-utils/resource-cleanup
Utilities to identify and delete unused AWS resources within the US DOT Secure Data Commons (SDC) ecosystem.
XIII. Credits and Acknowledgment
XIV. CODE.GOV Registration Info
January 7, 2022. SDC cleanup-worker Release 1.0
- AWS infrastructure to periodically detect and delete unused EBS volumes:
- Lambda function implementation to support removal of unused volumes
- Terraform scripts to provision EventBridge Rule, lambda function, and IAM roles and policies to support the functionality
- Clone the cleanup-worker repository into a Linux environment (e.g., SDC build machine)
- Change to the cleanup-worker folder
- Change to the unused_volumes/deploy/terraform/ folder
- cd unused_volumes/deploy/terraform/
- Execute the following commands to deploy the infrastructure:
- terraform init
- terraform apply -var-file=config/dev.tfvars
- Log on into the AWS Console for the SDC system account, navigate to the EC2 management area
- Navigate to volumes, create a stand-alone volume of 1 Gb and leave it unattached to any instance
- Wait for the EventBridge rulle to run as scheduled and verify that the volume is deleted.
- Also, examine CloudWatch logs for the dev-cleanup-worker lambda function and verify that there are entries for deleted volume
START RequestId: bb4f6eb0-abc9-4eb9-aa6c-756a1ba19f4f Version: $LATEST
[INFO] 2022-01-06T14:24:42.544Z bb4f6eb0-abc9-4eb9-aa6c-756a1ba19f4f cleanup-worker lambda started.
[INFO] 2022-01-06T14:24:45.345Z bb4f6eb0-abc9-4eb9-aa6c-756a1ba19f4f Deleting volume vol-0814f00b7c83eff90
END RequestId: bb4f6eb0-abc9-4eb9-aa6c-756a1ba19f4f
- From the unused_volumes/deploy/terraform/ folder, execute the following command:
- terraform destroy -var-file=config/dev.tfvars
January 7, 2022. SDC cleanup-worker Release 1.0
For any queries you can reach to [email protected]
Thank you to the Department of Transportation for funding to develop this project.
Agency: DOT
Short Description: The Secure Data Commons is an online data warehousing and analysis platform for transportation researchers.
Status: Production
Tags: transportation, connected vehicles, intelligent transportation systems
Labor Hours:
Contact Name: [email protected]