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

[ BUG ] - wallix-bastion_domain_account_credential #17

Open
FranckSallet opened this issue Mar 27, 2024 · 9 comments
Open

[ BUG ] - wallix-bastion_domain_account_credential #17

FranckSallet opened this issue Mar 27, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@FranckSallet
Copy link

Describe the bug
When we reset a password on a global account, the "wallix-bastion_domain_account_credential" resource associated with it is deleted and is therefore recreated on the next "terraform apply"

To Reproduce
Steps to reproduce the behavior:

  1. create a "wallix-bastion_domain_account" and a "wallix-bastion_domain_account_credential" with terraform
  2. change the password through the web interface
  3. run a "terraform apply", the resource "wallix-bastion_domain_account_credential" will be recreated

Expected behavior
we need to be able to change a password on a global account without the resource "wallix-bastion_domain_account_credential" being affected. not to mention the password policy and the password checkin/checkout...

Feature Request
it would be necessary to be able to propagate the password when creating the resource "wallix-bastion_domain_account_credential"

thanks for the support

@FranckSallet FranckSallet added the bug Something isn't working label Mar 27, 2024
@bsimonWallix
Copy link
Collaborator

Hello @FranckSallet, this is a normal behaviour of Terraform. Between what is in state and the reality there is differences so the recreation is done.

One way to overcome those kind of event is to use the lifecycle meta-data with an ignore-changes or you can use the import capacity before doing the apply.

I will do some testing around it.

For the Feature request, could you create a new issue as a Feature Request with a bit more of information of what you want to achieve by that.

Best regards,

@bsimonWallix bsimonWallix self-assigned this Mar 29, 2024
@FranckSallet
Copy link
Author

Hello @bsimonWallix
Thank you for the answer. I tested the proposal and it works well. I use lifecycle on password parameter.
It's quite confusing because you can use the global account as a simple target account, but in my case it is used to manage the password of an active directory account.
Greetings

@FranckSallet
Copy link
Author

FranckSallet commented Mar 29, 2024

I'm reopening the case because there is indeed a bug.
After several tests I see that the "wallix-bastion_domain_account_credential" resource is completely recreated even if I only changed the password from the GUI.

I don't understand how to bypass this with the lifecycle meta-argument

below the terraform plan after a password reset through the GUI:

  # wallix-bastion_domain_account_credential.mapped_account_cred["fsallet"] will be created
  + resource "wallix-bastion_domain_account_credential" "mapped_account_cred" {
      + account_id = "ecr.fsallet"
      + domain_id  = "domain.local"
      + id         = (known after apply)
      + password   = (sensitive value)
      + public_key = (known after apply)
      + type       = "password"
    }

below tf config:

resource "wallix-bastion_domain_account_credential" "pwd_reset_account_cred" {
  count       = var.customer_mapping_domain != null ? 1 : 0
  domain_id   = var.customer_mapping_domain
  account_id  = var.pwd_reset_account_login
  type        = "password"
  password    = var.pwd_reset_account_pwd
  lifecycle {
    ignore_changes = [
      password
    ]
  }
}

Regards

@bsimonWallix
Copy link
Collaborator

bsimonWallix commented Apr 2, 2024

Hi @FranckSallet,

I can't reproduce the issue with or without the lifecycle meta-data.

We don't refresh password, passphrase and privatekey fields.

  • passphrase (Optional, String, Sensitive, Value can't refresh)
    The passphrase for the private key (only for an encrypted private key).
  • password (Optional, String, Sensitive, Value can't refresh)
    The account password.
  • private_key (Optional, String, Sensitive, Value can't refresh, Forces new resource)
    The account private key.

Maybe this is due to the count.

Are you doing a loop on a list of accounts ?

If the list order change this can explain the recreation of the ressource.

@FranckSallet
Copy link
Author

Hi @bsimonWallix

I just figured out where the bug comes from.

You are rigth, we can change the password of a "wallix-bastion_domain_account_credential" resource from the GUI with no impact on the terraform. But if you enable "propagate credential change", the resource "wallix-bastion_domain_account_credential" is deleted and terraform terraform will try to recreate it.

Regards

@FranckSallet
Copy link
Author

Hi @bsimonWallix

Were you able to reproduce the problem ?
Have you been able to make progress about this case ?

Regards, Franck

@bsimonWallix
Copy link
Collaborator

Hello, we reproduce the behaviour. Currently it's lacking API endpoint to leverage it.
We are looking on how to manage that but nothing yet.

Best Regards,

@FranckSallet
Copy link
Author

Hi @bsimonWallix

have you made progress on version 0.14.0 of the provider ?
have a release date planned ?

Regards

@bsimonWallix
Copy link
Collaborator

Hello, @FranckSallet not yet. There is changement on API regarding futur version of bastion and we will link this next version to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants