← All work

CASE STUDY 05 · Implementation

AWS EC2 Deployment & AMI Automation

Shell automation for EC2 release preparation and AMI workflows, including safer operation flags and compatibility fixes.

Scripts implementedEnd-to-end rollout pending
EC2AMIAWS CLIBashAWS CDKIAMSSM

Engineering challenge

EC2 deployment and image preparation included manual steps for instance creation, parameter handling, and AMI creation. The workflow needed more consistent execution and a reliable handoff between scripts.

Architecture & design

  • Create or identify an EC2 instance through a release script.
  • Return the instance identifier as shell environment variables for downstream image-build steps.
  • Expose dry-run, reboot, and wait behavior as explicit operator controls.

Implementation

  • Created and versioned a set of EC2 release scripts.
  • Extended instance creation to return an Instance ID for subsequent AMI steps.
  • Added `dry-run`, `no-reboot`, and `wait` options.
  • Removed reliance on Bash 4 associative arrays to keep the scripts compatible with the default Bash 3.2 on macOS.
  • Investigated KMS, EC2 DescribeInstances, IAM policy, and SSM connectivity errors.

Validation & impact

  • The scripts have version-control, syntax-check, and help-output validation records.
  • CLI usage, instance lifecycle handling, and local shell compatibility were reviewed.

Limitations & next steps

  • End-to-end AMI build, Auto Scaling rollout, target-group health check, and rollback drills are not confirmed for every service.
  • No measured deployment-time, cost, or failure-rate improvements are available.