In this video, Jeff Winesett demonstrates using S3 to host a static web app. Using S3 as a web hosting environment provides a method to achieve serverless front end application architecture.
- [Narrator] Now that I have demonstrated setting up all of the components to host an application using web servers and database servers in the Cloud, I'm going to show another approach. I'm going to use AWS services to accomplish the same thing without using any explicit servers at all. I'm going to host a single page web app using S3 as sort of the web server. I'm going to have that web app connect to the gateway API, which is going to invoke a Lambda function that's going to store data in a database table using DynamoDB.
This will let me achieve the same sort of application without using any servers at all. I'm going to start with the front end component of a web application and demonstrate hosting a single page web app on S3. So first of all, I go to S3 and I'm going to create a new bucket. We actually see here that a bucket is already existing. That was due to our exercise using Elastic Beanstalk where Elastic Beanstalk generated a lot of resources on our behalf, one of which was a bucket for it to use for application deployments.
Here I'm going to create a new bucket and it takes me down to Wizard. I'm going to enter a name. This has to be unique globally across the AWS landscapes, so you'll need to come up with something unique. AWS essentials. Looks like that may be enough. Select a region. I'll use the same region we've been using. US West, Oregon. There we go US West, Oregon. Click next.
Oh the bucket name already exists. Okay. Well, let me put in my last name, Winesect. That will make it unique. Now I can add tags, do some versioning and logging. I'm going to leave all this just alone for now, but here's some area where there can be some additional changes made if needed. I don't need those right now. Next set permissions. I do want anyone from the internet to be able to read information in this bucket because I'm going to use it as a public website.
So, let me choose that. Click next and create bucket. So let me click into this newly created bucket. Let me go to the properties tag. Here I can actually specify that this bucket needs to be static web hosting environment. So, I'm going to click on that. There's a couple of choices that I can make here. I want to use this bucket to host a website. That's exactly what I want to do. I want the index document to be index.html.
The error document can be what it is. I don't have an error document in the zipfile that I'll be supplying but you can supply your own error file. And that's it. That's all I need to specify in this moment. Here is the endpoint at which I'll be given to hit the website once I upload the document at index.html. There are some advanced settings down here but I don't need any of that right now. So, I'll save.
Now I just need to go back and I need to upload the app that I have. So these are also included in the exercise files. So I'm going to add files here. I've got a bundle JS and an index.html. So I can select those two and hit enter. In fact right now, I don't even need the JS file. I just need the index.html file. We'll be adding that in a little bit later. Why don't I actually just get rid of that for now? We'll just go with the index.html from the exercise files. Click next.
Again, the public permissions. I do want everybody to be able to read. Click next. All of this is fine. Review and upload. Okay, now I have an index.html file at the root of my bucket, which has been configured to be a web application. I can basically test this out if I go back in over here and remind myself of what this endpoint is. I'll click on it and sure enough, that's what I uploaded.
Right now, this form doesn't do anything yet. That's part of the rest of this exercise. I'm going to be setting up Lambda functions, an API gateway and a DynamoDB, to which this is going to interface. But for now, this shows me that I've set up a static website using S3, no servers at all, to get a basic single page web app going. The next thing I'm going to do is set up a Lambda function that's basically going to manage data in a DynamoDB table. That'll be something that I'll wire up to this form at the end, so let's do that now.
- Benefits of cloud services
- Making architectures scalable
- Examining cloud constraints
- Virtual servers, EC2, and Elastic IP
- Using the Amazon machine image
- Elastic load balancing
- Using CloudWatch for monitoring
- Security Models
- Elastic block storage
- S3, CloudFront, and Elastic Beanstalk
- Handling queues, workflows, and notifications
- Caching options and services
- Identity and access management
- Creating a custom server image
- Application deployment strategies
- Serverless architectures