Giter Site home page Giter Site logo

golden-image-aws's Introduction

Quick Start

1- Use the Packer files tab to explore the baseline template ubuntu_base.pkr.hcl and the assigned variables in variables.pkr.hcl. Notice a couple of things about this machine image release:

  • The Ubuntu release is Bionic 18.04
  • There is no record of the AMI release

2- Use the AWS CLI to explore the available images for Ubuntu and obtain the latest OS release to use in our Packer template:

aws ec2 describe-images --owners 099720109477 \
  --filters "Name=name,Values=*minimal*hvm-ssd*focal*20*-amd64*2022*" \
  --query 'sort_by(Images, &CreationDate)[].Name' \
| jq -r '.[-1]'

2.1- Edit the file variables.pkr.hcl and replace the default value for the image_name variable with the latest Ubuntu minimal from Canonical. Your variable should look like this:

  default = "ubuntu-minimal/images/hvm-ssd/ubuntu-focal-20.04-amd64-minimal-2022*"

3- Navigate to the Packer folder and set up the environment:

packer init .
packer

3.1- Create a unique fingerprint and build the new machine image:

```bash
export HCP_PACKER_BUILD_FINGERPRINT="hashicat-demo-$(date +%s)"
packer validate .
packer build .

3.2- Confirm that we have an immage:

HASHICAT_IMAGE_ID=$( aws ec2 describe-images \
  --owners $AWS_ACCOUNT_ID \
| jq -r '.[] | .[] | .ImageId' )

echo $HASHICAT_IMAGE_ID

4- Navigate to the Terraform folder and use the $HASHICAT_IMAGE_ID as the input for the plan.

terraform init
terraform plan

4.1- Once we have a proper plan, deploy the new Web server:

terraform apply -auto-approve

golden-image-aws's People

Contributors

gcastill0 avatar

Watchers

James Cloos avatar  avatar

Forkers

bli-msdn

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.