Skip to content

Feature/Eventbridge v2: Add ECS target #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lizard-boy
Copy link

Motivation

EventBridge can be used to invoke a ECS task, this PR adds this feature to LocalStack.

Changes

  • add validation for input parameters
  • extract parameters and assign correct keywords for run_task
  • execute a new task based on the input parameters from the target definition

Testing

Since ECS is a pro feature, the aws validated test can be found in this companion branch: https://github.com/localstack/localstack-ext/pull/3369

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds support for ECS (Elastic Container Service) targets in EventBridge for LocalStack, enhancing the platform's compatibility with AWS services.

  • Implemented ECSTargetSender class in localstack/services/events/target.py to handle ECS-specific event routing
  • Added input validation and parameter extraction for ECS targets, including network configuration, launch type, and capacity provider strategy
  • Refactored EventBridge fixtures in localstack/testing/pytest/fixtures.py for improved granularity and control in testing
  • Updated various test files to use the new sqs_as_events_target fixture, replacing create_sqs_events_target

10 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +309 to +310
if ecs_parameters.get("CapacityProviderStrategy") and ecs_parameters.get("LaunchType"):
raise ValueError("only LaunchType or CapacityProviderStrategy can be provided")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Check if both LaunchType and CapacityProviderStrategy are provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants