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

Resource management of items created manually #212

Open
kip-13 opened this issue Feb 3, 2025 · 3 comments
Open

Resource management of items created manually #212

kip-13 opened this issue Feb 3, 2025 · 3 comments
Labels
question Further information is requested

Comments

@kip-13
Copy link

kip-13 commented Feb 3, 2025

Hey 👋

Thanks for this amazing provider, we are testing it to manage the items from vaultwarden but we have a dilemma.
Is there any possibility to implement the management of resources created manually? Something like mentioned here for aws for example.

Our tests are using data sources and then take the id from them to manage changes of it through resources but they ended up in a new item always.

Thanks again.

@kip-13
Copy link
Author

kip-13 commented Feb 4, 2025

Perhaps this is the strategy that could be implemented but from the id:

bitwarden/cli#98 (comment)

@maxlaverse
Copy link
Owner

Hi @kip-13,
What kind of existing resources are you interested in managing. I think you have two main possibilities:

  1. Importing resources in your workspace, using the terraform/tofu import command (example for bitwarden_secret). This is useful if you want to manage a existing resource entirely with Terraform. If you later you decide to have it manage outside of Terraform, you still could run terraform state rm to remove it from the state.
  2. Using Data Source, to read information from an existing Bitwarden resource and use it with other resources (example for bitwarden_folder).

@maxlaverse maxlaverse added the question Further information is requested label Feb 5, 2025
@kip-13
Copy link
Author

kip-13 commented Feb 5, 2025

Hi @maxlaverse,
Thanks for the quick answer.

What kind of existing resources are you interested in managing

We are trying to update an existent secure_note in vaultwarden, as I said before it doesn't matter if we set the id attr for the resource fetched from data because that id doesn't mean the secure_note id from vaultwarden.

Importing resources in your workspace, using the terraform/tofu import

So from the options you mentioned, probably the import is the easiest one without change in the code or logic, we missed that part of the docs.

Thanks again.

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

No branches or pull requests

2 participants