- Newest
- Most votes
- Most comments
You can detect an ECS Task State (New or existing) using the "aws.ecs@ECSTaskStateChange" event on Amazon EventBridge when creating a Rule: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html
Then you can configure the EventBridge Rule to invoke the Lambda to get the IP from the Event data and Implement the desired changes in your ALB Security Groups.
I'm doing that, but i'm struggiling with the Lambda function. Would you like to provide me with an example of the Lambda function?
Quick question, Why do you need to do this? Perhaps look at fixing the reason that you do this?
Initially I’m thinking you may want to setup and internal ALB with split horizon DNS which may solve the issue your facing and I’ve fixed several times.
Relevant content
- Accepted Answerasked a year ago
- Accepted Answerasked a year ago
- asked 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
You're looking for code reference on how to do that with AWS Lambda?
Yeah, exactly