Skip to content

Commit 11a275c

Browse files
authored
Update readme (#88)
* Update readme * Update README.yaml Co-Authored-By: osterman <[email protected]> * Update README.yaml Co-Authored-By: osterman <[email protected]> * Update README.yaml Co-Authored-By: osterman <[email protected]> * Update README.yaml Co-Authored-By: osterman <[email protected]> * Update readme
1 parent fecb6c0 commit 11a275c

File tree

2 files changed

+99
-3
lines changed

2 files changed

+99
-3
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# terraform-root-modules [![Build Status](https://travis-ci.org/cloudposse/terraform-root-modules.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-root-modules) [![Codefresh Build Status](https://g.codefresh.io/api/badges/build?repoOwner=cloudposse&repoName=terraform-root-modules&branch=master&pipelineName=terraform-root-modules&accountName=cloudposse&type=cf-1)](https://g.codefresh.io/pipelines/terraform-root-modules/builds) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-root-modules.svg)](https://github.com/cloudposse/terraform-root-modules/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
77

88

9-
This is a collection of reusable [Terraform root modules invocations](https://docs.cloudposse.com/terraform-modules/root/) for CloudPosse AWS accounts.
9+
This is a collection of reusable [Terraform "root modules" invocations](https://docs.cloudposse.com/terraform-modules/root/) for CloudPosse AWS accounts.
1010

1111
Terraform defines a "root module" as the current working directory holding the Terraform configuration files where the terraform apply or terraform get is run.
1212

@@ -37,6 +37,52 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE).
3737

3838

3939

40+
## Introduction
41+
42+
In this repo you'll find real-world examples of how we've implemented various common patterns using our [terraform modules](https://cpco.io/terraform-modules) for our customers.
43+
44+
The "root modules" form the module catalog of your organization. It's from this catalog that other developers in your organization will pick and choose from anytime they need to deploy some new capability.
45+
46+
Normally, a company should build up their own service catalog of terraform modules like this one, which is just a collection of terraform modules that capture the business logic, opinions, "best practices" and non-functional requirements of the organization.
47+
No two companies will ever have the same assembly of `terraform-root-modules`.
48+
49+
The root modules are the most opinionated incarnations of modules that seldom translate verbatim across organizations. This is your secret sauce. We could never implement this in a sufficiently generic way without creating crazy bloat and complexity. Therefore treat the terraform-root-modules in this repository as your “starting off point” where you hardfork/diverge.
50+
These modules are very specific to how we do things in our environment, so they might not "drop in" smoothly in other environments as they make a lot of assumptions on how things are organized.
51+
52+
A company writes their own root modules. It’s their flavor of how to leverage the [generic building blocks](https://cpco.io/terraform-modules) to achieve the specific customizations that are required without needing to write everything from the ground up because they are leveraging our general purpose modules.
53+
The idea is to write all of the [`terraform-aws-*`](https://cpco.io/terraform-modules) type modules very generically so they are easily composable inside of other modules.
54+
55+
These `terraform-root-modules` make a lot of assumptions about how we've configured our environments. That said, they can still serve as an excellent reference for others.
56+
57+
We recommend that you start with your clean `terraform-root-module` repo. Then start by creating a new project in there to describe the infrastructure that you want.
58+
59+
## Best Practices
60+
61+
* Every "root module" should include a `Makefile` that defines `init`, `plan`, and `apply` targets.
62+
This establishes a common interface for interacting with terraform without the need of a wrapper like `terragrunt`.
63+
* Never compose "root modules" inside of other root modules. If or when this is desired, then the module should be split off into a new repository and versioned independently as a standalone module.
64+
65+
## Example Makefile
66+
67+
Here's a good example of a `Makefile` for a terraform project:
68+
69+
```
70+
## Initialize terraform remote state
71+
init:
72+
[ -f .terraform/terraform.tfstate ] || init-terraform
73+
74+
## Clean up the project
75+
clean:
76+
rm -rf .terraform *.tfstate*
77+
78+
## Pass arguments through to terraform which require remote state
79+
apply console destroy graph plan output providers show: init
80+
terraform $@
81+
82+
## Pass arguments through to terraform which do not require remote state
83+
get fmt validate version:
84+
terraform $@
85+
```
4086

4187
## Usage
4288

@@ -86,6 +132,7 @@ Are you using this project or any of our other projects? Consider [leaving a tes
86132

87133
Check out these related projects.
88134

135+
- [reference-architectures](https://github.com/cloudposse/reference-architectures) - Get up and running quickly with one of our reference architecture using our fully automated cold-start process.
89136
- [audit.cloudposse.co](https://github.com/cloudposse/audit.cloudposse.co) - Example Terraform Reference Architecture of a Geodesic Module for an Audit Logs Organization in AWS.
90137
- [prod.cloudposse.co](https://github.com/cloudposse/prod.cloudposse.co) - Example Terraform Reference Architecture of a Geodesic Module for a Production Organization in AWS.
91138
- [staging.cloudposse.co](https://github.com/cloudposse/staging.cloudposse.co) - Example Terraform Reference Architecture of a Geodesic Module for a Staging Organization in AWS.
@@ -159,7 +206,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
159206

160207
## Copyright
161208

162-
Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright)
209+
Copyright © 2017-2019 [Cloud Posse, LLC](https://cpco.io/copyright)
163210

164211

165212

README.yaml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ references:
5151
url: "https://docs.cloudposse.com"
5252

5353
related:
54+
- name: "reference-architectures"
55+
description: "Get up and running quickly with one of our reference architecture using our fully automated cold-start process."
56+
url: "https://github.com/cloudposse/reference-architectures"
5457
- name: "audit.cloudposse.co"
5558
description: "Example Terraform Reference Architecture of a Geodesic Module for an Audit Logs Organization in AWS."
5659
url: "https://github.com/cloudposse/audit.cloudposse.co"
@@ -66,10 +69,56 @@ related:
6669

6770
# Short description of this project
6871
description: |-
69-
This is a collection of reusable [Terraform root modules invocations](https://docs.cloudposse.com/terraform-modules/root/) for CloudPosse AWS accounts.
72+
This is a collection of reusable [Terraform "root modules" invocations](https://docs.cloudposse.com/terraform-modules/root/) for CloudPosse AWS accounts.
7073
7174
Terraform defines a "root module" as the current working directory holding the Terraform configuration files where the terraform apply or terraform get is run.
7275
76+
introduction: |-
77+
In this repo you'll find real-world examples of how we've implemented various common patterns using our [terraform modules](https://cpco.io/terraform-modules) for our customers.
78+
79+
The "root modules" form the module catalog of your organization. It's from this catalog that other developers in your organization will pick and choose from anytime they need to deploy some new capability.
80+
81+
Normally, a company should build up their own service catalog of terraform modules like this one, which is just a collection of terraform modules that capture the business logic, opinions, "best practices" and non-functional requirements of the organization.
82+
No two companies will ever have the same assembly of `terraform-root-modules`.
83+
84+
The root modules are the most opinionated incarnations of modules that seldom translate verbatim across organizations. This is your secret sauce. We could never implement this in a sufficiently generic way without creating crazy bloat and complexity. Therefore treat the terraform-root-modules in this repository as your “starting off point” where you hardfork/diverge.
85+
These modules are very specific to how we do things in our environment, so they might not "drop in" smoothly in other environments as they make a lot of assumptions on how things are organized.
86+
87+
A company writes their own root modules. It’s their flavor of how to leverage the [generic building blocks](https://cpco.io/terraform-modules) to achieve the specific customizations that are required without needing to write everything from the ground up because they are leveraging our general purpose modules.
88+
The idea is to write all of the [`terraform-aws-*`](https://cpco.io/terraform-modules) type modules very generically so they are easily composable inside of other modules.
89+
90+
These `terraform-root-modules` make a lot of assumptions about how we've configured our environments. That said, they can still serve as an excellent reference for others.
91+
92+
We recommend that you start with your clean `terraform-root-module` repo. Then start by creating a new project in there to describe the infrastructure that you want.
93+
94+
## Best Practices
95+
96+
* Every "root module" should include a `Makefile` that defines `init`, `plan`, and `apply` targets.
97+
This establishes a common interface for interacting with terraform without the need of a wrapper like `terragrunt`.
98+
* Never compose "root modules" inside of other root modules. If or when this is desired, then the module should be split off into a new repository and versioned independently as a standalone module.
99+
100+
## Example Makefile
101+
102+
Here's a good example of a `Makefile` for a terraform project:
103+
104+
```
105+
## Initialize terraform remote state
106+
init:
107+
[ -f .terraform/terraform.tfstate ] || init-terraform
108+
109+
## Clean up the project
110+
clean:
111+
rm -rf .terraform *.tfstate*
112+
113+
## Pass arguments through to terraform which require remote state
114+
apply console destroy graph plan output providers show: init
115+
terraform $@
116+
117+
## Pass arguments through to terraform which do not require remote state
118+
get fmt validate version:
119+
terraform $@
120+
```
121+
73122
# How to use this project
74123
usage: |-
75124
Use the `terraform-root-modules` Docker image as the base image in the application `Dockerfile`, and copy the modules from `/aws` folder into `/conf` folder.

0 commit comments

Comments
 (0)