func-api-firmware-delete
Overview
Manages the Lambda function that handles authenticated firmware deletion via DELETE /firmware/{zip_name}. Returns 409 Conflict if the record's release_status is RELEASED (must be revoked first). Deletes the object from the private S3 bucket, which asynchronously triggers func-s3-firmware-deleted to mark the DynamoDB record DELETED.
CloudFormation Stack
firefly-func-api-firmware-delete
CloudWatch Logs
| Setting | Value |
|---|---|
| Log group | /aws/lambda/firefly-func-api-firmware-delete |
| Retention | 30 days |
Dependencies
Deploy Dependencies
| Workflow | Reason |
|---|---|
| api-gateway | API Gateway ID and Cognito JWT Authorizer ID required as SAM parameters |
| shared-layer | Lambda layer ARN must be resolvable at SAM build/deploy time |
Delete Dependencies
None — this workflow has no prerequisites.
Required By
Required By Deploy
| Workflow | Reason |
|---|---|
| run-integration-tests | Firmware delete endpoint must exist before integration tests run |
Required By Delete
| Workflow | Reason |
|---|---|
| api-gateway | All Lambda integrations must be removed before the API Gateway stack can be deleted |
| shared-layer | Layer cannot be deleted while functions still reference it |
Deploy Workflow
Description
Looks up the API Gateway ID and Cognito JWT Authorizer ID from the firefly-api-gateway stack outputs, then builds and deploys the function. The route is protected by the Cognito JWT authorizer.
Steps
- Configure AWS credentials.
- Look up
ApiIdandAuthorizerIdfrom thefirefly-api-gatewaystack outputs. - SAM build.
- SAM deploy with parameters:
ApiIdAuthorizerIdDynamoDbFirmwareTableName(from vars)FirmwarePrivateBucketName(from secrets)FirmwarePublicBucketName(from secrets)
Sequence Diagram
Delete Workflow
Description
Runs sam delete to remove the CloudFormation stack and the Lambda function.
Steps
- Configure AWS credentials.
- SAM delete
firefly-func-api-firmware-delete.
Sequence Diagram
Failure Scenarios
| Scenario | Behavior |
|---|---|
| Authorizer ID lookup fails | describe-stacks returns an error or the output key is absent; workflow fails. The api-gateway stack must be fully deployed with the Cognito JWT authorizer before this workflow runs. |
| Public S3 bucket secret missing | Function deploys successfully but S3 operations on the public bucket fail at runtime when processing RELEASED firmware. |