github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/google/r/storage_bucket_object.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_storage_bucket_object" 4 sidebar_current: "docs-google-storage-bucket-object" 5 description: |- 6 Creates a new object inside a specified bucket 7 --- 8 9 # google\_storage\_bucket\_object 10 11 Creates a new object inside an existing bucket in Google cloud storage service (GCS). Currently, it does not support creating custom ACLs. For more information see [the official documentation](https://cloud.google.com/storage/docs/overview) and [API](https://cloud.google.com/storage/docs/json_api). 12 13 14 ## Example Usage 15 16 Example creating a public object in an existing `image-store` bucket. 17 18 ```hcl 19 resource "google_storage_bucket_object" "picture" { 20 name = "butterfly01" 21 source = "/images/nature/garden-tiger-moth.jpg" 22 bucket = "image-store" 23 } 24 ``` 25 26 ## Argument Reference 27 28 The following arguments are supported: 29 30 * `bucket` - (Required) The name of the containing bucket. 31 32 * `name` - (Required) The name of the object. 33 34 One of the following is required: 35 36 * `content` - (Optional) Data as `string` to be uploaded. Must be defined if 37 `source` is not. 38 39 * `source` - (Optional) A path to the data you want to upload. Must be defined 40 if `content` is not. 41 42 - - - 43 44 * `cache_control` - (Optional) [Cache-Control](https://tools.ietf.org/html/rfc7234#section-5.2) 45 directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600 46 47 * `content_disposition` - (Optional) [Content-Disposition](https://tools.ietf.org/html/rfc6266) of the object data. 48 49 * `content_encoding` - (Optional) [Content-Encoding](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) of the object data. 50 51 * `content_language` - (Optional) [Content-Language](https://tools.ietf.org/html/rfc7231#section-3.1.3.2) of the object data. 52 53 * `content_type` - (Optional) [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) of the object data. Defaults to "application/octet-stream" or "text/plain; charset=utf-8". 54 55 * `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) apply. Please switch 56 to `google_storage_object_acl.predefined_acl`. 57 58 * `storage_class` - (Optional) The [StorageClass](https://cloud.google.com/storage/docs/storage-classes) of the new bucket object. 59 Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`. If not provided, this defaults to the bucket's default 60 storage class or to a [standard](https://cloud.google.com/storage/docs/storage-classes#standard) class. 61 62 ## Attributes Reference 63 64 In addition to the arguments listed above, the following computed attributes are 65 exported: 66 67 * `crc32c` - (Computed) Base 64 CRC32 hash of the uploaded data. 68 69 * `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data.