Skip to content

Prepare an AWS EC2 instance for AMI generation by removing installed software agents and related config

License

Notifications You must be signed in to change notification settings

dan-farmer/amiprep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

amiprep

Prepare an AWS EC2 instance for AMI generation by removing installed software agents and related config

Usage

amiprep.sh -h
amiprep.sh [OPTIONS]

Options:

Short Option Valid Arguments Default Usage
-h Show help/usage
-t Test mode (debug/dry-run)
-d (rh|deb) Detected from /etc/os-release Override Linux distribution family detection
-a ssm,codedeploy,cfn,cloudwatch codedeploy,cfn,cloudwatch Comma-separated list of agents to remove

Warning

This will deliberately leave agents and instance configuration broken, so should only be run on a throw-away instance that is intended solely for AMI preparation.

FAQ

  1. Why is this written in shell, and not something that gives you more robust control over inputs, better arrays, etc?
    • Primarily, for minimal dependencies
    • As most operations involve control of services and removal of packages/paths, the tools to do this on the command line are readily available, with minimal hoops to jump through
    • This is not intended to be used in untrusted environments with uncontrolled inputs
    • Lastly, this script can be considered a technical exercise - though a previous incarnation has proven useful in production

About

Prepare an AWS EC2 instance for AMI generation by removing installed software agents and related config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages