-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Project: ControlPanel
Summary:
Task Description:
- Currently, the
POST /terminateInstanceAPI endpoint directly invokes theterminateInstanceFunctionLambda, which returns a simple placeholder response. - This task involves updating the
terminateInstanceAPI endpoint to invoke theUserTerminateEC2WorkflowStep Function instead of the Lambda directly. - The Step Function orchestrates the EC2 termination workflow (terminating EC2 instances, cleaning up resources, updating session state) and returns its execution status to the client.
- This decouples the API layer from the termination logic and enables complex multi-step workflows to be managed by Step Functions.
Acceptance Criteria:
- The
POST /terminateInstanceAPI endpoint now accepts userId and instanceId in the request body. - The endpoint invokes the
UserTerminateEC2WorkflowStep Function with the request parameters. - The API returns a success/failure status to the client without exposing internal execution details.
- Input validation is performed before invoking the Step Function (e.g., validate userId, instanceId).
- Error handling is implemented for Step Function invocation failures.
- The
terminateInstanceFunctionLambda is still available for Step Function tasks but is no longer directly invoked by the API. - Step Function execution ARN is stored internally (DynamoDB) but NOT returned to the client for security reasons.
Ticket Progress
- Documentation Walk-through and Research
- Code base review
- High level system design for the API data flow
- Implementation Plan
- Code Change: TerminateInstance Step Function Definiation Update
- Code Change: API gateway endpoint creation
- Code Change: DynamoDB table Schema
- Code change: Lambda functions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels