Home

Host a Static Website using AWS S3 (Serverless Website Hosting)

Leave a comment

You can use Amazon S3 to host a static website. On a static website, individual webpages include static content. They might also contain client-side scripts.

By contrast, a dynamic website relies on server-side processing, including server-side scripts, such as PHP, JSP, or ASP.NET. Amazon S3 does not support server-side scripting, but AWS has other resources for hosting dynamic websites. To learn more about website hosting on AWS, see Web Hosting.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html

Note

You can use the AWS Amplify Console to host a single-page web app. The AWS Amplify Console supports single-page apps built with single-page app frameworks (for example, React JS, Vue JS, Angular JS, and Nuxt) and static site generators (for example, Gatsby JS, React-static, Jekyll, and Hugo). For more information, see Getting Started in the AWS Amplify Console User Guide.

Amazon S3 website endpoints do not support HTTPS. If you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3. For more information, see How do I use CloudFront to serve HTTPS requests for my Amazon S3 bucket? To use HTTPS with a custom domain, see Configuring a static website using a custom domain registered with Route 53.

Host a Static Website using AWS S3

There are several ways to host static website on S3 (Serverless website hosting)
1.) without custom DNS
like http://www.my-awesome-site.com.s3-website-us-east-1.amazonaws.com/
Enable static website hosting for your bucket

Enabling website hosting on S3 bucket

https://docs.aws.amazon.com/AmazonS3/latest/userguide/EnableWebsiteHosting.html

Tutorial: Configuring a static website on Amazon S3

https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html

2.) with custom DNS http://www.my-awesome-site.com

Tutorial: Configuring a static website using a custom domain registered with Route 53

https://docs.aws.amazon.com/AmazonS3/latest/userguide/website-hosting-custom-domain-walkthrough.html

How to Host your Static Website with AWS

https://www.freecodecamp.org/news/a-beginners-guide-on-how-to-host-a-static-site-with-aws/


with SSL https://www.my-awesome-site.com required CloudFront for SSL integration

Requiring HTTPS for communication between CloudFront and your Amazon S3 origin

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-cloudfront-to-s3-origin.html


3.) Host a static website using AWS Amplify

Host your simple marketing website or web application on AWS

https://aws.amazon.com/getting-started/hands-on/host-static-website

Note

Amazon S3 does not support HTTPS access to the website. If you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3.

For more information, see How do I use CloudFront to serve a static website hosted on Amazon S3? and Requiring HTTPS for communication between viewers and CloudFront.

Deploy a PHP/Python/NodeJS service to Google Cloud Run (GCP Platform) as Serverless

Leave a comment

Build applications or websites quickly on a fully managed platform

Run frontend and backend services, batch jobs, deploy websites and applications, and queue processing workloads without the need to manage infrastructure.

https://cloud.google.com/run?hl=en

What is Cloud Run

Cloud Run is a managed compute platform that lets you run containers directly on top of Google’s scalable infrastructure.

You can deploy code written in any programming language on Cloud Run if you can build a container image from it. In fact, building container images is optional. If you’re using Go, Node.js, Python, Java, .NET Core, or Ruby, you can use the source-based deployment option that builds the container for you, using the best practices for the language you’re using.

Google has built Cloud Run to work well together with other services on Google Cloud, so you can build full-featured applications.

In short, Cloud Run allows developers to spend their time writing their code, and very little time operating, configuring, and scaling their Cloud Run service. You don’t have to create a cluster or manage infrastructure in order to be productive with Cloud Run.

Services and jobs: two ways to run your code

On Cloud Run, your code can either run continuously as a service or as a job. Both services and jobs run in the same environment and can use the same integrations with other services on Google Cloud.

  • Cloud Run services. Used to run code that responds to web requests, or events.
  • Cloud Run jobs. Used to run code that performs work (a job) and quits when the work is done.

Cloud Run services

A Cloud Run service runs containers to serve web requests and events

https://cloud.google.com/run/docs/overview/what-is-cloud-run

Users can build their websites using a mature technology stack such as php, pythpn, NodeJS, nginx, ExpressJS, Laravel, and Django, access their SQL database on Cloud SQL and render dynamic HTML pages.

website services