You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a load-balanced service which is deployed in public subnets (which is the default configuration). This service is in turn used by another service. In this service, I want to whitelist IPs to allow requests only from the load-balanced service mentioned above.
I can provide the IP of the Fargate task created by Copilot but I am concerned whether that is the correct approach. Firstly, I am unsure whether the IP assigned to the task might change with deployment. Secondly, but most importantly, the number of Fargate tasks might increase at scale (since I have added that configuration in manifest.yml). In this scenario, since the IP assigned to new tasks (created at scale) might be different, whitelisting rules added for the other service might not work as expected since only one IP would have been added at the start. Is my thinking correct?
One of the solutions to solve this would be to place Fargate tasks in Private Subnets (use placement: private) and have NAT Gateway configured so that all the outgoing requests from the load-balanced service would have the same source IP (NAT IP).
Is the above approach the correct one and alternately is there any solution if the fargate tasks are placed in the public subnets?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have a load-balanced service which is deployed in public subnets (which is the default configuration). This service is in turn used by another service. In this service, I want to whitelist IPs to allow requests only from the load-balanced service mentioned above.
I can provide the IP of the Fargate task created by Copilot but I am concerned whether that is the correct approach. Firstly, I am unsure whether the IP assigned to the task might change with deployment. Secondly, but most importantly, the number of Fargate tasks might increase at scale (since I have added that configuration in manifest.yml). In this scenario, since the IP assigned to new tasks (created at scale) might be different, whitelisting rules added for the other service might not work as expected since only one IP would have been added at the start. Is my thinking correct?
One of the solutions to solve this would be to place Fargate tasks in Private Subnets (use placement: private) and have NAT Gateway configured so that all the outgoing requests from the load-balanced service would have the same source IP (NAT IP).
Is the above approach the correct one and alternately is there any solution if the fargate tasks are placed in the public subnets?
Beta Was this translation helpful? Give feedback.
All reactions