AWS › AWS Elastic Beanstalk

How does Elastic Beanstalk use configuration files, commonly called ebextensions, to customize the underlying environment?

Intermediate

Answer

Elastic Beanstalk lets you include a folder of configuration files, with a dot ebextensions extension, directly within your application source bundle, which can customize the underlying environment beyond the default settings, such as installing additional software packages, running custom setup commands, or modifying configuration files on the EC2 instances, all automatically applied every time the environment is created or updated.
# .ebextensions/01_packages.config
packages:
  yum:
    git: []
Real-world example A development team includes an ebextensions configuration file that automatically installs a required system package and sets a custom environment variable on every EC2 instance in their Elastic Beanstalk environment, ensuring consistent configuration across every deployment.

Common follow-ups: What is the difference between ebextensions and using a custom Amazon Machine Image?;Can ebextensions run commands only during environment creation, or also during updates?