API Gateway with terraform for learning!
 
 
Go to file
flavien 1f177ddf9a
feat(swagger): swagger documentation deployment
2023-06-22 17:04:44 +02:00
doc feat(swagger): swagger documentation deployment 2023-06-22 17:04:44 +02:00
services feat(swagger): swagger documentation deployment 2023-06-22 17:04:44 +02:00
terraform feat(swagger): swagger documentation deployment 2023-06-22 17:04:44 +02:00
.gitignore feat(swagger): swagger documentation deployment 2023-06-22 17:04:44 +02:00
.python-version feat: initial POC 2023-06-21 14:39:57 +02:00
LICENSE Initial commit 2023-06-19 11:09:54 +02:00
README.md feat: initial POC 2023-06-21 14:39:57 +02:00
Taskfile.yml feat(swagger): swagger documentation deployment 2023-06-22 17:04:44 +02:00

README.md

terraform_api_gateway

API Gateway with terraform for learning!

deployment tasks

⚠️ require go-task and jq

task terraform_plan ENV=... => plan the terraform deployment + create a tfplan.json that resume the modifications.
task terraform_apply ENV=... => deploy the stack.
task terraform_destroy ENV=... => destroy the stack.

configured environments:

  • dev

test commmands

login to cognito from cli to get IdToken

Run:
aws cognito-idp initiate-auth --region <...> --auth-flow USER_PASSWORD_AUTH --client-id <...> --auth-parameters USERNAME=<...>,PASSWORD=<...>
Then copy the "IdToken" from response.

test an api endpoint with cognito authorizer

curl --header "Authorization: <IdToken>" https://<...>.execute-api.eu-west-1.amazonaws.com/<stage>/<route>

TODO

  • create a post route
  • body validation
  • reponse transformation
  • routes module
  • swagger documentation
  • use aws lambda module

critique du code

Il n'y as pas vraiment de plus value d'avoir une conf de backend par env avec les workspaces.