Create a serverless image resizer application using Go. The application will use AWS Lambda for serverless computing, S3 for storing the images, and API Gateway to handle HTTP requests. Docker will be used for local development and testing, while Terraform will manage the infrastructure as code.
- Upload Image: Accepts an image file and uploads it to an S3 bucket.
- Resize Image: On request, resizes the image to the specified dimensions.
- Retrieve Image: Retrieves the resized image from the S3 bucket. Steps to Create the Project
- Create a new GitHub repository named serverless-image-resizer.
- Initialize the repository with a README.md and .gitignore for Go.
- Set up a Dockerfile to create a development environment for the Go code.
- Create a docker-compose.yml to manage local development dependencies.
- Develop the main logic of the image resizer using Go.
- Create two Lambda functions: one for uploading and resizing images, and another for retrieving images.
- Use the AWS SDK to interact with S3.
- Set up an API Gateway to handle HTTP requests and trigger the Lambda functions.
Write Terraform scripts to provision the necessary AWS resources:
- API Gateway
- Lambda Functions
- S3 Bucket
- IAM Roles and Policies
- Use Terraform to deploy the infrastructure to AWS.
- Use AWS CLI or other deployment tools to upload your Lambda code.