The topic of hosting static sites on AWS will be thoroughly analyzed in this text. Although the topic is not very complicated, there are still some nuances to consider.
(https://d1.awsstatic.com/Projects/build-wordpress-website/wordpress-arch-v2.f065678e8a2d45a770dc192747d49f939ccd5ac9.png)
Manual configuration involves organizing the interaction of 4-5 services which can lead to interesting challenges. An official tutorial was previously available, but it has been updated to suggest using the AWS Amplify service. However, for those who want a deeper understanding of the process, the manual setup will be discussed.
A static website is a popular choice due to its speed and security. A static site is fast because there are no dynamic scripts to slow it down, and it's secure because there are no login forms or admin panels that can be exploited.
Hosting a static website on AWS is a logical choice as it reduces worries about maintenance. AWS S3 is used to host the website, and the first step is to create an S3 bucket. The bucket's name must be globally unique, and the files to be distributed need to be synced with the bucket using the AWS CLI.
Overall, hosting a static website on AWS is a straightforward process that offers many benefits.
To prevent public access to the files, a technical domain was created by Amazon for convenience. If public access is not restricted, the files can be viewed through this domain. The domain name comprises the bucket name, S3 service name, the eu-central-1 region and the suffix for technical domains.
Before setting up public access to the website, a domain name must be chosen. The Route 53 service is used to create a new public zone, and information about NS records is obtained. These DNS servers will store information about the zone, and must be registered in the domain control panel.
A certificate management service called AWS Certificate Manager (ACM) is used to create a certificate for HTTPS access. This certificate is created for free on the us-east-1 zone and must be validated using DNS validation.
To configure CloudFront, the Origin Domain Name is set as tech-plesk-space.s3.amazonaws.com and Alternate Domain Names (CNAMEs) are specified as tech.plesk.space. The SSL Certificate is selected as Custom SSL Certificate from ACM. Finally, the Default Root Object is set as index.html to prevent a 403 error.
I have experience using both Netify and Amplify for hosting static websites. In my opinion, the services are quite similar and differ mainly in their configuration format and pricing policy. Netify offers a free plan that is suitable for simple weblogs. Transferring a static website to either of these hosting providers is a quick and easy process, regardless of the technology used to build it.
If you value mobility and minimal dependence on a particular service, then setting up your own hosting for statics may be worthwhile. However, if you already use Amazon and prioritize convenience, then it may be best to opt for a different solution. Of course, all of this is just my personal opinion.
Setting up a domain name on AWS involves a few steps. Here's a high-level overview of the process:
1. Register a Domain: First, you need to register a domain name from a domain registrar like Route 53, GoDaddy, or Google Domains. The registrar will provide you with the necessary access and control over your domain name.
2. Create a Hosted Zone: In AWS, you'll create a hosted zone in Route 53. A hosted zone is used to manage the DNS (Domain Name System) records for your domain.
3. Update DNS Records: In the hosted zone, you'll need to create various DNS records to map your domain name to the appropriate AWS resources. For example, you may create an A record to map your domain name to an IP address or a CNAME record to point it to another domain.
4. Choose a DNS Service: You have a couple of options for DNS service within Route 53. You can use either the Route 53 public DNS service or the AWS Global Accelerator, depending on your requirements.
5. Configure DNS Settings: Depending on your use case, you may need to configure additional DNS settings, such as setting up alias records, configuring subdomains, or managing mail and MX records.
6. Validate and Troubleshoot: After setting up the DNS records, you should validate the changes and ensure they propagate correctly. This may involve waiting for the DNS changes to propagate or troubleshooting any issues that arise.
It's important to note that each step involves a more detailed set of actions, and the exact steps you take will depend on your specific requirements and the services you're using within AWS.
The shift from a straightforward tutorial to a convoluted process involving S3, Route 53, and CloudFront feels like a step backward. Why complicate a process that could be streamlined with AWS Amplify?
The necessity for a globally unique bucket name and the hassle of syncing files can deter many from even trying. Plus, the reliance on DNS validation for SSL certificates is a headache.