I'm new to aws cloud service. I have to create a parallel cluster in aws. So, I'm using aws parallel cluster. But the problem is, when creating a cluster the NAT gateway billing me when I'm not using it. So, the cost increases. Is there any way I can minimize or automate the NAT gateway process so that it will cost me less??

PS:If there is any project which gives me on demand NAT gateway hour or Nat gateway instances in parallel cluster that would be very nice.


1 Answer 1


This is possible, by creating two lambda function , one to check if the NAT getaway is available, if not, handles the provisioning of a new gateway and the creation of the required routes. And the second lambda to check if the lambda is still required and if not, it can deactivate.

Please refer this blog for Code and explanation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.