Metadata-Version: 2.1
Name: ecs-service
Version: 0.1.0
Summary: Reusable CDK construct for an ECS Service
Author: David Foley
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# aws_cdk-ecs-service

A reusable AWS CDK module for deploying an ECS Service with advanced deployment and load balancing options.

## Features

- Deploys an ECS Service using CloudFormation via AWS CDK
- Supports custom deployment configuration and circuit breaker
- Integrates with existing ECS Cluster and Target Group via CloudFormation exports
- Outputs ECS Service Name, ARN, and ID

## Installation
``` pip install ecs_service  ```

## Usage

### Prerequisites

- Python 3.8+
- AWS CDK v2
- Install dependencies:
  ```
  pip install aws-cdk-lib constructs pytest
  ```

### Example

```python
from aws_cdk import App, Stack
from ecs_service.ecs_service_stack import ECSServiceStack

app = App()
stack = Stack(app, "MyStack")

ECSServiceStack(
    scope=stack,
    id="ECSService",
    ecs_stack_name="MyStack",
    desired_count=2,
    task_definition_arn="arn:aws:ecs:region:account-id:task-definition/my-task-def",
    health_check_grace_period_seconds=60,
    container_port=80,
    target_group_arn="arn:aws:elasticloadbalancing:region:account-id:targetgroup/my-tg/1234567890abcdef",
    containername="my-container",
    maximum_percent=200,
    minimum_healthy_percent=100
)
```

### Testing

Unit tests are provided using `pytest` and `aws_cdk.assertions`.

To run tests:
```
pytest
```

### Logical IDs

Logical IDs generated by AWS CDK are random and may change between synths. Use resource outputs and exports for stable references.

## Project Structure

```
src/
  ecs_service/
    ecs_service_stack.py
tests/
  test_ecs_service.py
README.md
