copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

How to limit number of public IP v4 for services created by AWS Copilot

Open thientran1707 opened this issue 1 year ago • 5 comments

From Feb 2024, AWS will charge for public ip v4, I am exploring AWS Copilot to deploy the service under "Load Balanced Web Service".

I would like to limit the number of public IP v4 associated with the service, not sure how this can be done? I try to check in the documentation but can not find any information yet

thientran1707 avatar Feb 21 '24 11:02 thientran1707

Hello! Any news on that? Last month we paid 200$ for the public IP v4. 90% of our services are not exposed... Where is the cost coming from? The load balancers?

Thank you

Kylir avatar Mar 04 '24 11:03 Kylir

Hello if the services are not exposed can you try putting them into the private subnets to avoid unnecessary public ipv4 addr for each task? e.g.

network:
  vpc:
    placement: private

iamhopaul123 avatar Mar 05 '24 21:03 iamhopaul123

Thanks @iamhopaul123 ,

My understanding is that Copilot is creating a NAT that has some cost attached to it. I guess I need to evaluate what is the best.

Kylir avatar Mar 07 '24 23:03 Kylir

That's true. The default behavior is to create the NAT if any workload is placed in private subnets. However, if you don't need NAT at all (aka no public traffic for private subnets), you can override this behavior by always setting the env stack condition CreateNATGateways false using yaml patch for your env stack:

- op: replace
  path: /Conditions/CreateNATGateways
  value: false

iamhopaul123 avatar Mar 07 '24 23:03 iamhopaul123

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar May 07 '24 00:05 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]