Lab Cleanup

Before deleting the CloudFormation stack, you must first remove some resources.

  • Reverse the manual IAM changes

    • Navigate to the IAM Console
    • Select Roles and search for the role with sampleapp in its name
    • Remove the manually added policy AmazonSSMManagedInstanceCore
  • Remove IAM instance profiles from the EC2 instances

    • Navigate to the EC2 Console
    • Select the first instance called Lab App host
    • Select “Actions»Security»Modify IAM Role”
    • Remove the IAM role from the instance
    • Repeat the process for the other EC2 instance
  • Delete the Stack

    • Navigate to the CloudFormation console
    • Select the base stack (The one without the word nested next to it) radio button
    • Click the Delete button
    • Click the Delete Stack button
  • Delete the manually created EventBridge rules

  • Delete CloudWatch Items Navigate to CloudWatch and delete:

    • Lab-canary in Canaries (stop then delete)
    • application.log Log Group in Log groups
    • boot.log Log Group in Log groups
    • messages Log Group in Log groups
    • production.log Log Group in Log groups
    • All Sample App CLoudWatch Alarms from the lab in Alarms
    • Sample App Dashboard created displaying logs, metrics and alarms