github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/aws/r/s3_bucket_object.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_s3_bucket_object" 4 sidebar_current: "docs-aws-resource-s3-bucket-object" 5 description: |- 6 Provides a S3 bucket object resource. 7 --- 8 9 # aws\_s3\_bucket\_object 10 11 Provides a S3 bucket object resource. 12 13 ## Example Usage 14 15 ### Uploading a file to a bucket 16 17 ``` 18 resource "aws_s3_bucket_object" "object" { 19 bucket = "your_bucket_name" 20 key = "new_object_key" 21 source = "path/to/file" 22 etag = "${md5(file("path/to/file"))}" 23 } 24 ``` 25 26 ## Argument Reference 27 28 The following arguments are supported: 29 30 * `bucket` - (Required) The name of the bucket to put the file in. 31 * `key` - (Required) The name of the object once it is in the bucket. 32 * `source` - (Required) The path to the source file being uploaded to the bucket. 33 * `content` - (Required unless `source` given) The literal content being uploaded to the bucket. 34 * `cache_control` - (Optional) Specifies caching behavior along the request/reply chain Read [w3c cache_control](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for futher details. 35 * `content_disposition` - (Optional) Specifies presentational information for the object. Read [wc3 content_disposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information. 36 * `content_encoding` - (Optional) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information. 37 * `content_language` - (Optional) The language the content is in e.g. en-US or en-GB. 38 * `content_type` - (Optional) A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. 39 * `etag` - (Optional) Used to trigger updates. The only meaningful value is `${md5(file("path/to/file"))}` 40 * `kms_key_id` - (Optional) Specifies the AWS KMS key ID to use for object encryption. 41 42 Either `source` or `content` must be provided to specify the bucket content. 43 These two arguments are mutually-exclusive. 44 45 ## Attributes Reference 46 47 The following attributes are exported 48 49 * `id` - the `key` of the resource supplied above 50 * `etag` - the ETag generated for the object (an MD5 sum of the object content).