func-api-users-delete
Overview
Deploys the Lambda function that handles DELETE /users/{user_id}. Removes a user from the DynamoDB allowlist table. The route is authenticated via the Cognito JWT authorizer.
CloudFormation Stack
firefly-func-api-users-delete
CloudWatch Logs
| Setting | Value |
|---|---|
| Log group | /aws/lambda/firefly-func-api-users-delete |
| Retention | 30 days |
Dependencies
Deploy Dependencies
| Workflow | Reason |
|---|---|
| api-gateway | ApiId and AuthorizerId resolved from stack outputs |
| cognito | Authorizer is created as part of the api-gateway stack, which depends on Cognito |
| dynamodb-users | Table must exist before function is deployed and granted delete access |
Delete Dependencies
None — this workflow has no prerequisites.
Required By
Required By Deploy
| Workflow | Reason |
|---|---|
| run-integration-tests | Endpoint must be live before integration tests run |
Required By Delete
| Workflow | Reason |
|---|---|
| delete-api-gateway | Route registration must be removed before the API Gateway stack is deleted |
| delete-dynamodb-users | Resource-based permissions referencing the table must be removed first |
Deploy Workflow
Description
Resolves the HTTP API Gateway ID and JWT Authorizer ID from the firefly-api-gateway stack outputs, then performs a SAM build and deploy. The function is granted delete access to the DynamoDB users table.
Steps
- Configure AWS credentials.
- Look up
ApiIdfrom thefirefly-api-gatewaystack output. - Look up
AuthorizerIdfrom thefirefly-api-gatewaystack output. - SAM build.
- SAM deploy
firefly-func-api-users-deletewith parameters:ApiIdAuthorizerIdDynamoDbUsersTableName(from secrets)
Sequence Diagram
Delete Workflow
Description
Calls sam delete to remove the Lambda function and its associated IAM role and API Gateway route integration.
Steps
- Configure AWS credentials.
- SAM delete
firefly-func-api-users-delete.
Sequence Diagram
Failure Scenarios
| Scenario | Behavior |
|---|---|
firefly-api-gateway stack not found | describe-stacks returns an error; workflow fails before SAM deploy is attempted. Deploy api-gateway first. |
| Authorizer ID lookup fails | Deploy fails; the JWT authorizer is created by the api-gateway stack — redeploy api-gateway to restore it. |
| DynamoDB users table not deployed | Function deploys successfully but returns errors at runtime when attempting to delete from the table. Deploy dynamodb-users first. |