cloudposse / cloudposse/atmos

Terraform workspace is left behind after an `atmos terraform destroy`

Open
#117 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
175
Avg merge
2d 3h
Merged PRs (30d)
134

Description

Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Feature

When an `atmos terraform destroy` is run without a target, once all the resources are successfully destroyed, the workspace should also be removed.

https://www.terraform.io/cli/commands/workspace/delete

```
# switch to the default workspace
terraform workspace select default
# finally delete the old workspace
terraform workspace delete
```

Perhaps this can also be another input configuration var in atmos.yaml

Contributor guide

Open the contributing guide

Research direction

Start at the implementation of `atmos terraform destroy` and trace the no-target path after resources are removed. Consult Terraform's workspace select and delete commands, then verify that the destroyed stack workspace is removed while the default workspace remains available. Done means an un targeted destroy cleans up the workspace without affecting targeted destroys.

Written by the indexing model from the issue text.

Assessment

Tech stack
terraform
Domain
cli, devops, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.