Amazon S3

First up is Amazon S3. This is where we store all of the static content, including the images, web pages, style sheets, JavaScript files, and any other content such as PDFs. Website hosting is a feature that you can enable in an S3 bucket, so this component replaces the need to run something such as Apache HTTPD or NGINX on web servers combined with a load balancer.

To enable static hosting, you can run this command on an existing bucket. This will enable the website hosting feature and configure S3 to load a particular HTML file for the index and error pages:

aws s3 website s3://hello-website/ 
--index-document index.html
--error-document error.html

Alternatively, you can find the options to enable website hosting in the properties of the bucket in the console. The following screenshot shows the different options to configure the index and error document locations in the console:

S3 website hosting configuration

All we need to do is indicate which file is served up by default (the index document). We also need to open up public access to the bucket and add a bucket policy.

The key to a performant web application is the content delivery network. We need to add one of these in front of our S3 bucket to enable caching at edge locations and provide extra functionality for management and routing. In AWS, the best component to use would be Amazon CloudFront, which we will cover next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.77.250