Skip to content

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

SettingValue
Log group/aws/lambda/firefly-func-api-firmware-delete
Retention30 days

Dependencies

Deploy Dependencies

WorkflowReason
api-gatewayAPI Gateway ID and Cognito JWT Authorizer ID required as SAM parameters
shared-layerLambda layer ARN must be resolvable at SAM build/deploy time

Delete Dependencies

None — this workflow has no prerequisites.

Required By

Required By Deploy

WorkflowReason
run-integration-testsFirmware delete endpoint must exist before integration tests run

Required By Delete

WorkflowReason
api-gatewayAll Lambda integrations must be removed before the API Gateway stack can be deleted
shared-layerLayer 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

  1. Configure AWS credentials.
  2. Look up ApiId and AuthorizerId from the firefly-api-gateway stack outputs.
  3. SAM build.
  4. SAM deploy with parameters:
    • ApiId
    • AuthorizerId
    • DynamoDbFirmwareTableName (from vars)
    • FirmwarePrivateBucketName (from secrets)
    • FirmwarePublicBucketName (from secrets)

Sequence Diagram

Deploy Sequence

Delete Workflow

Description

Runs sam delete to remove the CloudFormation stack and the Lambda function.

Steps

  1. Configure AWS credentials.
  2. SAM delete firefly-func-api-firmware-delete.

Sequence Diagram

Delete Sequence

Failure Scenarios

ScenarioBehavior
Authorizer ID lookup failsdescribe-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 missingFunction deploys successfully but S3 operations on the public bucket fail at runtime when processing RELEASED firmware.