Create and manage a Cloud Run application in terraform
-
Create a
terraform.tfvars
file with a minimum ofproject
and
domains
variables defined. -
Create the public IP address with a targeted apply.
terraform apply -target google_compute_global_address.app -out run.plan terraform apply run.plan
-
Update dns for each domain in the
domains
list to point to the created public IP. Then create the rest of the infrastructure.terraform apply
- The container must listen for requests on
0.0.0.0
. - By default, requests are sent to port
8080
. - The
PORT
env var in the runtime always contains the port used for requests.
Developer request against a service without public_access
enabled.
curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" SERVICE_URL