Giter Club home page Giter Club logo

packer-golden-image-pipeline's Introduction

Overview

This repo illustrates how to create a golden image pipeline using Packer and Terraform, specifically, how to build an virtual machine image using Packer, store the metadata for it in a HCP Packer registry and then finally create a virtual machine using an image referenced from the registry:

The Packer element of the workflow largely mirrors the contents of this HashiCorp tutorial, the rest of the repo provides additional context and links the Packer element to Terraform.

The pipeline comprises of the following stages:

  1. Packer HCL file creation for golden images, these are essentially text files which specify how to create images in Packer's dialect of HashiCorp Configuration Language (HCL).

  2. Building an image via Packer and pushing its metadata to HCP Packer.

  3. As part of the packer build process, the image metadata is pushed to a HCP Packer registry.

  4. Create a Terraform configuration that references the image in the HCP Packer registry via the hcp-packer-terraform data source.

Prerequisites

Generic Prerequisites

AWS Prerequisites

  • An AWS account with credentials set as local environment variables. These credentials must have permissions to create, modify, and delete EC2 instances. Refer to the documentation to find the full list IAM permissions required to run the amazon-ebs builder.

Azure Prerequisites

  • An Azure account
  • Azure CLI installed locally

Instructions

  1. Build and push images to a HCP Packer registry by following the instructions here

  2. Once an image has been successfully pushed up to the HCP Packer registry, virtual machines can be created using these images per these instructions.

Terraform Cloud / Enterprise HCP Packer Run Task Integration

Terraform Cloud and Terraform Enterprise add further value to this solution via run task integration - this validates that the machine images in your Terraform configuration are not revoked for being insecure or outdated. Refer to this tutorial for further information on this subject.

packer-golden-image-pipeline's People

Contributors

chrisadkin8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.