This commit is contained in:
2025-07-17 15:51:53 -03:00
parent b30b158917
commit 8821325e19
8 changed files with 95 additions and 13 deletions

View File

@@ -5,6 +5,9 @@ Parameters:
UserTable:
Type: String
Default: betaeducacao-prod-users_d2o3r5gmm4it7j
EnrollmentTable:
Type: String
Default: betaeducacao-prod-enrollments
Globals:
Function:
@@ -23,6 +26,7 @@ Globals:
POWERTOOLS_LOGGER_SAMPLE_RATE: 0.1
POWERTOOLS_LOGGER_LOG_EVENT: true
USER_TABLE: !Ref UserTable
ENROLLMENT_TABLE: !Ref EnrollmentTable
KONVIVA_API_URL: https://lms.saladeaula.digital
KONVIVA_SECRET_KEY: "{{resolve:ssm:/betaeducacao/konviva/secret_key/str}}"
@@ -55,3 +59,25 @@ Resources:
- exists: false
metadata__konviva_user_id:
- exists: false
EventEnrollFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.enroll.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBWritePolicy:
TableName: !Ref EnrollmentTable
Events:
DynamoDBEvent:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref EnrollmentTable]
detail-type: [INSERT]
detail:
new_image:
sk: ["konviva"]
enrollment_id:
- exists: false