Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 3.13 KB

File metadata and controls

85 lines (60 loc) · 3.13 KB

Packer Templates

Packer GitHub Pages MIT License Packer AWS Buy Me A Coffee

HashiCorp Packer templates for building AWS AMIs and machine images with automated provisioning.

Templates

Template Description Provider
ami-aws.json Base AWS AMI with custom provisioning AWS EBS
aws-1.json AWS machine image configuration #1 AWS EBS
aws-2.json AWS machine image configuration #2 AWS EBS
redis-ami.json Redis server AMI template AWS EBS
redis-ami-digitalocean.json Redis server image for DigitalOcean DigitalOcean

Prerequisites

  • Packer >= 1.7
  • AWS CLI configured with appropriate credentials
  • An AWS account with EC2 permissions

Quick Start

# Clone the repo
git clone https://github.com/hammadhaqqani/packer.git
cd packer

# Validate a template
packer validate ami-aws.json

# Build an AMI
packer build ami-aws.json

Project Structure

.
├── ami-aws.json                    # Base AWS AMI template
├── aws-1.json                      # AWS image config #1
├── aws-2.json                      # AWS image config #2
├── redis-ami.json                  # Redis AMI for AWS
├── redis-ami-digitalocean.json     # Redis image for DigitalOcean
├── first.sh                        # Provisioning shell script
├── welcome.txt                     # Welcome message for instances
└── .github/workflows/
    ├── packer.yml                  # CI: packer validate + fmt check
    └── pages.yml                   # GitHub Pages deployment

CI/CD

Every push runs automated validation via GitHub Actions:

  • packer fmt -check — Ensures consistent template formatting.
  • packer validate — Validates template syntax and configuration.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Author

Hammad Haqqani — DevOps Architect & Cloud Engineer


If you find this useful, consider buying me a coffee!

Buy Me A Coffee