Delete Project

Now that we’ve seen how to deploy a Sinatra project with Jets let’s clean up and delete the resources. To delete everything, run:

jets delete

You’ll be prompted to make sure you want to delete the project.

❯ jets delete
Will delete sinatra-dev

Uses remote runner to delete the stack and resources.

Are you sure? (y/N)

Type y and hit enter.

Are you sure? (y/N) y
Packaging code for deployment: sinatra-dev
Started remote run for delete
Console Log Url:
Phase: SUBMITTED Status: SUCCEEDED Duration: 0s
Phase: QUEUED Pending
Phase: QUEUED Status: SUCCEEDED Duration: 0s
Phase: PROVISIONING Status: SUCCEEDED Duration: 6s
[Container] 2024/04/09 04:47:28.608493 Running command ./jets-go delete
Extracting app code
Running: jets-remote delete
Syncing bootstrap to delete stack: sinatra-dev
Waiting for stack to complete
04:47:34AM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack sinatra-dev User Initiated
04:47:37AM UPDATE_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack sinatra-dev
04:47:38AM DELETE_IN_PROGRESS AWS::IAM::Policy IamPolicy
04:47:38AM DELETE_IN_PROGRESS AWS::CloudFormation::Stack JetsPrewarmEvent
04:47:38AM DELETE_IN_PROGRESS AWS::CloudFormation::Stack Controller
04:47:39AM DELETE_COMPLETE AWS::IAM::Policy IamPolicy
04:47:49AM DELETE_COMPLETE AWS::CloudFormation::Stack Controller
04:48:39AM DELETE_COMPLETE AWS::CloudFormation::Stack JetsPrewarmEvent
04:48:40AM DELETE_IN_PROGRESS AWS::Lambda::LayerVersion GemLayer
04:48:40AM DELETE_COMPLETE AWS::Lambda::LayerVersion GemLayer
04:48:52AM UPDATE_COMPLETE AWS::CloudFormation::Stack sinatra-dev
Stack success status: UPDATE_COMPLETE

Emptying s3 bucket sinatra-dev-s3bucket-hblotmmffffs
Waiting for stack to complete
04:49:07AM DELETE_IN_PROGRESS AWS::CloudFormation::Stack sinatra-dev User Initiated
04:49:09AM DELETE_IN_PROGRESS AWS::S3::Bucket S3Bucket
04:49:09AM DELETE_IN_PROGRESS AWS::CodeBuild::Project Codebuild
04:49:10AM DELETE_COMPLETE AWS::CodeBuild::Project Codebuild
04:49:11AM DELETE_COMPLETE AWS::S3::Bucket S3Bucket
04:49:11AM DELETE_IN_PROGRESS AWS::IAM::Role CodebuildRole
Stack sinatra-dev deleted.

How Jets Delete Works

  1. Jets packages code and uploads it to S3 to handle deletion.
  2. The Remote Runner syncs a bootstrap stack which removes and deletes most of the resources.
  3. The final step performs the remaining deletion of the S3 bucket and CodeBuild Remote Runner.

Since everything is codified, you nicely end up back in a clean state. 😄

Congrats! You have successfully created, modified, and deleted a Jets sinatra project.

Next, we’ll look at some next steps.