Infrastructure as Code¶
Overview¶
We use terraform to manage some of our infrastructure. It lets us repeat infrastructure setup tasks without having to rely on individual developers clicking the right buttons in the right order.
Setup¶
Install terraform with the official docs
Make sure you’re authenticated to GCP for *application* usage, not just normal gcloud usage:
gcloud auth application-default login
Development¶
Just put things into main.tf
for now. You might want to check out the GCP
tutorial or the
GCP provider docs.
Run:
tf init
so you get the GCP provider. You only need to do this the first time.tf plan
to see what is going to happen.tf apply
to make changes to infrastructure.