TechWriterDev
  • Cloud
    • AWS
      • 00_Doubts
      • CloudPractitioner
        • Cloud Computing
        • AWS Global Infrastructure
        • Introduction to AWS EC2
        • Elastic load balancer(ELB)
        • 04_Messaging_Queuing
        • Aditional Computing Service
        • Accessing AWS resources
        • AWS Networking
        • Storage
        • Amazon Database Solutions
        • Monitoring Tools
        • AWS Security
        • Distributed Denial Of Service Attacks
      • DeveloperAssociate
        • References
        • AWS DVA-C02 Services Index
        • Services
          • 00_IAM
            • Identity and Access Management (IAM)
            • Account Protection Mechanisms
            • Access Mechanism of AWS Resources
            • Security Tools
            • Responsibility Model
            • Advanced Concepts
          • 01_EC2
            • Elastic Compute Cloud (EC2)
            • EC2 Volume Types
            • Amazon Machine Image (AMI)
            • AWS charges for IPv4 address
          • 02_SecurityGroups
            • Security Groups
          • 03_Elastic_LoadBalancing
            • Terminology
            • Elastic load balancer
            • Features
            • Basics
          • 04_AutoScaling
            • Auto Scaling
          • 05_RDS
            • Relational Database Service (RDS)
            • Aurora
            • Security
            • RDS Proxy
          • 06_ElastiCache
            • Cache
            • Cache Offerings
          • 07_Route53
            • Basics of DNS
            • Route 53
          • 08_VPC
            • Virtual Private Cloud (VPC)
          • 09_S3
            • Simple Storage Service (S3)
            • S3 Features
            • S3 Encryption
            • S3 Features
            • S3 Bucket Policy and IAM Policy
          • 10_ECS
            • Elastic Container Service (ECS)
            • Elastic Container Registry (ECR)
            • AWS Copilot
          • 11_EKS
            • Elastic Kubernetes Service (EKS)
          • 12_SDK_CLI_Tips
            • Access AWS Resources
          • 13_CloudFront
            • Cloud Front
          • 14_Messaging
            • Simple Queue Service (SQS)
            • Simple Notification Service (SNS)
            • Fan Out Pattern
            • Kinesis
            • Compare and Contrast
          • 15_ElasticBeanStalk
            • Elastic Beanstalk
          • 16_CloudFormation
            • CloudFormation
            • Dynamic References
          • 17_Monitoring
            • AWS Monitoring
            • AWS CloudWatch
            • CloudWatch Alarms
            • Synthetics Canary
            • Amazon EventBridge (formerly CloudWatch Events)
            • X-Ray
            • OpenTelemetry
            • CloudTrail
          • 18_Lambda
            • Lambda
            • Lambda Integrations
            • Configuring Lambda
            • Lambda Layers
          • 19_API_Gateway
            • API Gateway
            • API Gateway Integrations
          • 20_DynamoDB
            • DynamoDB
            • Operations
            • Indexes
            • DynamoDB Accelerator (DAX)
            • DynamoDB Streams
            • Transactions
            • Integrations
          • 21_CICD
            • CICD
            • CodeCommit
            • CodePipeline
            • CodeBuild
            • CodeDeploy
            • CodeArtifact
            • CloudGuru
          • 22_SAM
            • Serverless Application Model (SAM)
          • 23_CDK
            • Cloud Development Kit (CDK)
          • 24_StepFunctions
            • Step Functions
            • Types of step function
          • 25_AppSync
            • AppSync
          • 26_Amplify
            • Amplify
          • 27_STS
            • Security Token Service (STS)
          • 28_DirectoryService
            • Active Directory
          • 29_KMS
            • Encryption
            • KMS API
            • Features
            • Cloud Hardware Security Module (HSM)
          • 30_SSM_Store
            • SSM Parameter Store
          • 31_SecretsManager
            • Secrets Manager
          • 32_Cognito
            • Cognito
      • Questions
        • AWS_Region
        • EC2
        • IAM
  • Database
    • MongoDb
      • Mongo db Basics
      • Mongo DB Atlas
      • Document
      • Import-Export based on Data Format
      • Mongo Shell Commands
      • Query Operators
      • Indexes
      • Upsert
      • MongoDB Aggregation Framework
      • Aggregation Framework Operators
    • PostgreSQL
      • POSTGRE SQL DataTypes
      • About table
      • Constraints
  • Technologies
    • RabbitMQ
      • RabbitMQ Concepts
      • Introduction to Exchanges
      • Introduction to Queues
    • Terraform
      • 00_Introduction
      • Configuration blocks
      • Commands
      • Variables
      • Terraform Cloud
      • Modules
  • Languages
    • Java
      • Logging
        • Getting Started
      • 00_Core
        • 00_Basics
          • Java Vs C++
          • Object oriented principles
          • Steps to compile a java program
          • JVM Internals
          • Understanding Java Development Kit
          • What is JIT Compiler?
          • Java data types
          • 07_identifiers_type_conversion
          • 08_references_and_packages
          • Steps for attaching scanner
        • Concurrency
          • 00_Threads
            • Threads
          • 01_ExecutorFramework
            • Executor Framework
            • Asynchronous Computation
      • 01_Backend
        • 01_HttpAndWebServerBasics
          • HTTP
          • Content Type
          • Web Server
        • 02_J2EE_Basics
          • J2EE_Basics
          • Why HttpServlet classs is declared as abstract class BUT with 100 % concrete functionality ?
        • 03_TomCatAndSession
          • What is a Session?
          • WebContainer
        • 04_PageNavigation
          • Cookies Additional Information
          • Page Navigation Techniques
        • 05_AboutServlet
          • CGI v/s Servlet
          • Executor Framework
          • Servlet Life cycle
          • SERVLET CONFIG
          • Servlet Context
          • Servlet Listener (web application listener)
        • 08_SpringBoot
          • Spring Boot
          • Some common annotations used in spring eco system
        • 09_SpringDataJPA
          • Spring Data JPA
        • Java_Language_Changes
          • JDK enhancement tracking reference
        • 06_ORM_Hibernate
          • readmes
            • Hibernate
            • Advantages of Hibernate
            • Hibernate Caching
            • Hibernate API
            • Hibernate Query API
            • Hibernate Annotations and JPQL
            • Entity and Value Type
        • 07_SpringFramework
          • bean_validation
            • Bean Validation
          • core
            • readme
              • Spring
              • Spring Framework Modules
              • Spring MVC Request flow
              • Dependency Injection
              • Spring Beans
              • 06_Spring_Framework_Annotations
      • 03_Tools
        • Maven
          • Maven
  • SoftwareEngineering
    • DesignPatterns
      • Notes
        • Basics
        • OOP
        • SOLID Principles
        • 03_Creational
          • Abstract Factory (aka Kit)
          • Builder
          • Factory Method (aka Virtual constructor)
          • Prototype
          • Singleton
        • 04_Structural
          • Adapter (aka Wrapper)
          • Bridge (aka Handle | Body)
          • Composite
          • Decorator (aka Wrapper)
          • Facade
          • Flyweight
          • Proxy (aka Surrogate)
        • 05_Behavioral
          • Chain of Responsibility
          • Command (aka Action | Transaction)
          • Iterator (aka Cursor)
          • Observer (aka Publish-Subscribe | Dependents)
          • Strategy (aka Policy)
    • Principles
      • REST
        • REST
  • Tools
    • Containers
      • Docker
        • Docker
        • Docker Image
        • Commands
        • Compose
        • Best Practices
      • Kubernetes
        • Kubernetes
    • VCS
      • Git
        • Quick reference of useful Git commands
