Clean up resources

You would clean up resources in the following order:

  1. Access the management interface of AWS Step Functions.
  • Click on state machine ApplicationProcessingStateMachine-xxxxxxxxxxxx.
  • Click on the execution that is running.

AWS Step Functions

  1. Click Stop execution to stop the execution of the state machine.

AWS Step Functions

Make sure no more executions are in running state before you proceed to the next step. AWS Cloud Formation will not perform state machine deletion if there is still execution running.

  1. Return to the Cloud9 Instance interface. run the following command to delete the AWS CloudFormation stack that AWS SAM created for our application.
REGION=$(grep region samconfig.toml | awk -F\= '{gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}')
STACK_NAME=$(grep stack_name samconfig.toml | awk -F\= '{gsub(/"/, "", $2); gsub(/ /, "", $2); print $2}')
aws cloudformation delete-stack --region $REGION --stack-name $STACK_NAME

AWS Step Functions

  1. Access the management interface Cloud9 service
  • Select Cloud9 Instance StepFunctions.
  • Click Delete.

AWS Step Functions

  1. Enter Delete to confirm.
  • Click Delete to proceed to delete Cloud9 Instance.

AWS Step Functions