Skip to content

Commit 40ecdd8

Browse files
committed
Add Get Task functionality to Infrastructure Guide
1 parent 0a6d8c0 commit 40ecdd8

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

docs/InfrastructureGuide.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,40 @@ const tableName = process.env.TASK_TABLE_NAME;
425425
- **DynamoDB**: Read access (Scan) to the Task table
426426
- **CloudWatch Logs**: Write access to its log group
427427

428+
#### Get Task Function
429+
430+
**Resource Type**: AWS Lambda Function
431+
432+
**Configuration**:
433+
434+
- **Function Name**: `{app-name}-get-task-{env}`
435+
- **Runtime**: Node.js 24.x
436+
- **Handler**: `handler` (bundled with esbuild)
437+
- **Memory**: 256 MB
438+
- **Timeout**: 10 seconds
439+
- **Log Format**: JSON (structured logging)
440+
- **Bundling**: Automatic TypeScript compilation with esbuild
441+
- **Environment Variables**:
442+
- `TASKS_TABLE`: DynamoDB table name
443+
- `ENABLE_LOGGING`: Logging enabled flag (from `CDK_APP_ENABLE_LOGGING`)
444+
- `LOG_LEVEL`: Minimum log level (from `CDK_APP_LOGGING_LEVEL`)
445+
- `LOG_FORMAT`: Log output format (from `CDK_APP_LOGGING_FORMAT`)
446+
447+
**CloudWatch Logs**:
448+
449+
- **Log Group**: `/aws/lambda/{app-name}-get-task-{env}`
450+
- **Log Retention**:
451+
- `prd`: 30 days
452+
- Other environments: 7 days
453+
- **Removal Policy**:
454+
- `prd`: `RETAIN` (logs preserved on stack deletion)
455+
- Other environments: `DESTROY` (logs deleted on stack deletion)
456+
457+
**IAM Permissions**:
458+
459+
- **DynamoDB**: Read access (GetItem) to the Task table
460+
- **CloudWatch Logs**: Write access to its log group
461+
428462
#### Create Task Function
429463

430464
**Resource Type**: AWS Lambda Function
@@ -482,6 +516,14 @@ const tableName = process.env.TASK_TABLE_NAME;
482516
- Integration: Lambda proxy integration with List Tasks Function
483517
- Response: JSON array of tasks
484518

519+
- **GET /tasks/{taskId}**: Get a specific task by ID
520+
- Integration: Lambda proxy integration with Get Task Function
521+
- Path Parameter: `taskId` - The unique identifier of the task
522+
- Response: JSON object with the requested task
523+
- Error Responses:
524+
- 404 Not Found: Task ID does not exist or path parameter is missing
525+
- 500 Internal Server Error: Failed to retrieve task
526+
485527
- **POST /tasks**: Create a new task
486528
- Integration: Lambda proxy integration with Create Task Function
487529
- Request Body: JSON object with task properties (title, description, status)
@@ -492,6 +534,7 @@ const tableName = process.env.TASK_TABLE_NAME;
492534
- `ApiUrl`: The API Gateway endpoint URL (e.g., `https://abc123.execute-api.us-east-1.amazonaws.com/dev/`)
493535
- `ApiId`: The API Gateway ID
494536
- `ListTasksFunctionArn`: The List Tasks Lambda function ARN
537+
- `GetTaskFunctionArn`: The Get Task Lambda function ARN
495538
- `CreateTaskFunctionArn`: The Create Task Lambda function ARN
496539

497540
**Logging Configuration**:

0 commit comments

Comments
 (0)