This is a small serverless application that process the order, builded in cloud on event-driven
architecture
with the help of serverless SAM framework
and AWS
infrastructure
Used AWS services:
- API Gateway
- SQS
- Lambda
- Step Functions
- DynamoDB
- CloudWatch Logs
#go to the root project directory
$ cd path/to/projectDirectory
#build an application with sam-cli
$ sam build
#deploy application to your AWS account
$ sam deploy --guided
Go to AWS API Gateway Console
, select right api-gateway and copy it's public URL
Now you can send a POST
request to the /order
path with the same body structure:
{
"customerId": "1",
"productsInfo": [
{
"id": "1",
"count": 1
},
{
"id": "2",
"count": 1
}
]
}
Warning
To get the result, you must create some items in CustomerTable
and ProductsTable
{
"id": "1",
"fullName": "Name Surname",
"email": "email@example.com",
"balance": 1
}
{
"id": "1",
"name": "product1",
"type": "type1",
"price": 1,
"count": 1
}