{"id":23403,"library":"cdk-ecs-service-extensions","title":"cdk-ecs-service-extensions","description":"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.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/cdklabs/cdk-ecs-service-extensions","tags":["aws","cdk","ecs","infrastructure","constructs"],"install":[{"cmd":"pip install cdk-ecs-service-extensions","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Peer dependency for AWS CDK constructs","package":"aws-cdk-lib","optional":false},{"reason":"Peer dependency for CDK constructs","package":"constructs","optional":false}],"imports":[{"note":"","wrong":"","symbol":"ServiceExtension","correct":"from cdk_ecs_service_extensions import ServiceExtension"},{"note":"","wrong":"","symbol":"QueueExtension","correct":"from cdk_ecs_service_extensions.extensions import QueueExtension"},{"note":"Extension classes are in submodule 'extensions'","wrong":"from cdk_ecs_service_extensions import FirelensExtension","symbol":"FirelensExtension","correct":"from cdk_ecs_service_extensions.extensions import FirelensExtension"},{"note":"","wrong":"","symbol":"Service","correct":"from cdk_ecs_service_extensions import Service"},{"note":"","wrong":"","symbol":"Environment","correct":"from cdk_ecs_service_extensions import Environment"}],"quickstart":{"code":"import aws_cdk as cdk\nfrom cdk_ecs_service_extensions import Environment, Service\nfrom cdk_ecs_service_extensions.extensions import ServiceExtension, QueueExtension, FirelensExtension, ContainerExtension\n\napp = cdk.App()\nstack = cdk.Stack(app, 'MyStack')\n\n# Create an environment (VPC, cluster)\nenv = Environment(stack, 'MyEnv')\n\n# Create a service with extensions\nservice = Service(\n    stack, 'MyService',\n    environment=env,\n    extensions=[\n        ContainerExtension(image=cdk.aws_ecs.ContainerImage.from_registry('amazon/amazon-ecs-sample')),\n        QueueExtension(),\n        FirelensExtension(),\n    ]\n)\n\napp.synth()","lang":"python","description":"Minimal app showing Environment, Service, and common extensions."},"warnings":[{"fix":"Upgrade to CDK v2 and use aws-cdk-lib instead of @aws-cdk/* packages.","message":"Version 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.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Update imports: use 'cdk_ecs_service_extensions.extensions' for extension classes.","message":"The import paths changed in v2. Extensions must be imported from the 'extensions' submodule (e.g., from cdk_ecs_service_extensions.extensions import QueueExtension).","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Create an Environment object (which creates a VPC and ECS cluster) and pass it to the Service.","message":"The 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to the official documentation for the list of supported extensions.","message":"Some extensions like 'AppMeshExtension' may be deprecated or require additional configuration. Check the GitHub README for current list.","severity":"deprecated","affected_versions":"2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change import to: from cdk_ecs_service_extensions.extensions import QueueExtension","cause":"Extension classes are not exported from the top-level package; they are in a submodule 'extensions'.","error":"ImportError: cannot import name 'QueueExtension' from 'cdk_ecs_service_extensions'"},{"fix":"Pass the Environment object as the 'environment' parameter when creating the Service, e.g., Service(..., environment=my_env)","cause":"Incorrect usage; the Service construct expects 'environment' as a parameter, not as a property.","error":"jsii.errors.JSIIError: Class 'Service' does not have a property 'environment'"},{"fix":"Install CDK v2: pip install aws-cdk-lib. Then import aws_cdk as cdk.","cause":"This library requires AWS CDK v2; 'aws_cdk' is an old v1 module.","error":"ModuleNotFoundError: No module named 'aws_cdk'"},{"fix":"Use service.service (the underlying ECS service) or consult extensions for task definition modifications.","cause":"The Service construct may not expose the underlying task definition directly; you need to access it through extensions or use the 'EcsService' property.","error":"AttributeError: 'Service' object has no attribute 'task_definition'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}