Decommissioning Zappa

Once the SAM stacks have run without a rollback for an agreed soak period:

  1. Remove the Zappa deployments. Run zappa undeploy prod_rules2 and zappa undeploy test_rules2 from a checkout of e888027 (the Zappa settings are no longer on the new branches), or delete the functions, the ny63bqmiol API and the EventBridge rules named in Zappa to SAM cutover by hand.

  2. Delete leftovers that point at functions that no longer exist (production account):

    Resource Points at

    em_events_create_event subscription 4c7f5d7a-82f7-45f7-873b-cb29a307f16e

    eventloggerapp-test-rules2 (deleted)

    em_events_create_event subscription 7fc94fcc-2668-4569-a6b2-bc8dc8d1c578

    eventloggerapp-prod-rules3 (deleted)

    Event source mapping 7a0533be-11c9-4cd8-acf3-29756079cb4c (disabled, em_events_staging)

    eventloggerapp-test-rules2 (deleted)

    API eventloggerapp-prod-rules3

    nothing

    export AWS_PROFILE=prod AWS_REGION=us-east-1
    aws sns unsubscribe --subscription-arn arn:aws:sns:us-east-1:625663093496:em_events_create_event:4c7f5d7a-82f7-45f7-873b-cb29a307f16e
    aws sns unsubscribe --subscription-arn arn:aws:sns:us-east-1:625663093496:em_events_create_event:7fc94fcc-2668-4569-a6b2-bc8dc8d1c578
    aws lambda delete-event-source-mapping --uuid 7a0533be-11c9-4cd8-acf3-29756079cb4c
    aws apigateway get-rest-apis --query "items[?name=='eventloggerapp-prod-rules3'].id"   # then delete-rest-api
  3. Delete the Zappa buckets app-eventlogger—​prod-rules2 (production) and app-eventlogger—​test-rules-dev (staging), after emptying them.

  4. Remove the legacy CodeBuild project EventLoggerApp once no branch needs it, or keep the webhook filter from the cutover preparation.