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.3.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.3.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecs_deployer_boto3-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 57c38f6f79a31b8d565cd89f959a82208d7e3e02a6a198cf391f65e753d4b7d0
MD5 0c910801aa55ca706f6f05bbbf6d0235
BLAKE2b-256 9a386c4dc8c2567eeac5a03f5548b225331b02a1196d5323e42dd19258ce3ec2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecs_deployer_boto3-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ecs_deployer_boto3-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74528c74478e1e96e7b07bac0559b2a7b701ea00af3640f0c2cb1328ec24b107
MD5 dd0c417c75fcb8ef7b17c01705e46e51
BLAKE2b-256 b17fe336a9128d1a592b8ca404c70584e0f6695afbb1111df8a69b6846cef3d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecs_deployer_boto3-0.3.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