1
1
# terraform-config
2
2
3
- This repository will contain all of our terraform configs as a monolithic repo .
3
+ This contains all of the Terraform bits for hosted Travis CI : cloud : .
4
4
5
5
This is what allows us to manage our cloud environments from a central place,
6
6
and change them over time. It should be possible to bring up (or re-create) a
7
- complete environment with the push of a button .
7
+ complete environment with a few ` make ` tasks .
8
8
9
9
## Status
10
10
11
- In production, with mixed adoption across infrastructures.
11
+ In production. Patches welcome. Please review the [ code of
12
+ conduct] ( ./CODE_OF_CONDUCT.md ) .
12
13
13
14
## Infrastructure
14
15
15
- Terraform manages pretty much everything that is not running on Heroku. We build
16
- images using Packer and then spin up instances in our cloud environments based
17
- on those images.
18
-
19
- We use terraform to manage our main cloud environments as well as some other
20
- services:
16
+ Terraform manages pretty much everything that is not running on Heroku, and even
17
+ a little bit of some of what is running on Heroku. We use terraform to manage
18
+ our main cloud environments as well as some other services:
21
19
22
20
* Amazon Web Services
23
21
* Google Cloud Platform
24
22
* Macstadium
25
- * (Hopefully more soon)
23
+ * OpenStack
24
+ * Packet
26
25
27
26
## Requirements
28
27
@@ -36,37 +35,35 @@ services:
36
35
## Set-up
37
36
38
37
* Clone this repo
39
- * Clone the keychain repositories
40
- * Make sure trvs is installed and added to your $PATH. (You can try
41
- running ` trvs generate-config -H travis-scheduler-prod ` to check)
42
- * Set all required environment variables (see the list below). This
43
- can be achieved by either:
44
- * Manually sourcing an .env file (like .example.env)
38
+ * Make sure ` trvs ` is installed and added to your ` $PATH ` . (You can try running
39
+ ` trvs generate-config -H travis-scheduler-prod ` to check)
40
+ * Set all required environment variables (see the list below). This can achieved
41
+ by doing something like:
42
+ * Manually sourcing an `.env` file (like `.example.env`)
45
43
* Using [autoenv](https://github.com/kennethreitz/autoenv)
46
- * Fetching them from your own pass vault
44
+ * Fetching values from your own pass vault
47
45
48
46
#### Required environment variables
49
47
50
- * TRAVIS_KEYCHAIN_DIR - should to be the parent directory of your keychain
51
- repos
52
- * GITHUB_TOKEN
53
- * GITHUB_USERNAME
54
- * AWS_ACCESS_KEY
55
- * AWS_SECRET_KEY
56
- * AWS_REGION
57
- * HEROKU_API_KEY
58
- * TF_VAR_ssh_user
59
- * SLACK_WEBHOOK (can be retrieved via ` trvs generate-config -n -f env terraform-config -p '' terraform_common ` )
48
+ * ` AWS_ACCESS_KEY `
49
+ * ` AWS_REGION `
50
+ * ` AWS_SECRET_KEY `
51
+ * ` GITHUB_TOKEN `
52
+ * ` GITHUB_USERNAME `
53
+ * ` HEROKU_API_KEY `
54
+ * ` SLACK_WEBHOOK ` (may be retrieved via ` trvs generate-config -n -f env terraform-config -p '' terraform_common ` )
55
+ * ` TF_VAR_ssh_user `
56
+ * ` TRAVIS_KEYCHAIN_DIR ` - should be the parent directory of your keychain repos
60
57
61
58
#### Notes
62
59
63
60
MacStadium & GCE access creds are shared and come from keychain, not
64
61
personal accounts, so there are no infrastructure-specific access keys
65
62
for them.
66
63
67
- $TF_VAR_ssh_user isn't needed for AWS and can just be set to $USER, if
68
- your local username and your SSH username are the same. If you have an
69
- SSH key passphrase, consider starting ` ssh-agent ` and doing ` ssh-add ` .
64
+ ` $TF_VAR_ssh_user ` isn't needed for AWS and can just be set to ` $USER ` , if your
65
+ local username and your SSH username are the same. If you have an SSH key
66
+ passphrase, consider starting ` ssh-agent ` and doing ` ssh-add ` .
70
67
71
68
See http://rabexc.org/posts/using-ssh-agent for more details.
72
69
@@ -79,17 +76,20 @@ cd ./gce-staging-1
79
76
80
77
# terraform plan, which will automatically configure terraform from remote and
81
78
# generate config files via `trvs`
82
- make clean plan
79
+ make plan
83
80
84
81
# if it looks OK, terraform apply
85
82
make apply
86
- ```
87
83
84
+ # as some configuration is generated and cached locally, changes to
85
+ # configuration sources may require cleaning before further plan/apply
86
+ make clean
87
+ ```
88
88
89
89
## Troubleshooting tips
90
90
91
91
* Running ` make check ` will verify a few common setup requirements.
92
- * Verify you have been added to both com and pro Heroku organizations.
92
+ * Verify you have been added to the relevant Heroku organizations.
93
93
* Try passing the ` -d ` flag to ` make ` to see which commands are being
94
94
run.
95
95
* this will show various curl commands (e.g. heroku) which may be
100
100
* Terraform state errors may be due to insufficient AWS permissions. See the
101
101
[ ` .example-aws-iam-policy.json ` ] ( ./.example-aws-iam-policy.json ) for example
102
102
minimum permissions.
103
+
104
+ ## License
105
+
106
+ See [ ` ./LICENSE ` ] ( ./LICENSE ) .
0 commit comments