Advanced Lambda example
Configuration in this directory creates the following Resources:
- S3 Bucket
- Uploads Lambda code to S3 bucket
- IAM Role and Attach Policy for Lambda
- Lambda Function
- Lambda layer
- SQS Queue
- Event Trigger
You can choose to create an Lambda setup with the following options:
- Create an Lambda setup in an existing VPC:
create_vpc = false # Default setup
- Create an Lambda setup in a new VPC:
This creates a new VPC in your account and then provisions Lambda resources inside that VPC.
create_vpc = true
Usage
To run this example you need to execute:
$ terraform init
$ terraform plan
$ terraform apply
Note that this example may create resources which cost money. Run terraform destroy
when you don’t need these resources.