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.1.0.tar.gz (13.0 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.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecs_deployer_boto3-0.1.0.tar.gz
  • Upload date:
  • Size: 13.0 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.1.0.tar.gz
Algorithm Hash digest
SHA256 026b894f98a40607116f308fe296a0fddbe42e94e168fed676cb152aff3b494a
MD5 ed894f47a35637300eaecdd14911d428
BLAKE2b-256 606c64b5b5510eca508d9346c8ad90a5bd4a08dfb191275757353c5132165591

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ecs_deployer_boto3-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58f3f29760156db8fbf87f0cf6eaff5a76485a30bde5e7d46088c16b5693dceb
MD5 90ad3052a613afe03cf5a05fadde7ba2
BLAKE2b-256 1621ad3b61356f4fd4e2bc5a6e3484a9569379b8109e43014e8b0111dc7d3a54

See more details on using hashes here.

Provenance

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