Skip to main content

Destroy or Delete Infrastructure via Portal

In this section, you will find a guide on how to destroy or delete your Infrastructure via the StackSpot EDP Portal.


Destroy an Infrastructure

In StackSpot EDP, destroying an Infrastructure is an irreversible action and can only be performed one environment at a time.

The destruction of an Infrastructure can only occur when there is no Connection Interface in the environment that is shared with other Infrastructures. If there are Connection Interfaces shared with other Infrastructures, StackSpot EDP displays those Connection Interfaces with their respective environments and Infrastructures.

tip
  • Using the Check Connection Interfaces button, you can check which Workspace is using the Connection Interface shared with the Application or Infrastructure. This button is only displayed when there is a deployment in any environment.

  • To destroy an Infrastructure, you must have the shared_infra:destroy permission.

To destroy an Infrastructure, you must remove the infra-type Plugins from it before running the destruction workflow. To do this, use the stk remove plugin command and then perform an empty deployment, with the infra Plugins removed.

If you prefer to run the process via the StackSpot EDP Portal, follow these steps.

Step 1. Access your Workspace in the StackSpot EDP Portal and click the Infrastructures section in the main menu.

Step 2. Click the Infrastructure you want to destroy and then click the Settings subsection.

Step 3. Click the Destroy Infrastructure button.

Step 4. Fill in the following information:

  • Branch: select the branch where the Infrastructure you want to destroy is located.
  • Type the word DESTROY in the requested field.
danger
  • You can only destroy an Infrastructure in one environment at a time.
  • To be able to delete an Infrastructure from the Workspace later, you must first destroy the deployments in all environments where it was provisioned.

Step 5. Click the Destroy Infrastructure button.

When the Infrastructure destruction workflow finishes, StackSpot EDP creates a Pull Request (PR) in the Infrastructure repository. This PR removes the Infra Plugins from the Infrastructure YAML file.

After you merge this PR and deploy the updated Infrastructure, the destruction process is complete.


Delete an Infrastructure

In StackSpot EDP, deleting an Infrastructure can only occur when there are no deployments made in any environment of that Infrastructure. Additionally, deletion is an irreversible action.

When an Infrastructure is deleted, StackSpot EDP also performs the following actions:

  • The Infrastructure is removed from the Workspace.
  • Plugins associated with the Infrastructure are also removed or unlinked.
  • The Infrastructure name is appended with the suffix _deleted, for example, my-app-name-deleted.
warning

To delete an Infrastructure, you must have the shared_infra:delete permission.

Prerequisites

You can only delete an Infrastructure created in the Workspace when:

  1. There is no Connection Interface from this Infrastructure being used by another Application or Infrastructure in StackSpot.

  2. There is no deployment running, that is, the Status is not running in Activities.

  3. If the deployment of your Infrastructure was done using the Self-hosted Runtime, you must:

    • Remove the infra-type Plugins from your Infrastructure by using the stk remove plugin command;
    • Then, perform an empty deployment, that is, with the Infra Plugins already removed.

This way, you push an empty version to StackSpot EDP, allowing you to delete your Infrastructure via the StackSpot EDP Portal.

Before deleting your Infrastructure, ensure there are no active deployments. When an Infrastructure is deleted, all associated deployments are also deleted.

To delete an Infrastructure, follow these steps:

Step 1. Log in to the StackSpot EDP Portal and access the Workspace that contains the Infrastructure.

Step 2. In the Workspace menu, click Infrastructures and select the Infrastructure you want to delete.

Step 3. On the Infrastructure page, click the Settings section.

Step 4. Click the Delete Infrastructure button.

Step 5. Type the word DELETE in the requested field and then click Delete Infrastructure again to confirm.

Done! You deleted your Infrastructure.