github.com/markdia/terraform@v0.5.1-0.20150508012022-f1ae920aa970/website/source/docs/providers/aws/r/s3_bucket.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_s3_bucket" 4 sidebar_current: "docs-aws-resource-s3-bucket" 5 description: |- 6 Provides a S3 bucket resource. 7 --- 8 9 # aws\_s3\_bucket 10 11 Provides a S3 bucket resource. 12 13 ## Example Usage 14 15 ### Private Bucket w/ Tags 16 17 ``` 18 resource "aws_s3_bucket" "b" { 19 bucket = "my_tf_test_bucket" 20 acl = "private" 21 22 tags { 23 Name = "My bucket" 24 Environment = "Dev" 25 } 26 } 27 ``` 28 29 ### Static Website Hosting 30 31 ``` 32 resource "aws_s3_bucket" "b" { 33 bucket = "s3-website-test.hashicorp.com" 34 acl = "public-read" 35 36 website { 37 index_document = "index.html" 38 error_document = "error.html" 39 } 40 } 41 ``` 42 43 ## Argument Reference 44 45 The following arguments are supported: 46 47 * `bucket` - (Required) The name of the bucket. 48 * `acl` - (Optional) The [canned ACL](http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Defaults to "private". 49 * `tags` - (Optional) A mapping of tags to assign to the bucket. 50 * `website` - (Optional) A website object (documented below). 51 52 The website object supports the following: 53 54 * `index_document` - (Required) Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders. 55 * `error_document` - (Optional) An absolute path to the document to return in case of a 4XX error. 56 57 ## Attributes Reference 58 59 The following attributes are exported: 60 61 * `id` - The name of the bucket. 62 * `website_endpoint` - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.