Multi-cloud Template, AWS Bake
Put amazon-ebs, azure-arm, and googlecompute in one named build, validate with -only='*.amazon-ebs.*', bake AWS only, inspect the other sources, then deregister the AMI and delete its snapshot.
Lab Overview
This is the hands-on lab for Section 9 of Packer 101. You write one HCL2 template with three sources (amazon-ebs, azure-arm, googlecompute) sharing a named golden build and a shared shell provisioner. Azure and GCP sources use complete non-empty dummy Prepare() fields so Packer accepts the template without Azure or GCP account pools. You init all three plugins, validate with the HCL2 build-name glob -only='*.amazon-ebs.*', inspect the other two source blocks, bake only the AWS path with the same glob, prove the AMI, then deregister it and delete its EBS snapshot. Lab config.yml is AWS-only.
You will:
- Confirm Packer 1.16.0 and AWS credentials on the lab host
- Write multicloud-ubuntu.pkr.hcl with amazon, azure, and googlecompute
plugins and a named golden build
- Run packer init, fmt, validate -only='*.amazon-ebs.*', and inspect
- Build with -only='*.amazon-ebs.*', prove the AMI, then clean up
What You'll Learn
Confirm Packer 1.16.0 and AWS identity on the packer-host lab VM
Author one template with amazon-ebs, azure-arm, and googlecompute sources in a named build
Validate and build with -only='*.amazon-ebs.*' and never -only=amazon-ebs.ubuntu
Inspect Azure and GCP source blocks that use complete dummy Prepare() fields
Deregister the AWS AMI and delete its EBS snapshot
Prerequisites
Completion of the Packer 101 Section 9 lessons on multi-cloud templates
Prior experience baking an AWS AMI with Packer (Lab 2 or equivalent)
Basic Linux command line (bash, reading logs)
Technologies Covered
Part of a Course
This lab is part of the Packer 101 — Golden Images for AWS, Azure, and GCP course
View All CoursesChoose your plan
Simple, Transparent Pricing
Unlock full access to TeKanAid courses, labs, and bootcamps
Just exploring? Start free below. Want the full experience? Try Premium free for 7 days (card required, $0 today).
Pro
All courses, with lab scripts to run on your own machine
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Full access to all courses
- Lab scripts to download and run on your own machine (hosted labs not included)
- Progress tracking
- Certificate of completion
- Community access
- Self-paced bootcamps
- Premium puzzle library not included (5 free puzzles available)
- New content access
Premium
Full access, including unlimited hosted labs
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Everything in Pro
- Unlimited hands-on labs, fully hosted on TeKanAid Academy (nothing to set up)
- Full access to the puzzle library
- Lab AI Assistant
- Priority support
Prefer a single course?
Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.
Browse CoursesJust exploring? Start free, no account needed
Three free ways to start. All bridge into the paid Premium catalog when you're ready.
Not ready to commit? The crash course is email-only. No academy account required.
Ready to Get Started?
Start this hands-on lab and build real-world Platform Engineering skills
Get Access Now