Medium1 markMultiple Choice

GCP ACE · Question 26 · Domain 3.3: Deploying Cloud Run and Cloud Functions

You have built a Docker container image for a web application and pushed it to Google Artifact Registry. You want to deploy this image to Cloud Run so that it can receive public HTTPS traffic.

Which gcloud command should you use?

Answer options:

A.

gcloud run deploy --image [IMAGE_URL] --allow-unauthenticated

B.

gcloud compute instances create-with-container --container-image [IMAGE_URL]

C.

gcloud container run --image [IMAGE_URL] --public

D.

gcloud run start --image [IMAGE_URL]

How to approach this question

Recall the gcloud command for deploying to Cloud Run and making it public.

Full Answer

A.gcloud run deploy --image [IMAGE_URL] --allow-unauthenticated✓ Correct
gcloud run deploy --image [IMAGE_URL] --allow-unauthenticated
The `gcloud run deploy` command is used to deploy container images to Cloud Run. To ensure the service can receive public HTTPS traffic, you must use the `--allow-unauthenticated` flag, which grants the `roles/run.invoker` role to `allUsers`.

Common mistakes

Forgetting the `--allow-unauthenticated` flag, which would result in a private service requiring IAM authentication.

Practice the full GCP Associate Cloud Engineer Practice Exam 4

50 questions · hints · full answers · grading

More questions from this exam