2

What I'm doing

I'm deploying Cloud Functions using Cloud Source Repositories as source using the gcloud command line like this:

gcloud functions deploy foo \
--region=us-east1 \
--source=<repoUrl> \
--runtime=nodejs12 \
--trigger-http

This process behinds the scene triggers Cloud Build that uses Cloud Container Registry to store its images and also creates some buckets in Cloud Storage.

Problem

The problem is one of those buckets us.artifacts.<projectName>.appspot.com that is a multi-regional storage which incurs additional charges compared to a regional storage and doesn't have a free tier to use.

The others bucket are created in the same region as the function (us-east1 in my case)

What I'd like to know

  1. If I can change the default region for this artifacts bucket
  2. Or, if it's not possible, what I can change in my deployment process to avoid these charges.

What I've already tried or read

  1. Some users had similar problems and suggested a lifecycle rule to auto-clean this bucket, also in the same post some users didn't recommend to do it because it may break the build process
  2. Here we had an answer explaining the behind the scenes of an App Engine application deployment that also creates the same bucket.
  3. This post may solve my problem but I'd need to setup Cloud Build to trigger a build after a commit in master branch.

Thanks in advance

Elton
  • 41
  • 3
  • 2
    You do realize the difference in pricing is six-tenths of a penny. For 10 GB that is $0.06. To answer your question, no you cannot change the storage class. – John Hanley Mar 11 '21 at 01:31

0 Answers0