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

Changing field s of a section gives unexpected results (re-labeling of existing fields and thus data moved) #77

Open
daniel-ciaglia opened this issue Apr 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@daniel-ciaglia
Copy link

Your environment

Terraform Provider Version: 1.1.4 (latest)
Connect Server Version: 1.5.7
OS: MacOS 13.3 on M1
Terraform Version: 1.4.4

What happened?

  • create a basic item

  • create a section with 3 fields (no values)

  • fields named a_password, b_password, z_password

  • terraform apply

  • added values manually to fields

  • added a new field name c_password

  • terraform apply

  • ~ field {
          id    = "hmaa7pivgm6qro75zlelovwab4"
        ~ label = "z_password" -> "c_password"
          # (1 unchanged attribute hidden)
      }
    + field {
        + label = "z_password"
        + type  = "CONCEALED"
      }
    
  • label for field z_password was changed to c_password and thus manual data are now available in the wrong field

What did you expect to happen?

  • new field with label c_password

Steps to reproduce

  1. see above, source code attached below, authentication is stored in AWS Secrets manager for Connect authentication
  2. I tried to give an id to the field, but this id was happily changed as well

Source code

terraform {
  required_version = ">= 1.4.0"

  required_providers {
    onepassword = {
      source  = "1Password/onepassword"
      version = "~> 1.1.4"
    }
  }
}

# ########################## 1Password config ############################
# the configuration for connecting to 1password Agent

data "aws_secretsmanager_secret" "onepassword_token" {
  name = "onepassword-token"
}
data "aws_secretsmanager_secret_version" "onepassword_token" {
  secret_id = data.aws_secretsmanager_secret.onepassword_token.id
}

provider "onepassword" {
  url   = "http://localhost:8080"
  token = data.aws_secretsmanager_secret_version.onepassword_token.secret_string
}

locals {
  one_password_vault = "your-vault-goes-here"
}

data "onepassword_vault" "this" {
  name = local.one_password_vault
}

# plain resources
resource "onepassword_item" "plain" {
  vault = data.onepassword_vault.this.uuid

  title    = "plain"
  category = "password"

  section {
    label = "collector"
     field {
      label = "a_password"
      type  = "CONCEALED"
    }
    field {
      label = "b_password"
      type  = "CONCEALED"
    }
    # initially commented out
    # field {
    #   label = "c_password"
    #   type  = "CONCEALED"
    # }
    field {
      label = "z_password"
      type  = "CONCEALED"
    }
  }
}

@daniel-ciaglia daniel-ciaglia added the bug Something isn't working label Apr 5, 2023
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

1 participant