I want to automate the process of creating a Google Cloud bucket. For this, I have written a script that should do it. It should make a bucket to store media in from a dotnet appliation. Without the bucket, the script works and deploys. Only if I put the bucket section in the script, it won’t work anymore.
The deploy script:
create_bucket() {
gcloud storage buckets create $BUCKET_NAME
--project "$PROJECT_ID"
--location "$ZONE"
--versioning
--logging
--transfer-protocol=HTTPS
--service-account=$SERVICE_ACCOUNT
# Update environment variable file
set_env_var "ASPNETCORE_STORAGE_BUCKET" "$BUCKET_NAME"
}
The config file:
BUCKET_NAME="phygital-bucket"
However, I always get an error that there is a problem with the parameters. It’s strange because a colleague of mine can run this script without any problems.
the error:
ERROR: (gcloud.storage.buckets.create) unrecognized arguments:
--versioning (did you mean '--verbosity'?)
--logging (did you mean '--location'?)
--transfer-protocol=HTTPS
--service-account=phygital-service-account@phygital-222256.iam.gserviceaccount.com (did you mean '--impersonate-service-account'
I tried many other things but nothing really helped. The deploy file is pretty big, because it deploys an entire dotnet application. So The way I set up the service account should be correct.
I appreciate your help!!
Quinten Willekens is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.