Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

GSA/datagov-infrastructure

Repository files navigation

This repo is no longer maintained. Please follow https://github.com/GSA/datagov-deploy for more information about our infrastructure plans.

datagov-infrastructure

This repo contains the Work in Progress (WIP) for Data.gov's Infrastructure as Code using Terraform. Using Jenkins, Terraform, Packer to deploy Data.gov's Production Deployment.

Repository Contents

Main directories:

  • deprecated - legacy code used for reference
  • docker - a dockerized jenkins used for testing
  • opencontrol - security documentation in the Open Control format
  • terraform - terraform is used to provision AWS infrastructure and resources, this folder contains terraform modules (reusable terraform code) to provision the VPC, Subnets, Security Groups, Route tables, etc to setup the Networking and architecture of Data.gov's production environmnet

Quick start

  1. Install Terraform.

  2. Install Terragrunt using the appropriate package for you OS. You can also install via these methods:

    • OSX - install Terragrunt on OSX using Homebrew: brew install terragrunt.
    • Linux - install Terragrunt on Linux systems using snap: snap install terragrunt.
    • Manually/Windows - install Terragrunt manually by going to the Releases Page, downloading the binary for your OS, renaming it to terragrunt, and adding it to your PATH (root directory here).
  3. Go into the terraform folder and edit the terraform.tfvars file which start with terragrunt = { ... } block that contains the main configuration for Terragrunt and variables for Terraform (check out the terragrunt section for addition types of configuration Terragrunt supports):

    terragrunt uses hashicorp hcl

    terragrunt = {
      # (put your Terragrunt configuration here)
    }
    
  4. Now, instead of running terraform directly, run all the standard Terraform commands using terragrunt:

    terragrunt get
    terragrunt plan
    terragrunt apply
    terragrunt output
    terragrunt destroy

    Terragrunt forwards almost all commands, arguments, and options directly to Terraform, using whatever version of Terraform have installed. However, based on the settings in your terraform.tfvars file, Terragrunt can configure remote state, locking, extra arguments, and lots more.

Terragrunt is a direct implementation of the ideas expressed in Terraform: Up & Running. Additional background reading that will help explain the motivation for Terragrunt includes the Gruntwork.io blog posts How to create reusable infrastructure with Terraform modules and How to use Terraform as a team.

Contributing

We're so glad you're thinking about contributing to Data.gov!

Before contributing to Data.gov we encourage you to read our CONTRIBUTING guide, our LICENSE, and our README (you are here), all of which should be in this repository. If you have any questions, you can email the Data.gov team at datagov@gsa.gov.