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.4.0.tar.gz (13.5 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.4.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecs_deployer_boto3-0.4.0.tar.gz
  • Upload date:
  • Size: 13.5 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.4.0.tar.gz
Algorithm Hash digest
SHA256 706a42aabba1ad92ed52041a97a2b8abf18006914a43ba3f0a80892ca29b7199
MD5 2cb98c3b6ec46f8d07f64ff65fa5e4c7
BLAKE2b-256 242180f113a7da20431ab79f3525b12f714df1d59931be5e80565bb19801477d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ecs_deployer_boto3-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 067502d0ce96fcbab073201a3c095ecbc6ff57a9ccf16c1b48d6b5a05dd64243
MD5 da498308a8e3cf16dcc0f5bba4f8bc16
BLAKE2b-256 f1b0bd6c00ee20567b89f4e31faa144f31b06c7d6a966edbd075b0266bccc142

See more details on using hashes here.

Provenance

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