The Terraform code located in this repository is currently unfinished and does not work.
The terraform should successfully plan, this means you will need to point it at a valid GCP account, there is no need to apply it though.
Try and format the code in a way that makes it most readable and aim to keep it consistent.
using the following pointers, get as far as you can through this exercise. Keep notes as to the decisions made and be ready to explain alternative options.
-
The
domain
variable can be replaced with anything you choose -
The code should create a Cloud Run service and associated DNS record in a GCP DNS zone pointing to the Cloud Run domain generated. We should be able to use the tfvars files in
workspaces/
to set workspace dependent settings -
Staging should create the following service:
- backend
- image: us-docker.pkg.dev/cloudrun/container/hello
- dns name: backend.staging.[domain].com
- backend
-
Production should create the following cloud run services:
- backend
- image: us-docker.pkg.dev/cloudrun/container/hello
- dns name: backend.[domain].com
- frontend
- image: us-docker.pkg.dev/cloudrun/container/hello
- dns name: frontend.[domain].com
- backend
-
Duplicate Cloud Run names and DNS record data should fail when planning