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
- If I can change the default region for this artifacts bucket
- 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
- 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
- Here we had an answer explaining the behind the scenes of an
App Engine
application deployment that also creates the same bucket. - 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