https://pact.io logo
Join Slack
Powered by
# terraform
  • j

    Jonatan Jaworski

    03/18/2022, 2:42 AM
    Hi team - Any chance we can either persist changes when the order of elements change in an array, or ignore the order altogether? Things like this create a loop where
    terraform plan
    always displays this change, and apparently nothing happens after doing
    terraform apply
    , so the only way of fixing it is manually changing the order in the tf files to match it, which is not practical when using references instead of the plain uuids (i.e, going:
    pact_user.john_doe.uuid
    )
    Copy code
    # pact_team.myTeam will be updated in-place
      ~ resource "pact_team" "myTeam" {
            id           = "b3a82ec1-a34e-4f82-845f-e41f9de3da78"
            name         = "MyTeam"
          ~ users        = [
                "967155a1-29a7-4aa3-8520-7bad949abad8",
              - "1e8c0d39-7937-4647-8886-9e40690e6886",
                "4e161b2b-b07a-4979-a69e-f5ed2727bfa4",
              - "50011c55-2fa0-4e70-b5e5-9592fc38e36a",
                "781a1bf2-9723-40c8-9cee-69ff9515c7f6",
              + "50011c55-2fa0-4e70-b5e5-9592fc38e36a",
              + "1e8c0d39-7937-4647-8886-9e40690e6886",
            ]
            # (2 unchanged attributes hidden)
        }
    m
    • 2
    • 7
  • r

    Rupam Saha

    03/21/2022, 9:43 AM
    Hello Everyone, We are trying to implement Contract testing and have almost completed the setup manually. Right now we are in the process of migrating our webhook setup into Terraform. But it seems like the new event
    contract_requiring_verification_published
    is not supported yet.
    Copy code
    Error: "events.0" must be one of the allowed events [contract_content_changed contract_published provider_verification_failed provider_verification_published provider_verification_succeeded], got contract_requiring_verification_published
    I am using
    version = "0.4.3"
    of the TF provider for Pact. Is there any plan in your roadmap to support it or any workaround? Thanks in advance 🙂
    m
    • 2
    • 6
  • r

    Rupam Saha

    03/21/2022, 12:22 PM
    Hi, I have hit another brick wall. I need to pass the Webhook parameters as
    query parameters
    and not
    request body
    . However, I could not find the relevant information in the documentation and seems
    body
    is a required field. Therefore, this is how my tried to write the request:
    Copy code
    request {
        url = "https://<jenkins-url>/generic-webhook-trigger/invoke?token=<token>&consumerName=CustomerWeb&monolithEnv=DOCKER&consumerPactUrl=$${pactbroker.pactUrl}&providerVersion=$${pactbroker.providerVersionNumber}&providerBranch=$${pactbroker.providerVersionBranch}"
        method = "GET"
        headers = {
          "X-Content-Type" = "application/json"
        }
        body = <<EOF
    {
      "pact": "$${pactbroker.pactUrl}"
    }
    With the above configuration, I am getting the following error:
    Copy code
    │ Error: "request.0.url" must be a valid URL, got: parse "    \"https://********/generic-webhook-trigger/invoke?token=**********&consumerName=CustomerWeb&monolithEnv=DOCKER&consumerPactUrl=${pactbroker.pactUrl}&providerVersion=${pactbroker.providerVersionNumber}&providerBranch=${pactbroker.providerVersionBranch}\"\n": net/url: invalid control character in URL
    Is there a way to pass query params instead of request body?
    âś… 1
    m
    • 2
    • 3
  • j

    Jonatan Jaworski

    04/08/2022, 3:00 AM
    Hi team - I don't seem to be able to assign the Team Administrator role via Terraform, are you aware of any limitations there? What I'm doing at the moment is getting all the roles that are already defined in Pactflow (like User, Viewer, Team Administrator, Guest, etc) into a dictionary that I can then reference elsewhere. Like this:
    Copy code
    variable "pactflow_roles" {
      type        = map(any)
      description = "Roles defined by Pactflow"
      default = {
        administrator      = "cf75d7c2-416b-11ea-af5e-53c3b1a4efd8",
        ci_cd              = "c1878b8e-d09e-11ea-8fde-af02c4677eb7",
        guest              = "d6938de2-e37c-11eb-b80e-3f68328092ca",
        team_administrator = "d635f960-88f2-4f13-8043-4641a02dffa0",
        user               = "e9282e22-416b-11ea-a16e-57ee1bb61d18",
        viewer             = "9fa50562-a42b-4771-aa8e-4bb3d623ae60"
      }
    }
    So that then I can go:
    Copy code
    resource "pact_user" "john_doe" {
      name   = "John Doe"
      email  = "<mailto:jon@doe.com|jon@doe.com>"
      active = true
      type   = "user"
      roles = [
        var.pactflow_roles["team_administrator"],
        var.pactflow_roles["user"]
      ]
    }
    But only the
    user
    role gets persisted, no the team administrator one.
    m
    • 2
    • 24
  • j

    Jonatan Jaworski

    04/27/2022, 10:53 PM
    Hi team - Does anyone know how to create system accounts via TF? I see that the
    user
    resource supports "user" and "system" as values for the
    type
    property (which by the way should probably be included in the docs), but the
    email
    is still required and the result is the creation of a regular user, not a system account.
    👍 1
    đź‘€ 1
    m
    • 2
    • 9
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/06/2022, 2:02 AM
    @Jonatan Jaworski FYI
    v0.0.8
    of the terraform provider is out. It should now support system user, and hopefully address the ordering issues from before
    party parrot 1
    j
    • 2
    • 28
  • r

    Rupam Saha

    06/14/2022, 11:26 AM
    Hi đź‘‹ I was going through pact_application terraform resource and it seems that it does not support the
    display_name
    property which is available as a part of pact docker cli. We are auto generating the consumer names and in some case we would like to update the display name, and in order to make it maintainable, we would like to use this Terraform to do that. Is it possible to add support for the
    display-name
    as well as a part of this resource? Thanks 🙂
    m
    • 2
    • 7