0

I would like to use Google's Artifact registry to keep build artifacts from Cloud Run from cloud repo commits. When I set this up by default, the registry is using the multi-region bucket storage, which leads to traffic replication charges.

I would like the Artifact registry to use a single region to avoid replication.

I found an option to restrict the locations of Artifact registry at the level of the organization, but when I'm trying to do this for a project that doesn't belong to an organization, I get:

You need to select a resource under an organisation to manage policies.

Is there a way to convince Artifact registry to use single regions when storing build artifacts from the code repository? I know how to manually upload the artifacts with docker containers, etc. to single-region Aritfact registry directories, but I'd like to use it together with the cloud build.

sygi
  • 4,557
  • 2
  • 32
  • 54
  • By setting the [location constraint](https://cloud.google.com/storage/docs/locations#setting-location-constraint) at the storage bucket level, you ensure that the Artifact Registry repository uses a single region for storing artifacts. Cloud Build will automatically push the artifacts to the repository, and the storage bucket will enforce the specified region for data storage. – Chanpols Jun 01 '23 at 20:28
  • Yes but as per the docs you can only set this while the bucket is being created, and this happens automatically for Artifact registry. Is there a way to create the bucket upfront so that it already has the right location set? – sygi Jun 01 '23 at 21:30

1 Answers1

2

You can choose a region when you create the Artifact Registry repository (or if it is created by cloud run, you can configure this in cloud run).

Restricting the locations won't change the region the Artifact Registry repository is created in, it will just give an error when attempting to create an Artifact Registry repository in the restricted region.

James
  • 451
  • 2
  • 5