Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

providers/aws: S3 bucket website support #1738

Merged
merged 13 commits into from
May 7, 2015

Conversation

justincampbell
Copy link
Contributor

  • Create/update/destroy
  • index/error document
  • Computed endpoint
  • Multi-region support
  • Docs
provider "aws" { region = "us-east-1" }

resource "aws_s3_bucket" "default" {
  bucket = "tf.justincampbel.me"
  acl = "public-read"

  website {
    index_document = "index.html"
    error_document = "error.html"
  }
}

output "dns_name" { value = "${aws_s3_bucket.default.website_endpoint}" }
// "tf.justincampbell.me.s3-website-us-east-1.amazonaws.com"

}
if err := d.Set("website_endpoint", endpoint); err != nil {
return err
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to set website_endpoint to "" if you disable website support on an existing bucket. How do I trigger other resources that depend on that attribute to be updated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd actually just add an acceptance test that includes the disable case to test this. So it'd be a test with one step that has website support and the next step that removes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in bb63f5c

@catsby
Copy link
Contributor

catsby commented Apr 29, 2015

I think a website {} block would be a better UX here. Happy to pair on this if you'd like


endpoint = fmt.Sprintf("%s.s3-website-%s.amazonaws.com", bucket, region)

return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a personal preference, but I prefer explicit returns when possible. I don't think that's a requirement, but I believe most of TF is consistent there.

@catsby
Copy link
Contributor

catsby commented May 1, 2015

Looks solid! 👍

@justincampbell
Copy link
Contributor Author

@catsby
Copy link
Contributor

catsby commented May 4, 2015

Are we OK with this PR as is, with #1769 being a separate PR?

@mitchellh
Copy link
Contributor

It looks like the Read fucntion doesn't update the website index/error document. Can we get that fixed? Other than that it looks good!

@justincampbell
Copy link
Contributor Author

@mitchellh done!

@phinze
Copy link
Contributor

phinze commented May 7, 2015

Alright this looks ready to 🚢 🙆‍♀️

phinze added a commit that referenced this pull request May 7, 2015
providers/aws: S3 bucket website support
@phinze phinze merged commit 90907c8 into hashicorp:master May 7, 2015
@justincampbell justincampbell deleted the s3-website branch May 7, 2015 00:41
@justincampbell justincampbell restored the s3-website branch May 7, 2015 14:49
@justincampbell justincampbell deleted the s3-website branch May 7, 2015 14:50
@ghost
Copy link

ghost commented May 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants