Newer
Older
terraform_templates / README.md

terraform_templates

Terraform templates for various resources.

Set up and running

Place main.tf and variables.tf in a directory named terraform within the project directory on the local system.

Update variable names in variables.tf

gcloud auth application-default login

terraform init
terraform apply

To destroy resources:
terraform destroy

Common to all

(I think ...)

provider "google" {
    project = var.project_id
    region = var.region
}

data "google_compute_zones" "this" {
    region = var.region
    project = var.project_id
}

locals {
    type = ["public"]
    zones = data.google_compute_zones.this.names
}

vpc_with_subnets

Creates a VPC named with one or more subnets (set count) in for .

Bucket for static files

Ref: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket