rstudio / fuzzbucket

a simplified means to CRUD ephemeral user-scoped EC2 instances
MIT License
7 stars 2 forks source link

Make image alias management easier #134

Open meatballhat opened 10 months ago

meatballhat commented 10 months ago

The current image alias management implementation largely offloads the hard parts to humans or other out-of-band solutions. Compare this to how other infrastructure tooling expose search-like interfaces. An ideal interaction in fuzzbucket might look like this:

⚠️ vaporware ⚠️

fuzzbucket-client create-alias ubuntu22 'name=ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-* owner-id=099720109477'

which would store the argument as a set of filters instead of an exact ami. At box/instance creation time, the ubuntu22 alias would resolve to the most recent AMI that matches, e.g.:

name=ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*
owner-id=099720109477

would be equivalent to:

aws ec2 describe-images --filters \
  'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*' \
  'Name=owner-id,Values=099720109477'

sorting the results by .CreationDate and selecting the most recent.