S3 Website Hosting Flashcards

1
Q

What is required to make an S3 bucket serve a static website?

A

To serve a static website, the S3 bucket must have public access enabled, static website hosting enabled in the bucket properties, and an index document specified. Optionally, an error document can also be defined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you secure an S3 hosted static website while still making it publicly accessible?

A

Use a bucket policy to explicitly allow public read access to the objects in the bucket, and ensure AWS Block Public Access settings are configured accordingly to allow this. Additionally, consider using CloudFront with an Origin Access Identity (OAI) for an added layer of security.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which configuration allows you to redirect requests for an S3 static website to another host?

A

Configure the ‘Redirection rules’ under the S3 bucket’s static website hosting options, or use the ‘Redirect requests’ setting to specify the hostname to which you want to redirect requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you serve a static website over HTTPS using S3 and CloudFront?

A

To serve a static website over HTTPS, place your S3 bucket behind an AWS CloudFront distribution. Configure the distribution’s SSL/TLS certificate (either a default CloudFront certificate or a custom one from AWS Certificate Manager) and set the S3 bucket as the origin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the effect of enabling server-side encryption on an S3 bucket that is hosting a static website?

A

Enabling server-side encryption (SSE) encrypts your static website’s content at rest within the S3 bucket. However, it does not affect how the content is served or accessed when it comes to static website hosting, as encryption is handled transparently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can you use Route 53 to point a domain name directly to an S3 bucket hosting a static website?

A

Yes, you can use Amazon Route 53 to point a domain name to an S3 bucket configured for static website hosting by creating an alias record that points to the S3 bucket’s website endpoint.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does S3 serve content from a static website when a specific object (like an HTML file) is requested directly by name?

A

When a specific object is requested directly by name in a URL, S3 serves that object as it is stored in the bucket, without redirecting to the index document. The ‘Content-Type’ of the response matches the object’s MIME type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What role does ‘Error document’ play in an S3 static website hosting configuration?

A

The ‘Error document’ option in an S3 static website hosting configuration specifies the web page (e.g., ‘error.html’) to return when a requested document is not found (404 error) or when an error occurs, providing a better user experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Is it possible to host a dynamic website on S3?

A

No, S3 is intended for static website hosting only. Dynamic site content that requires server-side processing (e.g., PHP, ASP.NET) is not supported directly by S3. For dynamic content, consider using services like AWS Elastic Beanstalk, Amazon EC2, or AWS Lambda with Amazon API Gateway.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe how logging is managed for an S3 static website.

A

S3 provides access logging capability for static websites. This feature, when enabled, tracks requests for access to the bucket and stores log files in a specified S3 bucket. This is useful for monitoring and analyzing access to your static site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly