# Serverless App - Pet-Cuddle-O-Tron

This AWS project by Adrian Cantrill involves implementing a simple serverless application using S3, API Gateway, Lambda, Step Functions, SNS, and SES. The application loads from an S3 bucket, communicates with lambda and step functions, and enables the configuration of reminders for pet cuddles to be sent via email.

There are six basic stages involved:

* Configure Simple Email Service (SES)
    
* Add an email lambda function to use SES to send emails for the serverless application
    
* Implement and configure the state machine, the core of the application
    
* Implement the API Gateway, API, and supporting lambda function
    
* Implement the static frontend application and test its functionality
    

The final state of the project is shown below:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716125909125/cd290776-cc8c-4c00-88d8-b9e7bef3bc35.png align="center")

### Stage 1: SES

The first step of the project was setting up two verified identities on SES. I created these with my email addresses and verified both.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716126233292/36757c11-446c-408b-bf12-045d3f7cdec6.png align="center")

### Stage 2: Email Reminder Lambda Function

A lambda execution role was required for this, and I created one using the CloudFormation resource provided by Cantrill.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716126427583/1911ef82-d00f-49c0-bdac-88e6f51132cd.png align="center")

This was followed by the lambda function itself, which sends an email to an address it's supplied with.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716126516409/1b9e6ebe-a7c6-42a7-a787-4f5a8e289e94.png align="center")

### Stage 3: State Machine

Another IAM role was created for the state machine to enable interaction with other AWS services. Following that was the creation of the state machine, which was configured using the email\_reminder\_lambda\_arn and the previously created IAM role.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716126772251/ea4fe099-8a38-4a6a-957b-1c2268bc33f4.png align="center")

### Stage 4: API Gateway and Supporting Lambda Function

A second lambda function called api\_lambda was created and configured to use the state\_machine\_arn. After that, the API gateway was created and configured to use the api\_lambda function as the integration type.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716127132216/8e183d2c-ee60-4d22-aa4a-f0562e01e90e.png align="center")

### Stage 5: Frontend Application

At this stage of the project, an S3 bucket was created with static website hosting to host the application frontend.

The final web page is shown below alongside the email:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716127284498/2dc2b7ff-b323-42d3-95af-c891b384b9fc.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1716127333724/3a82c2a4-daa0-44a5-8629-84e3b4652cdd.png align="center")
