pactflow / terraform-provider-pact

Terraform provider for Pact Broker (and Pactflow)
https://pactflow.io
MIT License
24 stars 4 forks source link

Feat: support importing IDP based users #25

Closed mefellows closed 2 years ago

mefellows commented 2 years ago

From https://pact-foundation.slack.com/archives/C02NN7XSHDM/p1654665175466349?thread_ts=1654480938.633869&cid=C02NN7XSHDM

If you want to import a user with a different identity provider (e.g. SAML), you can't, because it always will try to create another user, and in this case it'll use Pactflow as identity provider by default.

For example, if you wanted to import as user as follows:terraform state rm pact_user.john_doe; terraform import pact_user.john_doe df33f287-4cd2-4469-943b-ccb0edc2f3bd, any future terraform plan (or apply) will attempt to re-create the user:

  # pact_user.john_doe must be replaced
-/+ resource "pact_user" "john_doe" {
      ~ active = false -> true
      ~ id     = "d97a9d4d-89cc-4337-8dcf-5517a34312e7" -> (known after apply)
        name   = "John Doe"
      + roles  = [
          + "d635f960-88f2-4f13-8043-4641a02dffa0"
        ]
      + type   = "user" # forces replacement
      ~ uuid   = "d97a9d4d-89cc-4337-8dcf-5517a34312e7" -> (known after apply)
        # (1 unchanged attribute hidden)
    }