Skip to content

Cleanup The Environment

In this section, we will clean up the environment. First delete the workshop environment, then the Flight Simulator environment.

Delete the Workshop Environment

  1. Inside the OpenVSCode server, open an embedded Terminal. Use the hamburger button (≡) in the top left corner to find the New Terminal menu item.

  2. Change into the ~/code/ace135/src/infrastructure/ directory and destroy Terraform resources

    cd ~/code/ace135/src/infrastructure/
    export TF_VAR_region="us-east-2"
    terraform destroy -auto-approve
    

    IMPORTANT

    Wait for your workshop environment to finish being destroyed - typically 10-15 minutes.

    Sample Output
    student@ace135.sans.labs ~/code/ace135/src/infrastructure (main)$ terraform destroy -auto-approve
    
    random_id.deployment_id: Refreshing state... [id=SMCm4Q]
    data.aws_iam_policy_document.eks_assume_role: Reading...
    aws_cloudwatch_query_definition.unique_ports: Refreshing state... [id=5e9f4ad4-b66f-4698-822f-fb2a205724ba]
    aws_cloudwatch_query_definition.k8s_image_creation: Refreshing state... [id=721a2a8e-2a9d-4145-81cd-165ace0caaaf]
    data.aws_caller_identity.this: Reading...
    ...
    aws_eks_node_group.aviata: Still destroying... [id=aviata-eks-cluster:aviata-eks-node-group, 8m10s elapsed]
    aws_eks_node_group.aviata: Still destroying... [id=aviata-eks-cluster:aviata-eks-node-group, 8m20s elapsed]
    aws_eks_node_group.aviata: Destruction complete after 8m20s
    ...
    aws_cloudwatch_log_group.cluster_dataplane_logs: Destruction complete after 0s
    aws_cloudwatch_log_group.cluster_host_logs: Destruction complete after 0s
    aws_cloudwatch_log_group.cluster_logs: Destruction complete after 0s
    aws_cloudwatch_log_group.cluster_application_logs: Destruction complete after 0s
    
    Destroy complete! Resources: 87 destroyed.
    student@ace135.sans.labs ~/code/ace135/src/infrastructure (main)$
    

Delete the Flight Simulator Environment

  1. Connect to a CloudShell terminal in us-east-2 and run the following commands:

    cd ~/ace135/
    terraform destroy -auto-approve
    
    Sample Output
    ...
    aws_vpc.main: Destroying... [id=vpc-06e3124fc44078f9f]
    aws_vpc.main: Destruction complete after 0s
    random_pet.ssh_key_name: Destroying... [id=emerging-marten]
    random_pet.ssh_key_name: Destruction complete after 0s
    
    Destroy complete! Resources: 20 destroyed.
    [cloudshell-user@ip-10-134-86-227 ace135]$