Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating folder UID not allowed #34

Open
Learloj opened this issue Aug 5, 2024 · 1 comment
Open

Updating folder UID not allowed #34

Learloj opened this issue Aug 5, 2024 · 1 comment

Comments

@Learloj
Copy link

Learloj commented Aug 5, 2024

Since it is allowed to work with subfolders as addressed in #17 we want to move our secrets to a subfolder. When we update this in Terraform (setting the folder_uid to another value), the plan looks good, but the apply fails:

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # secretsmanager_login.basrtest will be updated in-place
  ~ resource "secretsmanager_login" "basrtest" {
      ~ folder_uid = "<old UID>" -> "<new UID>"
        id         = "<record ID>"
        # (4 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
secretsmanager_login.basrtest: Modifying... [id=<record ID>]
╷
│ Error: changes to folder_uid, uid, and type are not allowed
│
│   with secretsmanager_login.basrtest,
│   on main.tf line 18, in resource "secretsmanager_login" "basrtest":
│   18: resource "secretsmanager_login" "basrtest" {

When I execute the plan and apply with -replace=<resource it works fine, and the resource is removed from the old folder and recreated in the new folder.

I think this provider should automatically recreate the resource when the folder_uid is updated.

@idimov-keeper
Copy link
Contributor

This will be addressed in the next release - the only limitation is that both old/new folders must exist for the record to move between them. We will also add some new folder management resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants