Amazon VPC Lattice with AWS Lambda as weighted targets

Amazon VPC Lattice → AWS Lambda

This pattern demonstrates how to create a VPC Lattice which shifts traffic to different targets based on the weighted routing policy.

VPC Lattice is to designed to help you easily and effectively discover, secure, connect, and monitor all of the services within it. Each component within VPC Lattice communicates unidirectionally or bi-directionally within the service network based on its association with the service network and its access settings. Access settings are comprised of authentication and authorization policies required for this communication.
This pattern uses Lambda as weighted targets. VPC Lattice service shifts traffic based on the percentage of weight configured for target groups under VPC Lattice listener. User may update the weight for the targets according to their use case and requirements.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/vpc-lattice-lambda-tf

Deploy

terraform initterraform apply


Testing

Invoke Demo Lambda function using CLI/Console and observe traffice shift from VPC Lattice service.

Cleanup

terraform destroy
terraform show

Additional resources

Created by:

Makendran G

Makendran G

Cloud Support Engineer @ AWS

Follow on LinkedIn