Infrastructure as Code#
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.
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
Just put things into
main.tf for now. You might want to check out the GCP
tutorial or the
GCP provider docs.
tf initso you get the GCP provider. You only need to do this the first time.
tf planto see what is going to happen.
tf applyto make changes to infrastructure.