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.2.tar.gz (19.1 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.2-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ebdeploy-0.1.2.tar.gz
  • Upload date:
  • Size: 19.1 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.2.tar.gz
Algorithm Hash digest
SHA256 c4ca56bff8b992a6337d02ba4a91e65c9ca1ecded84a5dbe6194d37cfb7169ba
MD5 84f061d7f0a0f08a4a48c1f8bb88e076
BLAKE2b-256 a3c2f07e3c1685b101e73ec56164804854cb826dcdbc679c12b4d0e554f6fd05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ebdeploy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1622cceaf3dcc1cc856f20b2021421a34a1dafda74bd3af927d90fb5cdaefeac
MD5 027026fb6f495239ed45bb19566c2dc8
BLAKE2b-256 816d33f8bab5f8ba49000f6f634ca9c07d437854c22b3e7eee587a246df4c92d

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