feat: Add Cognito user pool name parameter and update API handlers to include CORS headers

This commit is contained in:
2024-11-23 11:12:46 +02:00
parent 59c0c97252
commit 5f9ee29c8d
14 changed files with 103 additions and 47 deletions

View File

@@ -40,15 +40,7 @@ provider:
- "arn:aws:execute-api:${self:provider.region}:*:*/*/POST/users"
functions:
postSignUp:
handler: src/handlers/postSignUp.handler
memorySize: 1024
timeout: 60
events:
- cognitoUserPool:
pool: ${ssm:/tasker/cognito/user-pool-id}
trigger: PostConfirmation
# POST /users
# POST /users or triggered by Cognito
createUser:
handler: src/handlers/createUser.handler
memorySize: 1024
@@ -59,6 +51,10 @@ functions:
method: post
cors: true
authorizer: aws_iam
- cognitoUserPool:
existing: true
pool: ${ssm:/tasker/cognito/user-pool-name}
trigger: PostConfirmation
# POST /projects
createProject:
handler: src/handlers/createProject.handler
@@ -151,8 +147,8 @@ functions:
type: COGNITO_USER_POOLS
arn: ${ssm:/tasker/cognito/user-pool-arn}
# GET /tasks/user/${userId}
getTasksByUser:
handler: src/handlers/getTasksByUser.handler
getUserTasks:
handler: src/handlers/getUserTasks.handler
memorySize: 1024
timeout: 60
events: