bucket
You should be an admin/owner of your sandbox or have enougth permissions to create a bucket.
If you use a lot of accounts and specific IAM rules, you can check the permissions of the user with the following command:
gcloud projects get-iam-policy <GCP_PROJECT> --format=json | jq '.bindings[] | select(.members[] | contains("user:<YOUR@gmail.com>"))'
"role": "roles/owner"
would be great for you.
How to use the code
- Create
terraform.tfvars
file with a few variables
project = "your-gcp-project"
iam_user_email = "your@gmail.com"
region
is optional.
- Create bucket
All commands will be applied via Terraform 1.8.0 or via OpenTofu, the same version.
I use alias t
for the commands.
t init
t apply
- Destrouy bucket sfter your tests
t destroy
Requirements
Providers
Modules
Name |
Source |
Version |
bucket |
terraform-google-modules/cloud-storage/google//modules/simple_bucket |
~> 6.0 |
Resources
Inputs
Name |
Description |
Type |
Default |
Required |
iam_user_email |
Your gcloud account |
string |
"demo@gmail.com" |
no |
project |
Google Project to create resources in |
string |
"demo" |
no |
region |
The region to host the cluster in |
string |
"europe-west1" |
no |
Outputs