Skip to main content

Deploy applications to AWS ECS using boto3 and pydantic

Project description

ecs-deployer-boto3

Deploy applications to AWS ECS using boto3 and pydantic.

This library provides a thin, typed wrapper over the AWS ECS deployment API. It is decoupled from how you discover or provision your infrastructure (CloudFormation, CDK, Terraform, or by hand) — you describe your services as pydantic models and the library handles registering task definitions, creating or updating services, cleaning up old revisions, and monitoring deployments.

Supports both EC2 (with placement strategy / constraints) and Fargate (with capacity provider strategy and awsvpc network configuration).

Installation

pip install ecs-deployer-boto3

Usage

import boto3

from ecs_deployer_boto3 import (
    ApplicationUpdater,
    Container,
    DeploymentMonitor,
    Service,
    Task,
)

services = [
    Service(
        name='web',
        cluster='my-cluster',
        task_definition=Task(
            family='web',
            containers=[
                Container(
                    name='web',
                    image='123456789.dkr.ecr.us-east-1.amazonaws.com/web:latest',
                    port_mappings=[{'container_port': 8000}],
                ),
            ],
            cpu='256',
            memory='512',
            requires_compatibilities=['FARGATE'],
        ),
        launch_type='FARGATE',
        network_configuration={
            'subnets': ['subnet-abc'],
            'security_groups': ['sg-abc'],
            'assign_public_ip': 'ENABLED',
        },
    ),
]

session = boto3.Session()

updater = ApplicationUpdater(services, session)
updater.update_application(environment={'FOO': 'bar'})

monitor = DeploymentMonitor(services, session)
monitor.monitor(limit_minutes=15)

License

MIT

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

ecs_deployer_boto3-0.2.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

ecs_deployer_boto3-0.2.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file ecs_deployer_boto3-0.2.0.tar.gz.

File metadata

  • Download URL: ecs_deployer_boto3-0.2.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ecs_deployer_boto3-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7c101240468b7d1a08c24a6cd087130604c2953dbb075341b1e8d4b97ed9179a
MD5 44e044a918bf8f2a77aa26ee9f59d48d
BLAKE2b-256 6c0fae892637660aba2b5951f7b2aa81099f93ff3ee29d67d0d16dfd968a47eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecs_deployer_boto3-0.2.0.tar.gz:

Publisher: ci.yaml on ipeterov/ecs-deployer-boto3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecs_deployer_boto3-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ecs_deployer_boto3-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe32c7b663ffc6a70a73de3556af3da5c098f4ed15c9f0385728d69af589832a
MD5 d1585733c8ad71aed464f782f83f3ef1
BLAKE2b-256 841bce50a6da6e6dbc93152e976b3e32482adc81169da622f761fc8847c0c05b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecs_deployer_boto3-0.2.0-py3-none-any.whl:

Publisher: ci.yaml on ipeterov/ecs-deployer-boto3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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