This is DoSomething.org's infrastructure as code, built using Terraform. We use it to manage and provision resources in Fastly, Heroku, and AWS (EC2, RDS, SQS, S3, IAM users, amongst others). It's a work in progress.
Install Terraform 0.12. On macOS, this is easy with Homebrew:
brew install terraform
Create a Terraform.io account with your work email & ask for an invite to our organization in #dev-infrastructure. Don't forget to enable two-factor auth! Then, create a user API token and place it in your ~/.terraformrc
file, like so:
credentials "app.terraform.io" {
token = "xxxxxx.atlasv1.zzzzzzzzzzzzz"
}
Finally, configure your local environment & install dependencies:
# Install dependencies, connect to Terraform Cloud, and configure git hooks:
make init
Terraform allows us to create & modify infrastructure declaratively. You can see all your options in Terraform's provider documentation for Fastly, Heroku, and AWS (EC2, RDS, SQS, S3, IAM users, amongst others). We also have "getting started" guides for Terraform Basics & Serverless.
You can run make format
at any time to automatically format your code (or use an hclfmt plugin for your editor).
Next, make a plan to find out how it will affect the current state of the system:
make plan
Once you're satisfied with Terraform's plan, commit your work & make a pull request. After your pull request is reviewed and merged, you can then apply your change to update the actual infrastructure. Terraform Cloud will make your changes, update the remote state, and ensure nobody else makes any changes until you're done.
See Terraform's Getting Started guide & documentation for more details.
We take security very seriously. Any vulnerabilities in our infrastructure should be reported to [email protected], and will be promptly addressed. Thank you for taking the time to responsibly disclose any issues you find.
ยฉ DoSomething.org. This config is free software, and may be redistributed under the terms specified in the LICENSE file. The name and logo for DoSomething.org are trademarks of Do Something, Inc and may not be used without permission.