Create an AWS Lambda Function and deploy a sample code using Terraform
- Install Terraform in your local machine using this official guide by Hashicorp.
- To install Terraform using CLI, use this guide https://learn.hashicorp.com/tutorials/terraform/install-cli
- To install Terraform by downloading, use this guide https://www.terraform.io/downloads.html
- Download and Install Visual Studio code editor using this guide https://code.visualstudio.com/download
- Sign into AWS Management Console.
- Setup Visual Studio Code
- Create a variables file
- Create source and destination S3 buckets in the main.tf file
- Create an IAM role and policy for the Lambda function in the main.tf file
- Create a lambda function in the main.tf file
- Create a lambda trigger for S3 in main.tf file
- Create an output file
- Confirm the installation of Terraform by checking the version
- Apply terraform configurations
- Check the resources in AWS Console
- Delete AWS Resources