Powered by GitBook
On this page
  • Icon
  • About
  • Beanstalk components
  • Deployment modes
  • Deployment Options
  • EB CLI
  • Beanstalk Lifecycle policy
  • EB extenstions
  • Cloning
  • Migrations
  • Load balancer migration example
  • RDS migration example
  • References
  1. Cloud
  2. AWS
  3. DeveloperAssociate
  4. Services
  5. 15_ElasticBeanStalk

Elastic Beanstalk

Previous15_ElasticBeanStalkNext16_CloudFormation

Last updated 4 months ago

Icon

Elastic Beanstalk

About

  • AWS comprises over one hundred services, each of which exposes an area of functionality. While the variety of services offers flexibility for how you want to manage your AWS infrastructure, it can be challenging to figure out which services to use and how to provision them.

  • Developer need not be burden with managing all the components like ELB, ASG, EC2/ECS/EKS and other application infrastructure so as to deploy their application. With Elastic Beanstalk, one can just upload your application code and Beanstalk will manage capacity provisioning, scaling, health monitoring etc as per configuration provided in the template. This takes away the burden of infrastructure management from developers.

  • One can develop applications in variety of languages like Go, Java, .NET, Node.js, PHP, Python, and Ruby and deploy them in Beanstalk.

  • Elastic Beanstalk is free in itself and one needs to only pay for the underlying infrastructure being used.

  • Elastic Beanstalk under the hood uses CloudFormation to deploy resources.

