Git Product home page Git Product logo

terraform-scaffold's Introduction

Terraform Scaffold (terraform-scaffold)

Simple Terraform scaffold repo for the base of your projects.

Overview

Un-opinionated lightweight scaffolding of a basic terraform repo. Deliberately lightweight (& for the time being un-finished).

Yes there is a considerable amount more I could be doing with tf.sh & I may well add to that over the coming months. Most projects will not require additional complexity.

Usage

Bootstrap

You can get setup using an s3 bucket as backend for terraform simply with the following. Be sure to check the variables.tf defaults and override them if you like.

cd terraform/bootstrap
terraform init
terraform plan -out tfplan.out
terraform apply "tfplan.out"

Plan

dev plan >


##### Author info
David Heward
cd bin/
./tf.sh plan dev eu-west-1

prod plan >

cd bin/
./tf.sh plan prod eu-west-1

Structure

|____README.md
|____bin
| |____tf.sh (*performs orchestration of runs)
|____.gitignore
|____terraform
| |____environments
| | |____dev (*environment code - perhaps main.tf etc)
| | | |____backend.tf
| | | |____README.md
| | | |____outputs.tf
| | | |____main.tf
| | | |____variables.tf
| | |____prod
| | | |____README.md
| | | |____outputs.tf
| | | |____main.tf
| | | |____variables.tf
| |____templates (*dir for all templates)
| |____modules (*modules would be developed)
| | |____example
| | | |____README.md
| | | |____main.tf
| |____bootstrap (*bootstrap tf files, setup environment etc)
| | |____.terraform-version
| | |____s3_state_bucket.tf
| | |____provider_aws.tf
| | |____variables.tf
| |____components (*shared components - default variables, backend config etc) etc
| | |____backend.tf

To do

  • Add better examples in environments
  • Show how components can be shared to the environment workspaces
  • Allow for variables to be passed to the final terraform cmd from the bin/tf.sh wrapper
  • Improve the bin/tf.sh wrapper
    • nice args
    • var passing to underlying cmd
    • pre-flight checks
    • input validation

Author info

David Heward

terraform-scaffold's People

Contributors

davehewy 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.