Coder Social home page Coder Social logo

packer101's Introduction

Packer101

Getting Started with Packer using AWS_Linux Academy SandBox

It creates custom aws-ami using automation tool called packer. AWS credentials are held in Environment variable. This can be used via user and env built in functions offered by packer.

This also uses various provisioner type like shell, ansible-local, file type.

Using Shell provisioner it installs Ansible packages.

Using ansible-local provisioner it installs nginx webserver and start the service.

Using file type provisionser it copies list of files in a directory to named folder in remote ami.

Once you finish your builders, provisioners element of packer build process, you can use packer validate command to make sure that the template doesnt have any errors.

packer validate example.packer

How to create ami using this repo

Export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY of iam user account.

Make sure default vpc is running for this profile.

Use the below command to build the image.

packer build example.packer

If you want to debug each stages of packer build process use -debug option as below

packer build -debug example.packer

Once build process finished, you can verify the newly built image under AMIs section of AWS console.

You can spin up the instance using the newly built image and verify that nginx service up and running and files(filesToBeCopied dir) are copied into /tmp folder in the new instance.

License

MIT

packer101's People

Contributors

mgurusamy avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.