Python needs PYTHONPATH in order to find modules in our application.In the previous step, we tried accessing our application and it returned 502 Bad Gateway. This command will open the Elastic Beanstalk console in your default browser:Īgain, you can see that the health of the environment is "Severe", which we'll fix in the next step. Your project structure should now look like this: This will take about three minutes so feel free to grab a cup of coffee.Īfter the deployment is done, the EB CLI will modify. After that, the various AWS resources will be created, like the load balancer, security and auto-scaling groups, and EC2 instances.Ī new application will be deployed as well.Your code will be zipped up and uploaded to a new S3 Bucket.With that, the environment will be spun up: We won't be using them in this tutorial, so say "no". Spot Fleet requests allow you to launch instances on-demand based on your criteria. If you want to learn about the different load balancer types, review Load balancer for your Elastic Beanstalk Environment. Load balancerĪ load balancer distributes traffic amongst your environment's instances. ![]() Your web application will be accessible at %cname%.%region%. It's considered good practice to add └-env or └-dev suffix to your environments so you can easily differentiate EB apps from environments. I'd recommend sticking with the default: "django-images-env". This represents the name of the EB environment. ![]() The directory should contain a config.yml file, with all the data you've just provided.Īgain, you'll be prompted with a few questions. Go ahead and generate one, which will be added to your "~/.ssh" folder.Īfter you answer all the questions, you'll notice a hidden directory inside your project root named ".elasticbeanstalk". To connect to EC2 instances, we'll need an RSA keypair. To connect to the EC2 instances later we need to set up SSH. We won't be using it since we're already using GitHub for source control. CodeCommitĬodeCommit is a secure, highly scalable, managed source control service that hosts private Git repositories. Pick "Python 3.8 running on 64bit Amazon Linux 2". After that, it'll give you different Python versions and Amazon Linux versions you can work with. The EB CLI will detect that you're using a Python environment. I recommend just pressing enter and going with the default: "django-images". This is the name of your Elastic Beanstalk application. Keep in mind that resource prices vary from region to region. Generally, you should pick the region that's closest to your customers. If you're not familiar with the different AWS regions, check out AWS Regions and Availability Zones. The AWS region of your Elastic Beanstalk environment (and resources). You'll be prompted with a number of questions. We'll be deploying a simple image hosting application called django-images in this tutorial.Ĭheck your understanding by deploying your own application as you follow along with the tutorial.įirst, grab the code from the repository on GitHub: These terms will be used throughout the tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |