Workshop Cleanup

Congratulations, you have completed this workshop! Your next challenge is to remove all of the resources that were provisioned in your account so as to ensure that no additional cost can be incurred. Please note that the steps below should be implemented in order - some later steps have dependancies on earlier ones!

DELETE ALL OBJECTS WITHIN THE S3 BUCKET CREATED BY CLOUDFORMATION

When you attempt to delete the CloudFormation template that you deployed during the Workshop Preparation, the S3 bucket that it provisioned will not be able to be removed unless it is empty. Delete all objects in this bucket (note, you don’t need to remove the bucket itself).

Click to reveal detailed instructions

MODIFY THE JENKINS MASTER ECS SERVICE SO THAT 0 TASKS ARE DESIRED

Before the EC2 instances that comprise your ECS cluster can be terminated, you’ll need to ensure that no containers are running in the cluster. The containers hosting your build agents are likely already stopped as they only remain online for a few seconds after your build jobs have completed - but the container running Jenkins needs to be stopped.

Click to reveal detailed instructions

DELETE ALL AUTO SCALING GROUPS;

As was the case with EC2 instances created by Spot Fleet requests, you won’t be able to terminate an EC2 instance that belongs to the Auto Scaling Group that you created without the Auto Scaling Group re-launching a new instance to replace the one that you terminated. Therefore, the Auto Scaling Group that you created in Lab 4 must be deleted.

Click to reveal detailed instructions

CANCEL ALL REMAINING SPOT REQUESTS

The CloudFormation template will not be able to delete subnet and VPC resources if there are EC2 resources still running. Spot fleets are an interesting case though - if you terminate an EC2 instance belonging to a fleet, the fleet will attempt to re-launch it (as shown in Lab 3). Therefore you will need to ensure that all of the Spot Fleets that you created in this workshop have been cancelled.

Click to reveal detailed instructions

ENSURE THAT ALL EC2 INSTANCES HAVE BEEN TERMINATED

Having removed all of the Spot Fleets and Auto Scaling groups from the VPC that was created by the CloudFormation template deployed during the Workshop Preparation, you should double-check that all EC2 instances used during the workshop have been terminated.

Click to reveal detailed instructions

DELETE ALL CLOUDFORMATION STACKS

Once you’ve checked that all EC2 instances have been terminated and there are no objects present in the S3 bucket used for deployment artifacts, you can remove the CloudFormation template that you deployed during the Workshop Preparation.

Click to reveal detailed instructions

The Lambda functions used throughout the workshop (notably, to create and tear down the testing environment in Lab 2, and to look up the latest version of various AMIs throughout the workshop) wrote log entries to CloudWatch Logs. These should be removed.

Click to reveal detailed instructions

REMOVE THE AMAZON EC2 KEYPAIR CREATED DURING THE WORKSHOP PREPARATION

The final resource that needs to be removed was the first one that you created - the EC2 Key Pair that you created prior to launching the CloudFormation stack.

Click to reveal detailed instructions

THANK YOU

At this point, we would like to than you for attending this workshop.