Skip to content

Importing a pipeline with provider_settings produces spurious diffs #1089

@ellsclytn

Description

@ellsclytn

Description

When importing an existing buildkite_pipeline that has a provider_settings block in its Terraform configuration, terraform plan shows the full provider_settings object as needing to be created, even when the config matches the actual pipeline. Additionally, if even a single provider_settings attribute differs, all unspecified string attributes show spurious diffs like null -> (known after apply).

To Reproduce

  1. Create a pipeline in Buildkite (or use an existing one)
  2. Write a Terraform config for it with a provider_settings block:
    resource "buildkite_pipeline" "example" {
      name       = "my-pipeline"
      repository = "https://github.com/org/repo.git"
    
      provider_settings {
        build_branches      = true
        build_pull_requests = false
      }
    }
  3. Run terraform import buildkite_pipeline.example <pipeline-id>
  4. Run terraform plan
  5. The plan shows the entire provider_settings block as a new addition, plus fields like:
    ~ filter_condition                         = null -> (known after apply)
    ~ pull_request_branch_filter_configuration = null -> (known after apply)
    ~ trigger_mode                             = null -> (known after apply)
    

Expected behavior

After importing, terraform plan should show no changes if the config matches the pipeline, and only the actually-differing attributes if the config differs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions