cloudposse / cloudposse/atmos

Allow easy renaming of components without workspace changes or resource recreations (need to create a plan or PRD before implementing)

Open
#2,244 1 comment 1 reaction 2 assignees Claimed by @nitrocode View on GitHub
Dominant language
Go
Stars
1.4k
Forks
175
Avg merge
2d 3h
Merged PRs (30d)
134

Description

### Describe the Feature

When a component is renamed, it changes the workspace

Original command

```
atmos terraform plan rds/hello-world-service -s ue1-dev
```

New command

```
atmos terraform plan hello-world-service/rds -s ue1-dev
```

Change in yaml

```diff
# ue1-dev.yaml
components:
terraform:
- rds/hello-world-service:
+ hello-world-service/rds:
```

This will change the workspace from something like

```
rds-hello-world-service-ue1-dev
```
to
```
hello-world-service-rds-ue1-dev
```

which will cause recreations with the new workspace and a stale older workspace.

Of course, one workaround is to set the `metadata.terraform_workspace`

```
metadata:
terraform_workspace: "custom-workspace-name"
```

---

It would be nice to have a feature that would allow renaming real component names

1. One way that can be done is by using a unique guid or some other form of an immutable workspace so if the real component is renamed, it won't change the workspace name.
2. Or perhaps another way would be we could run something like

```
> atmos rename component rds/hello-world-service hello-world-service/rds
Found 2 places where it's deployed

1. ue1-dev
2. ue2-dev

Do you want to migrate all of these workspaces? [y/N]:
```

Then it could rename that component across all stacks where it's deployed

3. Or another way to solve this problem? What is the best way? We can compare pros/cons/trade-offs/consequences.

### Expected Behavior

_No response_

### Use Case

_No response_

### Describe Ideal Solution

_No response_

### Alternatives Considered

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.