</>
Skip to content
AWS lessons (15/47)

AWS — Elastic Beanstalk

What is Elastic Beanstalk?

PaaS for deploying and scaling web applications.

Create application

aws elasticbeanstalk create-application \
  --application-name my-app

Create environment

aws elasticbeanstalk create-environment \
  --application-name my-app \
  --environment-name my-env \
  --solution-stack-name "64bit Amazon Linux 2 v3.4.6 running Python 3.9"

Deploy

# Upload zip
aws elasticbeanstalk create-application-version \
  --application-name my-app \
  --version-label v1 \
  --source-bundle S3Bucket=my-bucket,S3Key=app.zip

# Update environment
aws elasticbeanstalk update-environment \
  --environment-name my-env \
  --version-label v1

Configuration

# Set environment variables
aws elasticbeanstalk update-environment \
  --environment-name my-env \
  --option-settings '[
    {"Namespace": "aws:elasticbeanstalk:application:environment", "OptionName": "DB_HOST", "Value": "mydb.xxx"}
  ]'

Supported platforms

  • Python
  • Node.js
  • Java
  • Go
  • Ruby
  • .NET

Best practices

  1. Use environment variables
  2. Enable enhanced health
  3. Use spot instances
  4. Set up CI/CD

Mini Practice

  1. Deploy a Python app
  2. Configure environment variables
  3. Set up SSL
  4. Enable enhanced health

Up Next

Continue with CodePipeline - CI/CD Pipeline.

Related Topics

Frequently Asked Questions about Elastic Beanstalk

What is Elastic Beanstalk in AWS?

Elastic Beanstalk is a fundamental concept in AWS. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Elastic Beanstalk?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Elastic Beanstalk.

Why is Elastic Beanstalk important in AWS?

Elastic Beanstalk is essential for AWS development. Understanding this concept will help you write better code and solve real-world problems more effectively.