Skip to main content

Deploy to AWS Elastic Beanstalk

Project description

ebdeploy

A lightweight Python library for automating deployments to AWS Elastic Beanstalk.

Installation

pip install ebdeploy
# or from source:
pip install -e .

Configuration

Run the interactive setup wizard to generate .elasticbeanstalk/ebdeploy.yml:

ebdeploy init

Or copy ebdeploy.yml.example.elasticbeanstalk/ebdeploy.yml and fill in the values:

app_name: d-sights-danone               # <project>-<client>
environment: d-sights-danone-stage      # <project>-<client>-<env>
s3_bucket: elasticbeanstalk-us-east-1-089747246458
s3_prefix: d-sights/stage/danone        # <project>/<env>/<client>
aws_region: us-east-1
aws_profile: my-aws-profile             # remove to use the default profile

All parameters can be overridden with EB_* environment variables:

Variable Config field
EB_APP_NAME app_name
EB_ENVIRONMENT environment
EB_S3_BUCKET s3_bucket
EB_S3_PREFIX s3_prefix
EB_AWS_REGION aws_region
EB_AWS_PROFILE aws_profile

.ebignore

Create a .ebignore file in your project root to exclude files from the deployment archive. Uses the same glob syntax as .gitignore:

# .ebignore
tests/
*.log
docs/
.env.local

CLI

# Interactive setup
ebdeploy init
ebdeploy init --reconfigure

# Full deploy (version = git SHA)
ebdeploy deploy

# Deploy with a custom version label
ebdeploy deploy --version v1.2.3

# Dry-run (build archive only, no AWS calls)
ebdeploy deploy --dry-run

# Show environment status
ebdeploy status

# Build archive only
ebdeploy package --output deploy.zip

# Override config via CLI flags
ebdeploy deploy --profile prod-profile --environment myapp-prod

Makefile

Add to your Makefile:

.PHONY: deploy deploy-dry status

deploy:
        ebdeploy deploy

deploy-dry:
        ebdeploy deploy --dry-run

status:
        ebdeploy status

Python API

from ebdeploy import Deployer, DeployConfig

cfg = DeployConfig.auto()          # reads ebdeploy.yml + ENV
deployer = Deployer(cfg)

# Full deploy
version = deployer.deploy()

# Dry-run
deployer.deploy(dry_run=True)

# Build archive only
deployer.package(output_path="deploy.zip")

# Environment status
info = deployer.status()
print(info["Status"], info["Health"])

How it works

git rev-parse --short HEAD  →  version label (e.g. a1b2c3d)
        │
        ▼
git archive HEAD -o deploy.zip   (or zip with all files)
        │
        ▼
aws s3 cp deploy.zip s3://<bucket>/<project>/<env>/<client>/<version>.zip
        │
        ▼
aws elasticbeanstalk create-application-version
        │
        ▼
aws elasticbeanstalk update-environment
        │
        ▼
Poll every 15s → wait for Status=Ready ✓

Tests

pip install -e ".[dev]"
pytest tests/ -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ebdeploy-0.1.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ebdeploy-0.1.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file ebdeploy-0.1.1.tar.gz.

File metadata

  • Download URL: ebdeploy-0.1.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for ebdeploy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6580ed73d097d4ab72f6bc1627b9a7b0dfd685daeb633c7f5ec42769d71ec824
MD5 b68e30f93b7b8589cd10905a5738986c
BLAKE2b-256 8fd6827ca2fbaafa264c8eb41313900d282514cc09df4b5548063ea8777209d6

See more details on using hashes here.

File details

Details for the file ebdeploy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ebdeploy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for ebdeploy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ea670d5c7949e058e65da0e97e7031db1b722a1c7a81464ec9a8595ffa1f511
MD5 cc32eff97eca81ca550e55690f5da66a
BLAKE2b-256 331dad13b58ed8f202b4e9d80cb701a715bd7a3840d3f18bc44de5b578ac9a6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page