Deleting Assets
Deleting assets in Firefly removes them from your cloud environment or from your Infrastructure as Code (IaC) repository, depending on how the asset is managed. This guide explains how to safely delete both unmanaged (cloud-only) assets and codified (managed by IaC) assets, including drifted and ghost resources.
WARNING: Deleting assets is a destructive action. When you delete an asset using the CLI commands provided by Firefly, the resource is permanently removed from your cloud provider. Always double-check your selection before proceeding.
Deleting Unmanaged Assets
Unmanaged assets are resources that exist in your cloud environment but are not managed by your IaC code. To delete these assets:
Go to Inventory: In the Firefly console, navigate to the Inventory page. This lists all discovered assets, including unmanaged ones.
Select the asset(s) to delete: Find and select the unmanaged asset(s) you want to remove. Unmanaged assets are typically marked as such in the inventory list.
Click the trash icon: With the asset(s) selected, click the trash (delete) icon. Firefly will generate the appropriate CLI command(s) for your cloud provider to delete the resource(s).
Copy and run the CLI command(s): Copy the provided CLI command(s) and run them in your cloud provider's command line interface (e.g., AWS CLI, Azure CLI, GCP CLI). This action will delete the asset(s) from your cloud environment.
Note: The exact CLI command will depend on the asset type and cloud provider. Always review the command before executing it.
Deleting Codified, Drifted, or Ghost Assets (via IaC)
Codified assets are managed by your IaC code (such as Terraform). Drifted assets have diverged from their IaC definition, and ghost assets are resources that exist in code but not in the cloud. To delete these types of assets, you must update your IaC repository.
Before you begin
Ensure the IaC file for the asset you want to remove is present in the Version Control System (VCS) integrated with Firefly (e.g., GitHub, GitLab).
Procedure
Go to Inventory: In the Firefly console, navigate to the Inventory page.
Select the asset(s) and click the trash icon: Find the codified, drifted, or ghost asset(s) you want to delete. Select them and click the trash (delete) icon.
Choose how to update the code:
To remove the asset from code, leave the 'Comment out code' toggle off. Firefly will generate a code change that deletes the resource block from your IaC file.
To make the asset inactive without deleting the code, switch the 'Comment out code' toggle on. This will comment out the resource block, making it inactive but still present in the file.
Create a Pull Request: Click 'Create Pull Request' to propose the code change in your VCS. This allows your team to review and approve the deletion.
Merge the Pull Request: After approval, merge the pull request into your main branch. This updates your IaC repository to reflect the asset removal.
Apply the change in your cloud environment:
Run
terraform apply
to update your cloud environment and remove the asset.Alternatively, run
terraform destroy
if you want to remove all resources defined in the IaC file.
Tip: Commenting out code is useful if you want to temporarily disable a resource without deleting its configuration. Removing the code entirely is best for permanent deletions.
Summary
Use the CLI command for unmanaged assets to delete them directly from the cloud.
For codified, drifted, or ghost assets, update your IaC code and apply the changes to remove the asset from both code and the cloud.
Always review destructive actions and code changes before applying them to production environments.
Last updated
Was this helpful?