In this video, Jeff Winesett demonstrates using AWS Elastic Beanstalk service to automatically create the same application architected created manually in previous videos. AWS Elastic Beanstalk automatically takes care of provisioning and configuring all
- [Instructor] Previously, I demonstrated creating a LAMP stack application from scratch. I created all of the components, including EC2 servers, ELBs, key pairs, security groups, RDS, and auto scaling. There is another approach. I could also use the Elastic Beanstalk Service which abstracts out much of this setup and eliminates the need to manually create and maintain all of these separate infrastructure components. I want to show that now in contrast to the manual approach taken before.
From the console, I can start typing in beanstalk. There it is. From this landing page, I can go up here to create new application. I need to give it a name. Demo PHP app and a brief description. Okay, I'll create that. The next step is to create an environment, and I don't have one yet, so I click create one now.
It asks me whether I want this to be a web server environment or a worker environment. I'm setting up a web server environment, so I make that choice. Now we're provided with an opportunity to configure this environment. The first choice that I make is whether I want to use a pre-configured platform or a custom platform. I want to choose one of their pre-configured ones, PHP. In this case, in the application code, I'm going to upload my own. I have these in the exercise files. It's just actually a .zip of the exact index.php that we used for the previous application we built.
There it is in the exercise files. I'll choose that, and as a reminder, this index.php file does nothing more than echo out the instance ID. So we're building the same application that we did before, just using Beanstalk. Upload that. Okay, I can move onto configuring more options. I want to make a few configuration settings to ensure that we've got the same setup that we had before. Here I'm given a host of different environment configuration settings I can choose from and other application settings.
Let's just kind of click into each and look at these. Environment settings, I don't need to make any changes there. I could use tags, so I could stick with the conventions I've been using for environment of test. I was using cost center of marketing. Just consistently using tags throughout. I can save that. Any software changes? Do not need to make any changes here.
Instances, I do not need to make any changes there, but you can see the changes that you can make. In this case, Beanstalk is going to create the PHP application for me, because that's the choice that I made earlier on. Capacity, I do want to make a change here. I do want to make sure that we're building the same application infrastructure, which had load balanced instances and I want to make sure that we keep two in place, if you remember that setting that we made for the auto scaling setting.
I could go ahead and make the explicit choice of zone A and zone B. The rest looks good. Save that. I can click into the load balancer. All of these settings look good. I do want to enable load balancing across multiple availability zones, just as we did before. The rest are the same. I'm not going to make any changes to the rolling updates and deployments at this time.
The security, I could modify that, and I could choose the same key pair to launch them within if I wanted to be able to actually access the instances behind the scene. I can save that out. Monitoring, don't need any changes there. Notifications, in the network. I can look quickly. It's going to take care of the visibility and the VPC for me.
All of this should be good. I do actually want to make a change to the database, though. In our previous application, we had an RDS instance as part of our application landscape, and I want to do the same thing here. I'll choose my SQL, as we did before. The same instance class. I'll go ahead and give it the same username and password. Again, I can choose the multi-AZ deployment, but as we did before, we just kept it in a single availability zone for cost concerns and because this is a demo, it's not for production environment.
Okay, we can save. Now I can ask it to create this environment. Now, what this is doing, is it's going through and creating all of the infrastructure and resources that we did manually. So the first ten or so videos is actually all now contained within what it's doing now. This is going to take a few minutes so I want to sit back and give this some time to complete. Okay, after it completes creating all of the resources needed for this environment, we end up with a dashboard that gives us all of the information about the recent events and an indication that everything looks good.
It also gives us a URL we can use to try to check out our new environment. So let's do that now. I can see, what I have here, is the exact same indication as I did before. If I refresh, I'm hitting two different instances. I've got two behind a load balancer, that are balancing traffic round robin, just as we did before when we did all this manually. This is great. With Elastic Beanstalk, while it's done all the creation and configuration of the resources for you, you actually do have access to the resources that have been created behind the scenes.
They're just EC2 instances, and an RDS instances, and auto scaling configurations, and such. It's done all that for you, but you can still use the console to navigate to what it created. If I want to look at the instances, I can go to EC2, and now I see it's got the custom environment instances that it created for me. I could look down here in auto scaling configurations. We see another one that's already been created for me by Beanstalk.
If I look under RDS, we'll see that we've now got two instances running, one that was created for us automatically by Beanstalk and all the other resources that Beanstalk created are available to you through the console, and you can actually access and manipulate these directly if you want. As was mentioned, while Beanstalk provides a lot of this out of the box and it does a lot of this for you, you actually don't give up that much control because you can still access all the resources behind the scenes.
One other quick thing to mention with Elastic Beanstalk, if I go back into the Beanstalk, is if I want to make a change to the application and how to redeploy. Go into Beanstalk, and once we're on this page we can look at application versions. We're already in the application demo-php-app. If we look at application versions, we see that the first version that was created is the one that I uploaded. If I want to just upload another version, I could do that right here. All I have to do is create the application version, make a change, make a ZIP file, and I can upload it and deploy here.
Pretty easy. Beanstalk takes on a lot of the manual configuration for us, and makes launching a PHP app and other supportive platform applications really simple.
- 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