Beanstalk components

  • Application version

    • a specific, labeled iteration of deployable code for a web application. An application version points to an Amazon Simple Storage Service (Amazon S3) object that contains the deployable code, such as a Java WAR file. An application version is part of an application. Applications can have many versions and each application version is unique.

  • Environments

    • It is a collection of AWS resources running an application version. Each environment runs only one application version at a time, however, you can run the same application version or different application versions in many environments simultaneously.

  • Enivronment tier

    • When you launch an Elastic Beanstalk environment, you first choose an environment tier. The environment tier designates the type of application that the environment runs, and determines what resources Elastic Beanstalk provisions to support it.

    • Tiers include web server environment tier, worker environment tier.

  • Platform

    • A platform is a combination of an operating system, programming language runtime, web server, application server, and Elastic Beanstalk components. You design and target your web application to a platform. Elastic Beanstalk provides a variety of platforms on which you can build your applications.

Deployment modes

  • Single instance mode, typically for development environment.

  • High availability mode, typically for production environment.

Deployment Options

Deployment Name
Extra cost
Down Time

All at once

No

Yes

Rolling update

No

No

Rolling update with additional batches

Yes

No

Immutable

Yes

No

Traffic splitting, (canary testing)

Yes

No

Blue Green (not direct option)

Yes

No

EB CLI

  • A CLI tools which enables a user to work with elastic bean stalk via command line.

Beanstalk Lifecycle policy

  • Upto 1000 application versins can be stored in an account.

  • Once the limit is reached, the Beanstalk wont be able to deploy application unless the older versions are deleted.

  • To phase out older versions of application, one can use the lifecycle mechanism.

    • Based on time deletion

    • Based on space deletion (when there are too many versions)

EB extenstions

  • .ebextensions directory located in root directory helps user to configure parameters like environment variables etc.

  • All files within the directory must be either follow YAML or Json file format and must end with extension .config.

Cloning

  • Clone an environment with exact same configuration, which is useful for deploying a test environment.

  • All resources are preserved as the source.

Migrations

Load balancer migration example

  • After creating an environment in Elastic Beanstalk, one cannot change the type of load balancer. Though configuration of existing load balancer can be changed, one cannot change type of existing load balancer from application load balancer to say another type such as network load balancer.

  • Cloning will not work here, as clone also will create existing type of load balancer in the cloned environment.

  • So one must create a separate environment with all same configuration except along with desired type of load balancer. Once done deploy your application and shift the traffic by doing a DNS update or CNAME swap.

RDS migration example

  • Typically Database lifecycle is tied to Beanstalk environment and would be deleted once environment is deleted.

  • In order to avoid deletion, one should provision RDS separately and use connection string to connect the application from with Beanstalk environment to the RDS.

  • However to migrate the existing RDS within the current Beanstalk environment to the new environment is as follows,

    • Create a snapshot of RDS database.

    • Enable delete protection on the instance from RDS console.

    • Create new Beanstalk environment without RDS and point the application to the existing RDS.

    • Now do a CNAME swap or route 53 update and test the connection.

    • Terminate the current Beanstalk environment, however the RDS wont be deleted as delete protection is enabled for it.

    • This will fail the Beanstalk deletion.

    • Go to CloudFormation service and delete the Beanstalk stack manually.

References

Refer for more info.

Commands for EB CLI can be found .

here
here
AWS Dev Guide
Deployment Strategies
.ebextension