Chapter 5. Deploying a Website on S3

Until now, we have seen how to manage buckets, folders, and objects and process operations on them. In this chapter, we will discuss how to deploy our static website on Amazon S3 and access it. We will consider the configuration using the AWS Management Console and the Amazon S3 Java SDK.

Website configuration using the Amazon S3 Java SDK

In previous chapters, we saw how to create a bucket and upload objects (files) to the bucket. Here, we will take a look at how we can create a new bucket, upload index.html and error.html files, and configure the website for the bucket.

To set the bucket website configuration, we have a method in Amazon S3, as follows:

s3.setBucketWebsiteConfiguration(bucketName,new BucketWebsiteConfiguration(indexHTML, ...

Get Amazon S3 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.