Registry / aws / cdk-ecs-service-extensions

cdk-ecs-service-extensions

JSON →
library2.0.0pypypi✓ verified 86d ago

A CDK construct library (v2.0.0) that provides extensions to easily build and deploy ECS services with common patterns like Service Connect, Firelens, AppMesh, etc. Part of the AWS CDK ecosystem, maintained by cdklabs, with periodic releases.

pip install cdk-ecs-service-extensions
INSTALL
IMPORT
SIG · CDK-ECS-SERVICE-EX
C
cdk-ecs-service-extensions
awspythonv2.0.0
Install
17.7s avg
Import
Disk
400MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 362MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 17.7s · import 0.000s · 362MB
400MB installed
● package 400MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceExtension
from cdk_ecs_service_extensions import ServiceExtension
QueueExtension
from cdk_ecs_service_extensions.extensions import QueueExtension
FirelensExtension
from cdk_ecs_service_extensions.extensions import FirelensExtension
from cdk_ecs_service_extensions import FirelensExtension
Extension classes are in submodule 'extensions'
Service
from cdk_ecs_service_extensions import Service
Environment
from cdk_ecs_service_extensions import Environment

Minimal app showing Environment, Service, and common extensions.

import aws_cdk as cdk from cdk_ecs_service_extensions import Environment, Service from cdk_ecs_service_extensions.extensions import ServiceExtension, QueueExtension, FirelensExtension, ContainerExtension app = cdk.App() stack = cdk.Stack(app, 'MyStack') # Create an environment (VPC, cluster) env = Environment(stack, 'MyEnv') # Create a service with extensions service = Service( stack, 'MyService', environment=env, extensions=[ ContainerExtension(image=cdk.aws_ecs.ContainerImage.from_registry('amazon/amazon-ecs-sample')), QueueExtension(), FirelensExtension(), ] ) app.synth()
Debug
Known issues
breakingVersion 2.0.0 is a major rewrite that requires AWS CDK v2 (aws-cdk-lib). CDK v1 is not supported. Check your CDK version before upgrading.
fix
Upgrade to CDK v2 and use aws-cdk-lib instead of @aws-cdk/* packages.
affects: <2.0.0
breakingThe import paths changed in v2. Extensions must be imported from the 'extensions' submodule (e.g., from cdk_ecs_service_extensions.extensions import QueueExtension).
fix
Update imports: use 'cdk_ecs_service_extensions.extensions' for extension classes.
affects: <2.0.0
gotchaThe library assumes you use the 'Environment' construct to manage VPC and cluster. If you use your own VPC/cluster, you may need to adapt. The 'Service' construct expects an 'environment' parameter.
fix
Create an Environment object (which creates a VPC and ECS cluster) and pass it to the Service.
affects: all
deprecatedSome extensions like 'AppMeshExtension' may be deprecated or require additional configuration. Check the GitHub README for current list.
fix
Refer to the official documentation for the list of supported extensions.
affects: 2.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'QueueExtension' from 'cdk_ecs_service_extensions'
Extension classes are not exported from the top-level package; they are in a submodule 'extensions'.
fix
Change import to: from cdk_ecs_service_extensions.extensions import QueueExtension
jsii.errors.JSIIError: Class 'Service' does not have a property 'environment'
Incorrect usage; the Service construct expects 'environment' as a parameter, not as a property.
fix
Pass the Environment object as the 'environment' parameter when creating the Service, e.g., Service(..., environment=my_env)
ModuleNotFoundError: No module named 'aws_cdk'
This library requires AWS CDK v2; 'aws_cdk' is an old v1 module.
fix
Install CDK v2: pip install aws-cdk-lib. Then import aws_cdk as cdk.
AttributeError: 'Service' object has no attribute 'task_definition'
The Service construct may not expose the underlying task definition directly; you need to access it through extensions or use the 'EcsService' property.
fix
Use service.service (the underlying ECS service) or consult extensions for task definition modifications.
Upgrade
Version history
2.0.0latest on PyPI · released Apr 12, 2022
Audit
Dependencies
aws-cdk-librequiredPeer dependency for AWS CDK constructs
constructsrequiredPeer dependency for CDK constructs
Agent activity
19 hits · last 30 days
node
18
Amazon
1
Resources