{"id":5857,"library":"awsebcli","title":"AWS Elastic Beanstalk Command Line Interface (EB CLI)","description":"The AWS Elastic Beanstalk Command Line Interface (EB CLI) is an open-source tool that simplifies the deployment and management of AWS Elastic Beanstalk applications and environments directly from the command line. It provides an intuitive interface, integrates with Git, and supports all key Elastic Beanstalk operations. The current version is 3.27.1, with a frequent release cadence that often includes new region support, features, and bug fixes.","status":"active","version":"3.27.1","language":"en","source_language":"en","source_url":"https://github.com/aws/aws-elastic-beanstalk-cli","tags":["aws","cli","elastic beanstalk","deployment","cloud","devops"],"install":[{"cmd":"pip install awsebcli","lang":"bash","label":"Recommended for Python environments (use with virtualenv)"},{"cmd":"git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git\npython ./aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py","lang":"bash","label":"Recommended for dedicated virtual environment (Linux/macOS)"},{"cmd":"git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git\npython .\\aws-elastic-beanstalk-cli-setup\\scripts\\ebcli_installer.py","lang":"bash","label":"Recommended for dedicated virtual environment (Windows PowerShell/CMD)"}],"dependencies":[{"reason":"The EB CLI is a Python package; Python 3.6+ is recommended.","package":"python","optional":false},{"reason":"Required to install the Python package.","package":"pip","optional":false},{"reason":"Integral for version control features and source bundle creation; also needed if installing via the setup script.","package":"git","optional":false},{"reason":"Underlying AWS SDK for Python dependency for interacting with AWS services.","package":"botocore","optional":false},{"reason":"Used by the recommended setup script to create an isolated environment.","package":"virtualenv","optional":true}],"imports":[],"quickstart":{"code":"# 1. Create a new project directory and navigate into it\nmkdir my-hello-app\ncd my-hello-app\n\n# 2. Create a simple index.html file\necho \"Hello World\" > index.html\n\n# 3. Initialize your directory with EB CLI and configure Elastic Beanstalk\neb init\n# Follow the prompts to select region, application, platform (e.g., Python, Docker), and set up SSH.\n# You will be prompted for AWS credentials (access key ID and secret access key).\n\n# 4. Create your running environment and deploy the application\neb create\n# Follow the prompts to create an environment. This can take several minutes.\n\n# 5. Open your application in a browser once the environment is healthy\neb open\n\n# 6. Make a change to your application and deploy an update (requires Git commit)\necho \" to you!\" >> index.html\ngit init\ngit add .\ngit commit -m \"Updated message\"\neb deploy\n\n# 7. Terminate the environment when no longer needed\neb terminate","lang":"bash","description":"This quickstart guides you through initializing a new Elastic Beanstalk application, creating an environment, deploying a simple 'Hello World' web application, updating it, and finally terminating the environment. Ensure AWS credentials are configured (e.g., via `aws configure` or environment variables) before running `eb init`."},"warnings":[{"fix":"Always install `awsebcli` into a dedicated Python virtual environment (e.g., using `python -m venv .venv` then `pip install`) or use the official `aws-elastic-beanstalk-cli-setup` script, which automates virtual environment creation.","message":"Direct `pip install awsebcli` can lead to dependency conflicts with other Python packages, especially `awscli`, due to shared underlying dependencies like `botocore`. This is a common source of breakage.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure the directory containing the `eb` executable (e.g., `~/.ebcli-virtual-env/executables` or `~/Library/Python/X.Y/bin`) is added to your shell's PATH environment variable. The `ebcli_installer.py` script usually prompts you to do this.","message":"After installation, especially if not using the setup script or on specific operating systems (e.g., Linux/macOS, Git Bash on Windows), the `eb` executable might not be in your system's PATH, resulting in 'command not found' errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Configure your AWS credentials using `aws configure` (requires AWS CLI to be installed and configured), by setting environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`), or by using an IAM role if running on an EC2 instance.","message":"The EB CLI requires AWS security credentials (access key ID and secret access key) to interact with your AWS account. Operations will fail with authentication errors if not configured.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always commit your changes (`git add .`, `git commit -m \"Message\"`) before running `eb deploy` to ensure the desired application version is uploaded and correctly labeled.","message":"`eb deploy` deploys the code that is under Git source control. It uses the Git commit ID and message as the application version label and description, respectively. Changes not committed to Git will not be deployed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Manually edit the `eb.bat` and `path_exporter.bat` files (typically found in `C:\\Users\\YOUR_USERNAME\\.ebcli-virtual-env\\executables`) to wrap paths containing spaces in double quotes. For Git Bash, explicitly add the Python Scripts directory (e.g., `C:\\Users\\XXXX\\AppData\\Roaming\\Python\\Python37\\Scripts`) to your PATH.","message":"On Windows, especially with usernames containing spaces or when using Git Bash, the `eb` command might not be found or may fail due to incorrect path handling in generated `.bat` files.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}