Package | Version |
---|---|
python | >= 3.8 |
An AWS API using the Serverless Framework, Lambda functions, and DynamoDB for a CRUD system that manages market products.
Each product must have the following schema, and you have to make sure the API doesn't allow different objects and that it returns the proper HTTP codes:
Product object schema
{
"_id": "string",
"name": "string",
"description": "string",
"category": "string",
"brand": "string",
"price": "number",
"inventory": {
"total": "number",
"available": "number"
},
"images": ["string"],
"created_at": "Date",
"updated_at": "Date"
}
In order to deploy the application to the AWS Cloud, simply run:
make build
make deploy
Please remove the resources and clean the stack by running:
make remove
make clean
Package | Version |
---|---|
serverless | latest |
boto3 | latest |
- Install
serverless framework
: https://www.serverless.com/framework/docs/getting-started
You are required to create an AWS account if you don't have one yet.
Package | Version |
---|---|
aws-cli | latest |
- Install
aws-cli
: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html - Configure credentials on your local machine, by running:
$ aws configure
AWS Access Key ID [None]: <Your-Access-Key-ID>
AWS Secret Access Key [None]: <Your-Secret-Access-Key-ID>
Default region name [None]: us-west-1
Default output format [None]: json
View CLI Config for reference.
- Create AWS credentials including the following IAM policies:
AWSLambdaFullAccess
,AmazonS3FullAccess
,AmazonAPIGatewayAdministrator
andAWSCloudFormationFullAccess
.
Run:
aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AWSLambdaFullAccess --user-name <username>
aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --user-name <username>
aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AmazonAPIGatewayAdministrator --user-name <username>
aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AWSCloudFormationFullAccess --user-name <username>