I want to validate if Lambda uses VPC settings on the function or on the function version. This is important to determine if VPC settings are immutable or not.
- Create 2 VPCs with 2 subnets
- One VPC has access to the internet, one does not.
- Create a Lambda version with the correct subnets.
- Publish.
- Create a Lambda version with incorrect subnets.
- Call the version with correct subnets.
In order to run this repro, you need to do the following steps:
- Source whatever credentials you want to use to run this experiment.
- go to the head of this directory (where you are reading this README)
- run
bash bash.sh - run
terraform init - run
terraform apply - Go into the main.tf and uncomment lines on lines 73-75
- run
terraform apply - Run an invoke on
lambda_function_name:1 - Run an invoke on
lambda_function_name:$LATEST
The expected outcome is that we use the VPC settings of the individual function version, and not the function itself. Those properties should be immutable
Function versions are immutable. What this means is that :1 invoke has good VPC settings. :$LATEST has bad ones. The functions do not share vpc state at the function level.