Table of Contents
The project consist of a DynamoDB database with pokemons information and 3 endpoints with lambdas. The frontend cosist of a Alexa Skill that use the API serverless provided. The system follows the IaaC patters.
Serverless Framework: Framework to implement IaaC with cloud providers. AWS Services:
- Lambda: Serverless logic functions
- DynamoDB: NoSQL database
- API Gateway: API Rest management
- CloudWatch event: Schedule the system trigger.
- XRAY: Analize and debug distributed apps
GOOD PRACTICES APPLIED
- Secondary Index created in the pokmeons table to reduce DynamoDB cost of get to O(1)
HTTP | Route | Description |
---|---|---|
GET | /prod/pokemons/id/{name} | Get pokemon info by id |
GET | /prod/pokemons/name/{name} | Get pokemon by name |
POST | prod/pokemons/post | Save a pokemon in the database |
To test the endpoints, you can download the Postman Collection.
Environment needed:
- endpoint: aws url
- api-key: key generated to access the endpoints
This is an example of how you may give instructions on setting up your project and deploy to AWS cloud.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- serverless
npm install serverless@latest -g
Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.
-
Clone the repo
git clone https://github.com/your_username_/Project-Name.git
-
Install NPM packages
npm install
-
Create a
config.yml
pokemonsTableName: <CustomName> pokemonsSeeder: [./seeds/<CustomName.json>] apiUrls: pokemons: <CustomName> accountIdNumber: <AWS_ACCOUNT_ID_NUMBER>
-
Deploy to AWS
sls deploy --aws-profile <profile>
-
Insert the seed into the DB
sls dynamodb:seed --aws-profile <profile>
José Ramón Martínez Riveiro
Copyright
© 2017, José Ramón Martínez Riveiro.