When I deploy a cloud function v2 using terraform trying to specify a docker_repository, I get this error
Error: Error creating function: googleapi: Error 400: Repository name `projects/org-service-accounts-401323/locations/us/repositories/gcr.io` has an invalid format. It should match the pattern `projects/{project}/locations/{location}/repositories/{repository}`.
But the format looks correct....
Using terraform 1.9.5 and google provider 5.42.0
Here are the configs I tried
Hi @suncoast-system,
Welcome to the Google Cloud Community!
Just a heads up, Container Registry is deprecated and scheduled for shutdown on March 18, 2025. This means that gcr.io repositories hosted on Container Registry will be unavailable unless they’re migrated to Artifact Registry.
An error status 400 generally indicates a Bad Request, which may come from improper formatting or invalid parameters. Here’s a few steps I suggest that may help resolve the issue:
us.gcr.io
instead of gcr.io
If these steps didn’t work, you may create a bug on the Google Cloud issue tracker for Cloud Functions or Artifact Registry, or contact Google Cloud support.
Hope this helped!