google_storage_bucket_object

Creates a new object inside an existing bucket in Google cloud storage service (GCS). ACLs can be applied using the google_storage_object_acl resource. For more information see the official documentation and API.

Example Usage

Example creating a public object in an existing image-store bucket.

resource "google_storage_bucket_object" "picture" {
  name   = "butterfly01"
  source = "/images/nature/garden-tiger-moth.jpg"
  bucket = "image-store"
}

Argument Reference

The following arguments are supported:

  • bucket - (Required) The name of the containing bucket.

  • name - (Required) The name of the object.

One of the following is required:

  • content - (Optional) Data as string to be uploaded. Must be defined if source is not.

  • source - (Optional) A path to the data you want to upload. Must be defined if content is not.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • crc32c - (Computed) Base 64 CRC32 hash of the uploaded data.

  • md5hash - (Computed) Base 64 MD5 hash of the uploaded data.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/google/r/storage_bucket_object.html