#106 Deploying to AWS Elastic Beanstalk


We’re going to get a Ruby on Rails application running on a staging environment on AWS Elastic Beanstalk. The Rails app will be connected to a MySQL database instance.
rails production deployment 11:54
  • Student & Teacher
  • $9.00 / month
  • Valid School Email Required
  • Same Access as Pro
  • Subscribe Now
  • Pro Membership
  • $15.00 / month
  • Access to Pro Episodes
  • Invite to Slack Channel
  • Priority Episode Suggestions
  • Ad Free
  • Subscribe Now
  • Teams
  • starts at $75.00 / month
  • 5 Users Minimum
  • $15.00 / user / month
  • Same Access as Pro
  • Subscribe to Teams
there are turning to ah to add a turn around and learned lessons of the village to take care of each and didn't want you to each of us being saw him being so cool head cold blooded about something you would normally have to do as far as your host the last big networking site of things and it'll disconnect and all all of that for you to where you just focus on your application and the polling at the beans up cause offers on the scaling which means that has her application grows with users they can automatically scale up based on the demand and when traffic is low or maybe at night time will scale back the servers to a specified amount so to get started you won't need a day of us account and then you in the us but to resume or you want it to be hosted in our case which is when the easy us east ohio breathing going to create a new application and the application name is going to be what are container for our application will be in this case and this chemical this example the within the application even have several different apartments you create a impairment four years staging the hills and creative are made for your production alarm or rabbit to create the environment through the web interface instead and then a download the two men my tools and do it from there will ever before we installed as the allies would ago wondered be my security credentials to get her a p i t that will user interface with the dep us who are under the access keys you wanna create a new access key and you wanna make sure that you break the stem or save them to where you would be able to access them later they're within our terminal we get tight group install a heavy u s c o line there we can all sit tight group install it in the u s a today we want to solve the elastic be installed in their within the terminal we'd had eight of us configured in this will prompt us for access key we would pay center access key eighty then also the secret access key then i'll does hit enter for the people reach in and help with format this'll created directory within our home directory called eight of us there within their it'll create the credentials while which would just have the access key eighty in his secret access key even call he be in it this one is why is the application within our specified a fireman so for someone is like the us east too which is the ohio region venison of my application and then you see that we have for example application so i just have more to select an application and i'll say that i am using really it's like they would be two point four using them all police like to know for the totem it and add you wanna set up a s s h key for this instance and in this case and is gonna call this example you might have a prom creating new tv just unafraid of us killed because there is a warm a period forty cal kid everything set up and they could take up to twenty four hours so if you do get better at that stage don't worry does give it as shy but the next day or something we cannot create a farming using p b create this will create one within our example application them just because this example staging environment this command will create the example staging environment within a debbie west than it actually op loads a copy of the application to the s three it goes through the process of actually setting up everything to deploy the application so welcome back to the screen and amenable it is completed all over now like to see what's happening on the aid of us side so if we could or dashboard if we select our example safe environment the seabed to not successfully but with the application we think award heard the logs and go to the request walks an artist record so last one hundred garments we can then download the logs that we can look at to see what actually happened that prevented him from creating or application you'll see that they can connect to the local my sequel server so we do need is set up a party yes instance or eat my sequel services while so i'll go under consideration middle school and onto the bottle been created a new party yes database i'm getting easy my sequel and then you can select whatever my single version beg your applications compatible with melodies city to micro to create a master username and then a master password that created us version you are able to use it to you tube my crew however if you are going to use like what these other ones then he will be a billboard charts within the first year then i'll click apply this can take some time to create a database and once we do that would take him back toward dashboard and we can see that it's now running a operation this is updating our environments configuration settings or not they going to lead in this episode bed is creating a security group and that's basically what's allowed access to the party yes database and all of that networking stuff that you would normally have to worry about if you're doubling your own application any private network but because we're using the bean stalk its handling all of that for us empty apartment it's finished updating with creating a video or d s and since we go back under the configuration school down to the data here with him here we can click figure this will take us to information where we can copy the thirty s. instance and this is going to be the end point that we will reference in our database i am all for see you wanna make sure they are not putting production secrets within your database him off while however in this case is because as an example i'm going to so for example name and is going to get this example underscore staging and for the username example and the password essay was example example we also need to set our port which it is the deep ball three three zero six and save the changes so back in our terminal hank med at changes that would give the player changes with the t be deployed to make sure they can make it changes because if you don't then we had a he be deployed as a quick update this changes sell the land line he be deployed the soul taker new database gilmore fall and as good as it up into a new package uploaded to ask the breed and then being stopped pull pull way down and then do we deployed over we are so expecting an error because the database has it been created yet even see them with a hundred database state to eat so we can type b b s s h and this will create as as h and says into more elastic being soft easy to concerts with a easy to instance if we go under see the flash more slash app we didn't look at the directories you'll see that we have a current and warned that so the current is war or rails out okay show will go on we reside webber we're doing a deployment it's all put into the on deck and that's where the bottle and stall and the brake guess that's what we compile will happen with it successfully double is it emergency or get into the car and so we need to go into work one better now because we haven't had as successful deployment if we look at our directory structure the seabed this looks just like the rails obligation and as big as the best selling vehicle rails d p create this should create our database you see that we ever example staging al song like eggs in l i just write you be deployed again this will couple of my application again and it's going to run through the first up would make amends if you do need to sort violent variables you think i'm under the configuration and then the software configuration i think you can create some environment variables here principle we need to create easy crate key base this is one the settings that we enter yeah more file that we get this in our secret keep pace with the new year i will take a moment for it to update the environment once everything is finished we now see that our example application has the one example staging of our meant if we click on your weekend and click on the urls to test his cell eradication loads so we could try to create a new user and all please save the user in the database that does that to leicester chasm of our other services so under these services many of the name given to the easy too which is under the computer make you see we ever want running instance and it's behind the load balancer and it's created several security groups for us within the load balancer we can go wonder are instances we can see that we have one healthy instance in its and service we get to r d s under instance as you see that we averaged one running my sequels server that to be in stock we going to example monument for several more configuration setting fake you make for this particular bottom it for example with the scaling we can said our number of instances if we want to have a minimum of two instances at any given time there we can also choose our availability zones if you select any two then i'll make sure that the two instances are reading separate areas you know so so what triggers the scaling been in this case is gonna be based on the network out over appear in a five minutes it takes these six megabytes second standard configuration we can also change what had been instances that are created for example if your application requires a bit more memory your able to set up that he too small or something else in your also able to specify the deep ball brood volume and seven or more a gigabyte you might wanna choose twenty years and the hot air whoever came to my big you want to avoid walking into your instances in making any time any old changes because that instance may not last or be around for a long time especially with all the scaling because what's gonna happen as as the honors scaling triggers get called it's gonna watch a new instances but it's also going to spend them all the ones as the alarm or trader joe's off and all their sunset you made as as a kid to make a manual change that one's going to be the first one that gets promenade and if your uses something like wow where you're able to create a c name record and maybe you would just leave a cat sign the good case in the you're out of your been stopgap know we waited at record it also do debbie debbie debbie you can add that in there as well elf we navigate to a global so calm or debbie debbie debbie doc mobile so calm watches of the application another clough flair under the crypto you can select always easy h t t p yes mrs going to do a redirect is so much was that says a cheeky the redirected to h t t p s so back on our website of the refresh the page bill seabed we directed us to h t t p s only get a ballot certificate there's a lot more to know about being in stock and eight at the us in instances in networking whoever this sub so which is china show you how to get your application from year to beaver up to date at the us and get a closer with a on the scaling group and then maybe put a asses sell a product that that's all for this episode they keep watching