add postgres

This commit is contained in:
2025-08-26 00:00:42 -03:00
parent 1326530991
commit e33eccebb9
43 changed files with 622 additions and 636 deletions

View File

@@ -17,7 +17,7 @@ Globals:
Architectures:
- x86_64
Layers:
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:86
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:94
Environment:
Variables:
TZ: America/Sao_Paulo
@@ -36,6 +36,33 @@ Resources:
Properties:
RetentionInDays: 90
HttpLog:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 90
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins: ["*"]
AllowMethods: [POST, OPTIONS]
AllowHeaders: [Content-Type, X-Requested-With]
HttpApiFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
LoggingConfig:
LogGroup: !Ref HttpLog
Events:
Session:
Type: HttpApi
Properties:
Path: /
Method: POST
ApiId: !Ref HttpApi
EventCreateUserFunction:
Type: AWS::Serverless::Function
Properties:
@@ -60,6 +87,29 @@ Resources:
metadata__konviva_user_id:
- exists: false
EventUpdateUserFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.update_user.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBReadPolicy:
TableName: !Ref UserTable
Events:
DynamoDBEvent:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref UserTable]
detail-type: [MODIFY]
detail:
new_image:
sk: ["0"]
metadata__konviva_user_id:
- exists: true
changes: [name, email, cpf]
EventEnrollFunction:
Type: AWS::Serverless::Function
Properties:
@@ -78,7 +128,7 @@ Resources:
detail-type: [INSERT]
detail:
new_image:
sk: ["konviva"]
sk: [konviva, KONVIVA]
enrollment_id:
- exists: false
@@ -104,26 +154,3 @@ Resources:
status: [CANCELED]
old_image:
status: [PENDING]
EventUpdateUserFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.update_user.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBReadPolicy:
TableName: !Ref UserTable
Events:
DynamoDBEvent:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref UserTable]
detail-type: [MODIFY]
detail:
new_image:
sk: ["0"]
metadata__konviva_user_id:
- exists: true
changes: [name, email, cpf]