skillfed

aws-cdk.aws-ecs

The CDK Construct Library for AWS::ECS

aws-cdk-aws-ecs v1.204.0 147.1K downloads/30d#11,080 on PyPI12,868
Permissive license Apache-2.0 Active released

What it is and what it does

This package is the AWS CDK v1 construct library for Amazon ECS, providing high-level Python abstractions to define container clusters, task definitions, and services. It supports three launch modes: EC2 instances under your control, AWS Fargate for fully managed tasks, and ECS Anywhere for self-managed infrastructure. You use it to declare ECS infrastructure as code within a CDK application, specifying cluster capacity, container images, memory and CPU limits, networking modes, and load balancer attachments.

The library handles the underlying CloudFormation generation and integrates with other AWS CDK modules (EC2, IAM, CloudWatch, load balancers, service discovery, and more) to build complete container deployments. However, AWS CDK v1 reached end-of-support on 2023-06-01 and is no longer receiving updates—the project recommends migrating to AWS CDK v2 for new work.

Use it for:

  • Define an ECS cluster with EC2 capacity and deploy containerized services using infrastructure-as-code.
  • Create Fargate task definitions and services for serverless container workloads without managing EC2 instances.
  • Set up ECS Anywhere tasks to run containers on self-managed infrastructure while using AWS ECS orchestration.
  • Integrate container deployments with load balancers, auto-scaling, and CloudWatch monitoring in a single CDK stack.
  • Import and reference existing ECS clusters by ARN to add new services or update capacity programmatically.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides AWS CDK constructs for defining and managing Amazon ECS clusters, task definitions, and services across EC2, Fargate, and ECS Anywhere launch types.

No—do not install for new projects. This is AWS CDK v1, which reached end-of-support on 2023-06-01 and is no longer being updated. AWS explicitly recommends migrating to AWS CDK v2. Install only if you are maintaining legacy v1 code that cannot yet be upgraded.

Install

aws-cdk-aws-ecs on PyPI

pip

pip install aws-cdk-aws-ecs

uv

uv add aws-cdk-aws-ecs

poetry

poetry add aws-cdk-aws-ecs

Installing aws-cdk.aws-ecs

Before you install

Low install friction with a pure-Python wheel. However, this is AWS CDK v1, which reached end-of-support on 2023-06-01 and is no longer being updated—users should migrate to AWS CDK v2 instead.

License in practice

Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install aws-cdk.aws-ecs

from aws_cdk import aws_ecs as ecs
from aws_cdk import aws_ec2 as ec2

cluster = ecs.Cluster(self, "Cluster", vpc=vpc)
cluster.add_capacity("DefaultAutoScalingGroupCapacity",
    instance_type=ec2.InstanceType("t2.xlarge"),
    desired_capacity=3
)

Requires AWS CDK v1 environment and Python 3.7 or later; AWS CDK v1 is end-of-support as of 2023-06-01.

Verify before relying

  • Whether existing v1 code will continue to function without breaking changes in future Python or AWS SDK updates.
  • Support timeline and security patch policy for v1 after end-of-support date.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (~=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 29 — aws-cdk.aws-applicationautoscaling, aws-cdk.aws-autoscaling-hooktargets, aws-cdk.aws-autoscaling, aws-cdk.aws-certificatemanager, aws-cdk.aws-cloudwatch, aws-cdk.aws-ec2, aws-cdk.aws-ecr-assets, aws-cdk.aws-ecr, aws-cdk.aws-elasticloadbalancing, aws-cdk.aws-elasticloadbalancingv2, aws-cdk.aws-iam, aws-cdk.aws-kms, aws-cdk.aws-lambda, aws-cdk.aws-logs, aws-cdk.aws-route53-targets, aws-cdk.aws-route53, aws-cdk.aws-s3-assets, aws-cdk.aws-s3, aws-cdk.aws-secretsmanager, aws-cdk.aws-servicediscovery, aws-cdk.aws-sns, aws-cdk.aws-sqs, aws-cdk.aws-ssm, aws-cdk.core, aws-cdk.cx-api, constructs, jsii, publication, typeguard
Maintenance actively maintained — 1,152 days since the last release
Last repo commit
First released
Downloads 147,076/month — #11,080 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aws_cdk.aws_ecs-1.204.0-py3-none-any.whl

Development Status :: 7 - InactiveFramework :: AWS CDKFramework :: AWS CDK :: 1Intended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

ECS cluster infrastructure as codeAWS CDK container orchestrationFargate task definition constructsEC2 container service deploymentECS service management CDK
end-of-supportinfrastructure-as-codeaws-cdk-v1

More Build Tools packages

packaging

Provides reusable utilities for Python…

permissive · top 100 on PyPI

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

pip

pip is the standard installer for Python…

permissive · top 100 on PyPI

hatchling

Hatchling is a standards-compliant Python build…

permissive · top 100 on PyPI

grpcio-tools

Generates Python gRPC service stubs and message…

permissive · top 1,000 on PyPI

pre-commit

pre-commit is a framework for installing and…

permissive · top 1,000 on PyPI

aws-cdk.aws-ec2

Provides AWS CDK constructs for defining EC2…

permissive · top 15,000 on PyPI

aws-cdk.aws-events

Provides AWS CDK constructs for defining Amazon…

permissive · top 15,000 on PyPI

ecs-deploy

ecs-deploy is a CLI tool that simplifies Amazon…

permissive · top 15,000 on PyPI

aws-cdk.aws-servicediscovery

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.aws-batch

Defines AWS Batch infrastructure (compute…

permissive · top 15,000 on PyPI

aws-cdk.aws-fsx

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.aws-efs

Provides CDK constructs to define Amazon EFS…

permissive · top 15,000 on PyPI

aws-cdk.aws-globalaccelerator

Provides AWS CDK constructs to define and…

permissive · top 15,000 on PyPI

aws-cdk.aws-autoscaling

Provides CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.aws-redshift-alpha

Defines AWS Redshift clusters and database…

permissive · top 15,000 on PyPI