Giter VIP home page Giter VIP logo

tfc-api-bootstrap-script's Introduction

tfc-api-bootstrap-script

Using the Terraform Enterprise/Cloud API to generate a Workspace, injecting Variables, connect VCS repository, assigning Policies, and trigger a run.

This allows a very simple Continuous Infrastructure Automation (CIA) pipeline consisting of only two components - A version control system and Terraform Cloud/Enterprise.

This enables:

  • Programmatic generation of Terraform Workspaces and Landing Zones, respectively.
  • The secure injection of secrets like cloud credentials as workspace variables (the secret-zero that enables the workflow).
  • The segregation of responsibilities in the form of CIA Pipleline Publisher (admin) and Pipeline Consumer (IaC developer).

Content of this repository:

File Description
README.md This README
tf_bootstrap_lz.sh The script that contains the TF[C/E] API abstractions
environment.conf.example Briefly documented example of an environment.conf declaration
variables.csv.example Briefly documented example of a variables.csv to be injected as workspace variables

environment.conf

to customize your specific needs in terms of workspace to be generated, VCS repo to be assigned, policies to be used, etc...

variables.csv

to assign your specific terraform and environment variables. Mark them as sensitive if needed so that nobody else will ever see them. The format is: Key,Value,terraform or environment variable,HCL true/false, sensitive true/false

Finally run the tf_bootstrap_lz.sh -b script to create or re-create your infrastructure/workload based on the IaC declaration that resides in a version control system.


Quick HowTo

a) Clone the repo on your local machine (Linux/Mac)

git clone https://github.com/joestack/tfc-api-bootstrap-script.git

b) Copy the tf_bootstrap_lz.sh script into a folder that is part of your $PATH i.e. /usr/local/bin to make the script globally available on your system. You can also skip that step and run the script directly from its local folder.

cd tfc-api-bootstrap-script
chmod 755 tf_bootstrap_lz.sh 
sudo mv tf_bootstrap_lz.sh /usr/local/bin

c) Define your specific environments.conf and variables.csv within a folder and run the script to bootstrap the environment.

tf_bootstrap_lz.sh -b

tfc-api-bootstrap-script's People

Contributors

joestack avatar mkaesz 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.