aws-samples / serverless-patterns

Serverless patterns. Learn more at the website: https://serverlessland.com/patterns.
https://serverlessland.com
Other
1.57k stars 917 forks source link

New pattern submission: Lambda Elastic IP without NAT Gateway #1642

Closed MajdSoufan closed 1 year ago

MajdSoufan commented 1 year ago

This project contains a sample AWS Cloud Development Kit (AWS CDK) template for deploying a Lambda function with a public elastic IP without the need to provision a NAT gateway.

This pattern allows you to assign your lambda function a static public IP address that you can use to interact with APIs that require whitelisted IPs without the need to provision a NAT Gateway. Therefore, this pattern will save almost $33/month in NAT Gateway costs. This expense could multiply if multiple non-production accounts are provisioning NAT Gateways

The following resources will be provisioned:

Since AWS manages the provisioning of any Lambda ENI, we cannot access that ENI in CDK code. Therefore, to automate the process, we have to associate the Elastic IP with the ENI in a custom resource after the deployment occurs.

NOTE: This pattern is best suited for non-production environments since it is not multi-AZ nor highly scalable.

Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: MIT-0

GitHub PR for template:

https://github.com/aws-samples/serverless-patterns/pull/1641

MajdSoufan commented 1 year ago

Thank you @julianwood for merging the PR. Is there an ETA on when the pattern page is going to be released to Serverlessland.com? @jbesw

jbesw commented 1 year ago

This one is live at https://serverlessland.com/patterns/lambda-elastic-ip-no-nat-gateway-cdk.