github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/google/r/storage_bucket.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_storage_bucket" 4 sidebar_current: "docs-google-storage-bucket" 5 description: |- 6 Creates a new bucket in Google Cloud Storage. 7 --- 8 9 # google\_storage\_bucket 10 11 Creates a new bucket in Google cloud storage service (GCS). 12 Once a bucket has been created, its location can't be changed. 13 [ACLs](https://cloud.google.com/storage/docs/access-control/lists) can be applied using the `google_storage_bucket_acl` resource. 14 For more information see 15 [the official documentation](https://cloud.google.com/storage/docs/overview) 16 and 17 [API](https://cloud.google.com/storage/docs/json_api/v1/buckets). 18 19 20 ## Example Usage 21 22 Example creating a private bucket in standard storage, in the EU region. 23 24 ```hcl 25 resource "google_storage_bucket" "image-store" { 26 name = "image-store-bucket" 27 location = "EU" 28 29 website { 30 main_page_suffix = "index.html" 31 not_found_page = "404.html" 32 } 33 } 34 ``` 35 36 ## Argument Reference 37 38 The following arguments are supported: 39 40 * `name` - (Required) The name of the bucket. 41 42 - - - 43 44 * `force_destroy` - (Optional, Default: false) When deleting a bucket, this 45 boolean option will delete all contained objects. If you try to delete a 46 bucket that contains objects, Terraform will fail that run. 47 48 * `location` - (Optional, Default: 'US') The [GCS location](https://cloud.google.com/storage/docs/bucket-locations) 49 50 51 * `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) to apply. Please switch 52 to `google_storage_bucket_acl.predefined_acl`. 53 54 * `project` - (Optional) The project in which the resource belongs. If it 55 is not provided, the provider project is used. 56 57 * `storage_class` - (Optional) The [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of the new bucket. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`. 58 59 * `website` - (Optional) Configuration if the bucket acts as a website. Structure is documented below. 60 61 * `cors` - (Optional) The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below. 62 63 The `website` block supports: 64 65 * `main_page_suffix` - (Optional) Behaves as the bucket's directory index where 66 missing objects are treated as potential directories. 67 68 * `not_found_page` - (Optional) The custom object to return when a requested 69 resource is not found. 70 71 The `cors` block supports: 72 73 * `origin` - (Optional) The list of [Origins](https://tools.ietf.org/html/rfc6454) eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin". 74 75 * `method` - (Optional) The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method". 76 77 * `response_header` - (Optional) The list of HTTP headers other than the [simple response headers](https://www.w3.org/TR/cors/#simple-response-header) to give permission for the user-agent to share across domains. 78 79 * `max_age_seconds` - (Optional) The value, in seconds, to return in the [Access-Control-Max-Age header](https://www.w3.org/TR/cors/#access-control-max-age-response-header) used in preflight responses. 80 81 ## Attributes Reference 82 83 In addition to the arguments listed above, the following computed attributes are 84 exported: 85 86 * `self_link` - The URI of the created resource. 87 88 * `url` - The base URL of the bucket, in the format `gs://<bucket-name>`.