Coder Social home page Coder Social logo

packer-terraform-pool's Introduction

Pool Starter Kit on AWS

Packer/Terraform launch configuration for mookjp/pool.

Overview

.
├── Rakefile  # Rake tasks for generate ami, pool instance with using packer/terraform
├── ami-id    # [generated file]AMI id generated by packer
├── discovery_url #[generated file]Discovery url generated by `https://discovery.etcd.io`
├── packer # packer configuration directory
│   ├── core.json.erb  
│   └── provisioners
│       └── coreos-init.sh
└── terraform # terraform configuration directory
    ├── core.tf
    ├── plan # [generated file]
    ├── terraform.tfstate # [generated file]
    └── userdata
        ├── pool-userdata.yaml # [generated_file] cloud-config for coreos
        └── pool-userdata.yaml.erb # userdata template for pool instance

Prerequisites

Tool requirements

This kit needs the following commands;

  • rake
  • Terraform
  • Packer
  • jq

If you don't have these tools, the script ./install-tools.sh may be helpful for installation.

Tasks

  • rake ami: build pool ami with packer
  • rake plan: plan terraform configuration
  • rake apply: launch pool instance (provided by terraform apply)

Configuration variable

Before execute tasks above, you must specify the variables for pool and aws environment below(see the head part of Rakefile);

@access_key = ENV['AWS_ACCESS_KEY_ID']
@secret_key = ENV['AWS_SECRET_ACCESS_KEY']
@region     = ENV['AWS_DEFAULT_REGION']
@subnet_id  = ENV['AWS_PACKER_SUBNET_ID']
@security_group_id = ENV['AWS_PACKER_SG_ID']
@packer_ssh_private_ip = ENV['PACKER_SSH_PRIVATE_IP']

@tfvars = {
  sg_id: ENV['TF_SG_ID'],
  region: ENV['TF_REGION'] || ENV['AWS_DEFAULT_REGION'],
  subnet_id: ENV['TF_SUBNET_ID'],
}

@pool = {
  max_containers:          ENV['MAX_CONTAINERS'] || 10,
  preview_repository_url:  ENV['PREVIEW_REPOSITORY_URL'] || 'http://github.com/mookjp/flaskapp.git',
  pool_base_domain:        ENV['POOL_BASE_DOMAIN'] || 'pool.dev',
  github_bot:              ENV['GITHUB_BOT'] || 'false'
}

packer-terraform-pool's People

Contributors

ainoya avatar

Stargazers

Krzysztof Wilczyński avatar

Watchers

James Cloos avatar  avatar

Forkers

jctrl

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.