DelineaXPM / terraform-provider-tss

MIT License
7 stars 3 forks source link

Unable to update secret #84

Open amolpati1 opened 2 weeks ago

amolpati1 commented 2 weeks ago

Unable to update secret

On trying to update secret, it fails with terraform resource tries create it instead of modifying it and fails with error. Error: 400 Bad Request: { │ "errorCode": "API_DuplicateSecretName", │ "message": "A Secret with this name already exists." │ } │ │ with tss_resource_secret.secret_name, │ in resource "tss_resource_secret" "secret_name": │ 64: resource "tss_resource_secret" "secret_name" {

Expected behavior Secret values should be updated.

Tell us what should happen

Actual behavior

Tell us what actually happens

Your environment

Tell us more about your environment; such as, What OS are you running? What version of pluginName are you using? Etc. Windows Server 2019 Standard DelineaXPM/terraform-provider-tss Version: 2.0.8

Steps to reproduce

Tell us how to reproduce this issue. Please include code examples as necessary. terraform { required_providers { tss = { source = "DelineaXPM/tss" version = "2.0.8" } } }

variable "tss_username" { type = string default = "xxxxuser" }

variable "tss_password" { type = string sensitive = true }

variable "tss_server_url" { type = string default = "https://test.secretservercloud.com" }

variable "tss_secret_name" { type = string default = "existingSecretName" }

variable "tss_secret_siteid" { type = string default = "1" }

variable "tss_secret_folderid" { type = string default = "1" }

Secret template type: Password

variable "tss_secret_templateid" { type = string default = "2" }

variable "fields" { type = list(object({ itemvalue = string fieldname = string })) default = [ { fieldname = "Notes" itemvalue = "Test edit with TF Provider " } ] }

provider "tss" { username = var.tss_username password = var.tss_password server_url = var.tss_server_url }

resource "tss_resource_secret" "secret_name" { name = var.tss_secret_name folderid = var.tss_secret_folderid siteid = var.tss_secret_siteid secrettemplateid = var.tss_secret_templateid active = true dynamic "fields" { for_each = var.fields content { fieldname = fields.value.fieldname itemvalue = fields.value.itemvalue } } }

ModifySecret Trace.txt

amolpati1 commented 3 days ago

Any update on the issue?

amolpati1 commented 2 hours ago

Are there any developments regarding the issue?