Created
February 15, 2024 13:51
-
-
Save jgcmarins/dd160c28e0841afaa8a37da21e35edcb to your computer and use it in GitHub Desktop.
Multiple Lambdas with a single API Gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# serverless-api-gateway.yml | |
service: central-api-gateway | |
provider: | |
name: aws | |
runtime: nodejs14.x | |
stage: dev | |
region: sua-região | |
resources: | |
Resources: | |
MySharedApiGateway: | |
Type: AWS::ApiGateway::RestApi | |
Properties: | |
Name: SharedAPIGateway | |
Description: Um API Gateway central para todos os microserviços. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# serverless-microservice.yml | |
service: microservice-nome | |
provider: | |
name: aws | |
runtime: nodejs14.x | |
stage: dev | |
region: sua-região | |
apiGateway: | |
restApiId: "ID_DO_SEU_API_GATEWAY_CENTRAL" | |
restApiRootResourceId: "ID_DO_RECURSO_RAIZ_SE_NECESSÁRIO" # Opcional | |
functions: | |
minhaFuncao: | |
handler: handler.minhaFuncao | |
events: | |
- http: | |
path: caminho/da/funcao | |
method: get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment