Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
HashiCorp Packer in Production

You're reading from  HashiCorp Packer in Production

Product type Book
Published in Jul 2023
Publisher Packt
ISBN-13 9781803246857
Pages 190 pages
Edition 1st Edition
Languages
Author (1):
John Boero John Boero
Profile icon John Boero

Table of Contents (18) Chapters

Preface 1. Part 1: Packer’s Beginnings
2. Chapter 1: Packer Fundamentals 3. Chapter 2: Creating Your First Template 4. Chapter 3: Configuring Builders and Sources 5. Chapter 4: The Power of Provisioners 6. Chapter 5: Logging and Troubleshooting 7. Part 2: Managing Large Environments
8. Chapter 6: Working with Builders 9. Chapter 7: Building an Image Hierarchy 10. Chapter 8: Scaling Large Builds 11. Part 3: Advanced Customized Packer
12. Chapter 9: Managing the Image Lifecycle 13. Chapter 10: Using HCP Packer 14. Chapter 11: Automating Packer Builds 15. Chapter 12: Developing Packer Plugins 16. Index 17. Other Books You May Enjoy

Configuring HCP Packer in your templates

HCP Packer support is actually implemented within the plugin repositories. For the sample code in this chapter, we will use the Amazon plugin to build a family of EC2 AMIs. Be sure you have the latest versions of the plugin available, as not all features are supported by older releases. Updating your local Packer plugins for a template is simple:

$ packer init –upgrade [template/directory]

HCP credentials can and should be defined in environment variables. They can be defined in your Packer template code, but remember that defining sensitive credentials in your code is usually step one to accidentally publishing them to shared or public Git repositories and being compromised. These values can be found by checking the URL bar within HCP – for example, https://portal.cloud.hashicorp.com/orgs/11eb5efd-82bd-18c1-a21f-0242ac11070b/projects/7a4e3521-d454-4c8f-8283-2ea9f9f42b72:

export HCP_CLIENT_ID=[YOUR CLIENT]
export HCP_CLIENT_SECRET...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}