Elastic Beanstalk - seanremenyi/Notes_aws_developer GitHub Wiki

Deploy and scale web applications including the web application server pplatform Widely used application server platforms Supported languages: Java, .NET, PHP, Node.js, Python, Ruby, Go and Docker Supported platforms: Apache http server, Tomcat, Nginx, Passenger, IIS, puma Developers: Focus on writing code and don't worry about any of the underlying infrastructure needed to run your application

Infrastructure: Provisioning infrastructure, load balancing, autoscaling and application health monitoring Application Platform: Installation and management of the application stack including patching and updates to your OS and application platform You are in control: You have complete administrative control of the AWS resources. No additional charges for using Elastic Beanstalk. You are only charged for the resources deployed or it can take care of system admin: OS and appliaction server updates. Monitoring, etrics and health checks are all included. Great for developers Focus on writing code You don't need to worry about any of the underlying infrastructure needed to run the application Get your application to market faster Fastest and Simplest way to deploy your application in AWS

Updating options for deployment updates

All at once: deploys to all hosts concurrently deploys to all instance simultaneousle you will experience a total outage Not ideal for mission-critical production systems If the update fails, you need to roll back to the changes by re-deploying the original version to all your insance, resulting in another outage to get back to the previous version. Not good for production involves a service interruption (and a second if rollback is required)

Rolling: Deploys the new version in batches Deploys the new version in batches. Each batch is taken out of service while the deployment takes place Your environment capacity will be reduced by the number of instances in a batch while the deployment takes place Not ideal for performance sensitive systems rollback will again slow down performance reduced capacity during deployment

Rolling with additional Batches: Launches an additional batch of instances. Then deploys the new version in batches Launches an additional batch of instances. Deploys the new version in batches Maintains full capacity throughout the deployment If the update fails, you need to perform an additional rolling update to roll back the changes takes a while to rollback changes Maintains full capacity, rolling back takes time as requires a further rolling update

Immutable: Deploys the new version to a fresh group of instances before deleting the old instances Deploys the new version to a fresh group of instances Only when the new instances pass their health checks, should the old instances be terminated If a deployment fails, just delete the new instances little disruption to production This is the preferred approach for mission critical systems maintains full capacity

Traffic Splitting: Installs he new version on a new set of sintance like an immutable deployment but forwards a percentage of incoming client traffic to the new application version for evaluation. Enables Canary testing Installs the new version on a new set of instances julst like and immutable deployment Forwards a percentage of incoming client traffice to the new application vesion for a specified evaluation period If the new instances stays heathly. Elastic beanstalk will forwards 100% of the traffic to them and terminated the old one Like the canary in the coal mine, this provides an early indication that something is wrong

You can customize your elastic beanstalk environment using Elastic Beanstalk configuration files Configuration Define packages to install, create linkux users and groups, run shellcommands, enable services, load balancer configurations. YAML or JSON: These are files written in yaml or json format Constraints: the file must have a .config extension and be inside a folder called .ebextensions .ebextensions folder:

Location: Must be included in the top-level directory of your application source code bundle. Source Control: The configuration files can be placed under source control along with the rest of your application code myhealthcheckurl.config: ex Configures an application health check url which will be used by an Elastic load balancer. The load balancer will make an HTTP request to the specified path to check if the instances are healthy Elastic beanstalk supports 2 ways of of integrating an RDS database with your Beanstalk environment. Deploing RDS inside your Elastic Beanstalk environment or outside of it Launch within the enviironment:

Launch the RDS instance from within the ELastic Beanstalk console It is created within your elastic beanstalk environemtn If you terminate the environment, the database will also be terminated It is a good option for Dev and Test deployments, not so good for prod quick and easy Outside: Don't use elastic beanstalk to create your RDS database Instead, use the RDS console or AWS cli It allows you to tear down your application environment without affecting your database Preffered way for production

And additional security group must be added to your env Auto Scaling group youll need to provide connection string information to your application servers using elastic beanstalk environment properties