An open API service indexing awesome lists of open source software.

https://github.com/sammcj/terraform-skeleton-aws

Terraform skeleton for AWS projects
https://github.com/sammcj/terraform-skeleton-aws

automation aws make terraform

Last synced: 7 months ago
JSON representation

Terraform skeleton for AWS projects

Awesome Lists containing this project

README

          

# terraform-skeleton-aws
Terraform skeleton monorepo for AWS projects

- [terraform-skeleton-aws](#terraform-skeleton-aws)
- [Projects](#projects)
- [Starting a New Project](#starting-a-new-project)
- [Create a new repo from this template](#create-a-new-repo-from-this-template)
- [Initialise the Statefile](#initialise-the-statefile)
- [Makefile](#makefile)
- [Terraform Files](#terraform-files)
- [Git Hooks](#git-hooks)
- [Requirements](#requirements)
- [Installation](#installation)
- [Run Hooks Manually](#run-hooks-manually)
- [Updating Hooks](#updating-hooks)

## Projects

- The projects directory stores the .tfvars file for each project.
- The skeleton repo contains two directories.
- The globals directory is run each time Terraform is run and contains variables that are constant across deployments.
- The template directory is an example of an individual project file.
- When you use Makefile to run the Terraform command, it will run with the global variables as well as the variables of the - defined project.
- A project as an individual instantiation of the Terraform state - It could be an environment (`development`/`staging`/`production`), accounts (`aws1`, `aws2`, etc), or even regions (`ap-southeast-2`, `us-east-1`, etc).

### Starting a New Project

#### Create a new repo from this template

This command will output the SSH URL that you can use to clone the newly created repo.

_Note: This assumes you have a Github personal access token exported to `$GITHUB_TOKEN`._

```shell
curl -s -X POST https://api.github.com/repos/sammcj/terraform-skeleton-aws/generate \
-H "Accept: application/vnd.github.baptiste-preview+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d @<(cat <