This week I will continue to explain Amazon Web Services Elastic Beanstalk configurations. In my previous Elastic Beanstalk post, I had created a basic Django application and explained the basic steps. I had also explained the usage of saved configurations. Today I will configure the infrastructure and software configurations of our application.
When we open my application on the console and click the “Configuration” tab, we can see that we have three tiers that can be configured; web, network and database. Let’s drill down each other.
If you remember, when we create our application, we have to select if it will run on a single instance or on load-balanced instances. For your development environments, you can select single instances but for production environments, it is recommended to use a load balancer. So on “Scaling” section, we manage our environment type ( single or load-balanced,auto scaling ). If you select load balanced,auto scaling, you have to select the subnets of your VPC and also you can create time-based scheduling for your autoscaling group.
On “Instances” section, we manage our instance/instances including instance type, security groups, key-pair ( if you need to connect to your instances ), instance profile ( IAM role ), Cloudwatch monitoring interval, AMI id and disk properties.
On “Notifications” section, you can enter your email address and if an events effects your application, Elastic Beanstalk can send an email to you using SNS.
On “Software Configuration” section, we can manage our virtual paths and environment parameters. Also we can enable S3 log rotation for our environment.
Here we can add, for intance, /media/ path for our django application. Also we can add add a environment property to pass to our application as a variable. For example, if I add as “Property Name: Project” and “Property Value: wekanban” , then I can use this variable in my application as below.
import os param1 = os.environ['Project']
You can read more about container configuration, using this link.
On “Updated and Deployments” section, we manage rolling updates settings. We can set minimum batch size ( how many servers will be updated with the new code ) and minimum instance count in service. Also we can manage the interval between updates and timeout settings.
On “Health Check” section, we configure to check our application’s health using a URL. We can only enable this if we configured our environment running on a load balanced configuration.
Here we manage our VPC subnet settings , enable or disable public ip address association.
This tier manages our RDS instances. We can create a new RDS instance or use an existing one.
So these settings are very easy to configure and manage. Now let’s see some monitoring and logging options.
When we jump “Logging” tab, we can request the log files about our environment. this can be either last 100 lines or full logs. I requested last 100 lines and downloaded the file. When I open it I can see all the logs about elastic beanstalk deployment and my web application including access logs.
On “Monitoring” tab, we can see the metrics for our application. Here we can add/remove metrics/graphs and create alarms for that metrics. If we click the “Edit” button near period text, we can manage the metrics and graphs.
When we click the bell icon on our graphs, we can add alarms for that metric.
You can see this alarms on “Alarms” tab. Finally, you can see the events (you can select the severity of it) about your environment on “Events” tab. We had requested the log files previously, and we can see the events related to it on events tab.
On my next post, I will talk about AWS EB command line and show how to deploy our code using eb tool. If you have any question or comment, please feel free to write and don’t forget to share please.