Skip to content

Sending UDP traffic to EC2 host from ECS instance, security group issue on EC2 host

0

I'm wanting to send UDP traffic to an EC2 host in the same VPC as an ECS instance and I can only get it to work by testing with allowing all source IPs in the security group for the EC2 instance. With RDS it's always worked fine to use the RDS instance's security group ID as source in the ECS container's security group, but that isn't working here, where I'd use the ECS container's SG as source for the UDP port in the EC2 instance's SG. I tried using something like 172.30.0.0/16 to allow all VPC traffic, but that doesn't work either. Are ECS instances in my VPC? Thanks for any help.

  • I'm assuming you are using ECS on EC2, not Fargate...can you confirm? If so, what Task networking mode are you using? (AWSVPC, BRIDGE, or HOST)?

  • @AWS-User-5227227 Were you able to resolve this issue? I have the same issue, where I am trying to connect to a DB on EC2 from ECS - without success.

1 Answer
0

This will depend on what task networking mode you're using. If you're using Bridge/Host the traffic will come from the underlying EC2 instance, which won't correspond with the security group of the ECS task. A good way to test connection errors and where the connection is being stopped would be VPC Reachability Analyzer.

AWS

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.