So far, we have learned how to write, build, package, and deploy Lambda functions using the SAM. We will now understand how security works inside them:
- You can scroll to the bottom of the Lambda console to see the network and security settings, where the VPC and the subnet details are mentioned:
![](https://static.packt-cdn.com/products/9781787288676/graphics/assets/22126210-d869-47c4-a585-d7a2b6fef3d0.png)
- Now, we will add in the network settings, which include the security groups and the subnet IDs:
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: A starter AWS Lambda function.
Resources:
helloworldpython3:
Type: 'AWS::Serverless::Function'
Properties:
Handler: lambda_function.lambda_handler
Runtime: python3.6
CodeUri: .
Description: A starter AWS Lambda function.
MemorySize: 128
Timeout: 3
...