CloudRest is a serverless API implemented on AWS using Terraform and making use of DynamoDB to store data.
To install CloudRest locally:
-
$
pip3 install awscli --upgrade --user
-
$
sudo apt install terraform
Note: Excellent instructions for installing Terraform on Ubuntu available at: https://computingforgeeks.com/how-to-install-terraform-on-ubuntu/
-
$
aws configure
$terraform init
$terraform apply
Note: Excellent instructions for setting up the AWS portion available at: https://linuxhint.com/install_aws_cli_ubuntu/
-
Use an API platform like Postman to set and get data via the endpoint returned by Terraform
Use Postman to submit a Post request to the URL and endpoint returned by Terraform (ie. https://kfd5dbmxqf.execute-api.us-east-1.amazonaws.com/py-lambda-stage/pet) With the data as JSON in the body (i.e. {"id": "1", "name": "Spot", "breed": "chihuahua", "gender": "male", "owner": "Hector Ortiz", "birthday": "05112020"} )
Use Postman to submit a Get request to the URL and endpoint returned by Terraform, and the id number of the stored data item appended at the end (ie. https://kfd5dbmxqf.execute-api.us-east-1.amazonaws.com/py-lambda-stage/pet?id=1)
-
$
terraform destroy
cloudrest-screenshot.mp4
Please open an issue to suggest fixes or ideas for improving CloudRest.