- Newest
- Most votes
- Most comments
The answer from BruceRoberts is the correct one not - Container overrides can be provided via inputTransformers from the event payload. Shape your event payload into the JSON matching the TaskOverride object and you can use this to configure any of the parameters (including container overrides and environment variables, but not just!)
For more on EventBridge input transformers: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html
Unfortunately, EventBridge lacks the ability to pass task definition overrides to the ECS RunTask API, which would allow you to specify environment variables or override the command line when starting a task.
As a workaround, I would recommend having S3 or EventBridge invoke a Lambda function instead. Your Lambda function can then call RunTask directly and pass the desired overrides to the task.
Relevant content
asked 2 years ago
