defenseunicorns / uds-package-software-factory

Replaced by https://github.com/defenseunicorns/uds-software-factory
Apache License 2.0
8 stars 2 forks source link

Automatic periodic cleanup of CI AWS account #15

Open RothAndrew opened 1 year ago

RothAndrew commented 1 year ago

As a maintainer of UDS projects that needs to use an AWS account for CI, I want any orphaned resources to be periodically deleted, so that their CI runs do not run into LimitExceeded errors.

As the company that supports UDS projects that needs to use an AWS account for CI, we want any orphaned resources to be periodically deleted, so that we can avoid wasting money on unneeded and unused resources.

Acceptance Criteria:

  1. Apart from a pre-defined small list of IAM Users, Identity Provider, Roles, and Policies that enable usage of the account, all resources in UDS's Ephemeral CI AWS Account are automatically deleted at 2AM Eastern Time every day.
  2. The configuration file for performing the deletion action is stored in version control

Notes:

RothAndrew commented 1 year ago

A likely good option here is to use GitHub Actions as the trigger. The workflow that gets run can live in the same repo that stores the Infrastructure as Code that we use to establish the persistent resources in that account:

AFAIK that repo doesn't exist yet, but we should make one and do the above resources as IaC once we get access the UDS Ephemeral CI AWS Account. CC @Vandiver247

UncleGedd commented 1 year ago

AFAIK that repo doesn't exist yet

I think it'll be this repo, noting that there is a PR to actually populate it (cc @zachariahmiller )

UncleGedd commented 1 year ago

This all sounds good though. Running at 0400 EST on weekdays is fine as well, noting that we're hoping to do nightly (at midnight EST) runs of our EKS CI jobs

RothAndrew commented 1 year ago

Design for this issue is specified here: https://github.com/defenseunicorns/uds-aws-account-iac/issues/3

@UncleGedd please review. Once this design gets refined/reviewed/accepted, I will start implementation.

UncleGedd commented 1 year ago

Commenting here for posterity: deferring to @zachariahmiller on this one, thanks!

RothAndrew commented 1 year ago

Met up with @zachariahmiller and got a good way forward. Getting started on implementing this.

@Vandiver247 when do you anticipate the AWS account will be ready for us to start working in?