github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/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). 12 [ACLs](https://cloud.google.com/storage/docs/access-control/lists) can be applied using the `google_storage_object_acl` resource. 13 For more information see 14 [the official documentation](https://cloud.google.com/storage/docs/key-terms#objects) 15 and 16 [API](https://cloud.google.com/storage/docs/json_api/v1/objects). 17 18 19 ## Example Usage 20 21 Example creating a public object in an existing `image-store` bucket. 22 23 ```hcl 24 resource "google_storage_bucket_object" "picture" { 25 name = "butterfly01" 26 source = "/images/nature/garden-tiger-moth.jpg" 27 bucket = "image-store" 28 } 29 ``` 30 31 ## Argument Reference 32 33 The following arguments are supported: 34 35 * `bucket` - (Required) The name of the containing bucket. 36 37 * `name` - (Required) The name of the object. 38 39 One of the following is required: 40 41 * `content` - (Optional) Data as `string` to be uploaded. Must be defined if 42 `source` is not. 43 44 * `source` - (Optional) A path to the data you want to upload. Must be defined 45 if `content` is not. 46 47 - - - 48 49 * `cache_control` - (Optional) [Cache-Control](https://tools.ietf.org/html/rfc7234#section-5.2) 50 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 51 52 * `content_disposition` - (Optional) [Content-Disposition](https://tools.ietf.org/html/rfc6266) of the object data. 53 54 * `content_encoding` - (Optional) [Content-Encoding](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) of the object data. 55 56 * `content_language` - (Optional) [Content-Language](https://tools.ietf.org/html/rfc7231#section-3.1.3.2) of the object data. 57 58 * `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". 59 60 * `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl) apply. Please switch 61 to `google_storage_object_acl.predefined_acl`. 62 63 * `storage_class` - (Optional) The [StorageClass](https://cloud.google.com/storage/docs/storage-classes) of the new bucket object. 64 Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`. If not provided, this defaults to the bucket's default 65 storage class or to a [standard](https://cloud.google.com/storage/docs/storage-classes#standard) class. 66 67 ## Attributes Reference 68 69 In addition to the arguments listed above, the following computed attributes are 70 exported: 71 72 * `crc32c` - (Computed) Base 64 CRC32 hash of the uploaded data. 73 74 * `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data.