fuzzi
fuzzi

Reputation: 2277

How to add a Fargate Service to Inbound Security Rules?

I have a Fargate Service running in AWS. I use it to run multiple tasks. Some of the tasks connect to an RDS database to query the database.

How can I add the Fargate Service to my inboard rules of a Security Group for the RDS database? - Is there a way to associate an Elastic IP with the Fargate Cluster?

Upvotes: 7

Views: 11089

Answers (2)

GreenyMcDuff
GreenyMcDuff

Reputation: 3622

Might have misunderstood something here... But the ECS allows you specify a security group at the service level.

Go to https://docs.aws.amazon.com/cli/latest/reference/ecs/create-service.html And search for the --network-configuration parameter

So surely you just need to set the source on your inbound rule of the RDS security group to be that security group ID?

Upvotes: 4

michail_w
michail_w

Reputation: 4481

Fargate doesn't support associating Elastic IPs with clusters. Clusters which runs in Fargate mode operate on instances which are not yours, it's the opposite of classic ECS stacks. That means you can't manage networking of host instances.

There is a way to associate IP with stack by having a Network Load Balancer in front of cluster. Then you could add a rule which allows connect your cluster through NLB.

Upvotes: 2

Related Questions