Registry /
aws / cdk-ecs-service-extensions
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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 362MB
glibcpy 3.10–3.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()
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'.
fixChange 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.
fixPass 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.
fixInstall 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.
fixUse 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