A set of Lambda triggers to customize Amazon Cognito authentication actions in the RMS project. Lambda triggers allow you to customize how you register and confirm users, authenticate users, send messages, and generate tokens.
Tip
O Amazon Cognito trabalha com funções do AWS Lambda para modificar o comportamento da autenticação. As funções Lambda podem modificar o comportamento padrão do fluxo de autenticação, como permitir login "passwordless" sem senha por exemplo.
Para mais informações sobre os Lambda Triggers do Amazon Cognito visiste a página Como personalizar fluxos de trabalho do grupo de usuários com acionadores do Lambda.
Você deve ter instalado a AWS CLI, o AWS SAM CLI e possuir uma conta na AWS.
To build and deploy your application for the first time, run the following in your shell:
sam build
sam deploy --guided
Build your application with the sam build
command.
rms-cognito-triggers$ sam build
The SAM CLI installs dependencies defined in <function-name>/package.json
, compiles TypeScript with esbuild, creates a deployment package, and saves it in the .aws-sam/build
folder.
Test a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the events
folder in this project.
Run functions locally and invoke them with the sam local invoke
command.
rms-cognito-triggers$ sam local invoke HelloWorldFunction --event events/event.json
The SAM CLI can also emulate your application's API. Use the sam local start-api
to run the API locally on port 3000.
rms-cognito-triggers$ sam local start-api
rms-cognito-triggers$ curl http://localhost:3000/
Tests are defined in the <function-name>/tests
folder in this project. Use NPM to install the Jest test framework and run unit tests.
rms-cognito-triggers$ cd function-name
function-name$ npm install
function-name$ npm run test
To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:
sam delete --stack-name rms-cognito-triggers
API de Pedidos
https://github.com/Grupo-G03-4SOAT-FIAP/rms-api-pedidos
Infrastructure as code (IaC) com Terraform
https://github.com/Grupo-G03-4SOAT-FIAP/rms-iac
aws-cli/2.15.10, AWS SAM CLI version 1.110.0 e Node.js 20.x