Warning: realpath(): open_basedir restriction in effect. File(/www/wwwroot) is not within the allowed path(s): (/www/wwwroot/global.baidaodata.com/:/tmp/) in /www/wwwroot/global.baidaodata.com/wp-content/plugins/wp-file-manager/classes/backup-storage.php on line 119

Warning: realpath(): open_basedir restriction in effect. File(/www) is not within the allowed path(s): (/www/wwwroot/global.baidaodata.com/:/tmp/) in /www/wwwroot/global.baidaodata.com/wp-content/plugins/wp-file-manager/classes/backup-storage.php on line 119

Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/www/wwwroot/global.baidaodata.com/:/tmp/) in /www/wwwroot/global.baidaodata.com/wp-content/plugins/wp-file-manager/classes/backup-storage.php on line 119
bucketHow to create buckets in batches on GCP – baidaodata official web site
Baidaodata Recruitment: Operation engineers, architects, and business personnel. Please send your resume to contact@baiadoadata.com
  • +86 17727547809
  • 14th Floor, Unit 1402, Building C, Tower 1, Software Industry Base, Nanshan District, Shenzhen

Blog

bucketHow to create buckets in batches on GCP

Uncategorized

bucketHow to create buckets in batches on GCP

[Overview] Bucket is a storage component in Google Cloud Storage that provides you with data storage. It supports diverse data types, including videos, music, images, and files in various formats, greatly meeting the needs for data storage. At the same time, it is also a visual interface where you can create and delete buckets, or open files in the interface to view their contents. This is suitable for relatively small amounts of data. If the data volume is large, it is recommended to use analytical tools for a more appropriate way to open the data.
Compared with the past when everyone created them one by one manually, this article brings you a tutorial on batch creating buckets. I hope it can help those classmates who are using buckets but don’t know how to create them in batches!
[Advantages]

  1. One – click creation
  2. Plan the name of your bucket uniformly
  3. Save the time for creating one by one

【Hands-on practice】

1 First, open the console page and log in to the Google Console Shell.

2 Create a working directory

Mkdir /terraform

3 Create a file

Touch/terraform/{variables.tf,terraform.tfvars,main.tf}

4 Edit various files

(1)         Varriables.tf
variable "bucket_name_set" {    
      type        = list(string)
}
(2)         terraform.tfvars
bucket_name_set = [
           “example-bucket-name-001”,
“example-bucket-name-001”,
“example-bucket-name-001”,
]
(3)         main.tf
resource“google_storage_bucket””my_bucket_set”{
  project = “填入自己的项目名称”
       for_each= toset(var.bucket_name_set)
name = each.value
location= “region填入”
storage_class=”STANDARD”
force_destroy= true
uniform_bucket_level_access= true 
}

5 Execute the generation plan entry

Terraforminitterraformplan

6 Create

terraformapply

7 Execution results

Leave your thought here

您的邮箱地址不会被公开。 必填项已用 * 标注