From 564b7e1e67eb447c13fbecf70d4480bface2c1b3 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Fri, 1 May 2015 09:48:08 -0400 Subject: [PATCH] providers/aws: Add docs for S3 website --- .../providers/aws/r/s3_bucket.html.markdown | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/website/source/docs/providers/aws/r/s3_bucket.html.markdown b/website/source/docs/providers/aws/r/s3_bucket.html.markdown index 49cee01ec..821918804 100644 --- a/website/source/docs/providers/aws/r/s3_bucket.html.markdown +++ b/website/source/docs/providers/aws/r/s3_bucket.html.markdown @@ -12,6 +12,8 @@ Provides a S3 bucket resource. ## Example Usage +### Private Bucket w/ Tags + ``` resource "aws_s3_bucket" "b" { bucket = "my_tf_test_bucket" @@ -24,6 +26,20 @@ resource "aws_s3_bucket" "b" { } ``` +### Static Website Hosting + +``` +resource "aws_s3_bucket" "b" { + bucket = "s3-website-test.hashicorp.com" + acl = "public-read" + + website { + index_document = "index.html" + error_document = "error.html" + } +} +``` + ## Argument Reference The following arguments are supported: @@ -31,10 +47,16 @@ The following arguments are supported: * `bucket` - (Required) The name of the bucket. * `acl` - (Optional) The [canned ACL](http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Defaults to "private". * `tags` - (Optional) A mapping of tags to assign to the bucket. +* `website` - (Optional) A website object (documented below). + +The website object supports the following: + +* `index_document` - (Required) Amazon S3 returns this index document when requests are made to the root domain or any of the subfolders. +* `error_document` - (Optional) An absolute path to the document to return in case of a 4XX error. ## Attributes Reference The following attributes are exported: -* `id` - The name of the bucket - +* `id` - The name of the bucket. +* `website_endpoint` - The website endpoint, if the bucket is configured with a website. If not, this will be an empty string.