2015-09-03 18:47:51 +00:00
---
layout: "google"
page_title: "Google: google_storage_bucket_object"
2015-10-23 14:10:41 +00:00
sidebar_current: "docs-google-storage-bucket-object"
2015-09-03 18:47:51 +00:00
description: |-
Creates a new object inside a specified bucket
---
# google\_storage\_bucket\_object
Creates a new object inside an exisiting 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 ).
## Example Usage
Example creating a public object in an existing `image-store` bucket.
2017-04-17 10:17:54 +00:00
```hcl
2015-09-03 18:47:51 +00:00
resource "google_storage_bucket_object" "picture" {
2016-04-10 21:34:15 +00:00
name = "butterfly01"
source = "/images/nature/garden-tiger-moth.jpg"
bucket = "image-store"
2015-09-03 18:47:51 +00:00
}
```
## Argument Reference
The following arguments are supported:
* `bucket` - (Required) The name of the containing bucket.
2015-11-12 21:20:08 +00:00
2016-04-10 21:34:15 +00:00
* `name` - (Required) The name of the object.
- - -
2015-11-12 21:20:08 +00:00
* `content` - (Optional) Data as `string` to be uploaded. Must be defined if
2016-04-10 21:34:15 +00:00
`source` is not.
2015-11-12 21:20:08 +00:00
2016-03-31 10:37:17 +00:00
* `predefined_acl` - (Optional, Deprecated) The [canned GCS ACL ](https://cloud.google.com/storage/docs/access-control#predefined-acl ) apply. Please switch
2015-09-16 18:46:46 +00:00
to `google_storage_object_acl.predefined_acl` .
2015-09-03 18:47:51 +00:00
2016-04-10 21:34:15 +00:00
* `source` - (Optional) A path to the data you want to upload. Must be defined
if `content` is not.
2015-09-03 18:47:51 +00:00
2016-04-10 21:34:15 +00:00
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are
exported:
2015-11-12 21:20:08 +00:00
2015-09-03 18:47:51 +00:00
* `crc32c` - (Computed) Base 64 CRC32 hash of the uploaded data.
2016-04-10 21:34:15 +00:00
* `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data.