You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the provider does not handle manually item property changes very well. Mainly for username and url the behaviour is strange in various ways. Example:
Setting username and url to null will not touch the item property in 1Password. Thats desired behaviour.
Setting username and url to a valid String e.g."xxx" will overwrite underlaying values. Thats also expected.
Setting username and url to "" will result in When applying changes to onepassword_item.test, provider produced an unexpected new value: .username: was cty.StringVal(""), but now null error message. See below.
Setting username and url to null after manually changed those properties beforehand will result in overwriting the value in 1Password. This is not expected (see below).
What did you expect to happen?
The following behaviour would be expected based on the scenarios 3 and 4 from above:
username and url = "": this should "reset" the property in 1Password i.e. the value of this property should be unset after apply.
username and url = null or not set in resource: should leave the value for the item in 1Password untouched i.e. ignored by Terraform.
Steps to reproduce
Imagine the following test scenario:
create an item leaving username and url unset in onepassword_item
manually set those item properties
reapply the resource -> no changes should be planed
set the item properties in Terraform e.g. username = "test" and reapply -> properties should be set by Terraform
unset the item properties in Terraform e.g. username = "" and reapply -> properties should be empty (unset i.e. without value) again
Notes & Logs
We use the provider to create items that are populated with values derived directly from Terraform resources as well as placeholder items with predefined properties that are not set and needs to stay untouched by Terraform. The 1.4 version of the provider was able to handle those scenarios however it disappear with version 2.
Sadly the unit tests implemented are not very flexible and it seems to me that some integration tests will be needed to make sure the behaviour is like described above. Do you have any integration tests available or planned? I'm happy to share mine ;).
The text was updated successfully, but these errors were encountered:
Your environment
Terraform Provider Version: 2.1.2
OS: macOS Sonoma
Terraform Version: 1.5.7
What happened?
The current implementation of the provider does not handle manually item property changes very well. Mainly for
username
andurl
the behaviour is strange in various ways. Example:username
andurl
tonull
will not touch the item property in 1Password. Thats desired behaviour.username
andurl
to a valid String e.g."xxx"
will overwrite underlaying values. Thats also expected.username
andurl
to""
will result inWhen applying changes to onepassword_item.test, provider produced an unexpected new value: .username: was cty.StringVal(""), but now null
error message. See below.username
andurl
tonull
after manually changed those properties beforehand will result in overwriting the value in 1Password. This is not expected (see below).What did you expect to happen?
The following behaviour would be expected based on the scenarios 3 and 4 from above:
username
andurl
=""
: this should "reset" the property in 1Password i.e. the value of this property should be unset after apply.username
andurl
=null
or not set in resource: should leave the value for the item in 1Password untouched i.e. ignored by Terraform.Steps to reproduce
Imagine the following test scenario:
username
andurl
unset inonepassword_item
username = "test"
and reapply -> properties should be set by Terraformusername = ""
and reapply -> properties should be empty (unset i.e. without value) againNotes & Logs
We use the provider to create items that are populated with values derived directly from Terraform resources as well as placeholder items with predefined properties that are not set and needs to stay untouched by Terraform. The 1.4 version of the provider was able to handle those scenarios however it disappear with version 2.
Sadly the unit tests implemented are not very flexible and it seems to me that some integration tests will be needed to make sure the behaviour is like described above. Do you have any integration tests available or planned? I'm happy to share mine ;).
The text was updated successfully, but these errors were encountered: