Skip to content

Bug: Version 2.0.0 Long Plan Times #498

@flemingdp

Description

@flemingdp

Terraform and Provider Versions

terraform version
Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/jeremmfr/junos v2.0.0

Terraform Configuration Files

This is a simplified version of our Terraform HCL with some pieces that seem relevant.

terraform {
  required_providers {
    junos = {
      source  = "jeremmfr/junos"
      version = "2.0.0"
    }
  }
}

# Configure the Junos Provider
provider "junos" {
  ip   = "100.100.100.100"
  port = 830
}


locals {
  address_sets = flatten(
    [
      {
        name        = "test"
        address     = ["1.1.1.1/32"]
        address_set = null
        description = null
      }
    ]
  )
}

variable "fake_create_with_setfile_enabled" { default = "FALSE" }
variable "fake_create_with_setfile_path" { default = "" }

resource "junos_null_commit_file" "initial-commit" {
  count    = var.fake_create_with_setfile_enabled == "TRUE" ? 1 : 0
  filename = var.fake_create_with_setfile_path
}


resource "junos_security_address_book" "global" {
  name = "global"
  dynamic "address_set" {
    for_each = local.address_sets
    content {
      name        = address_set.value.name
      address     = address_set.value.address
      address_set = length(address_set.value.address_set) > 0 ? address_set.value.address_set : null
      description = address_set.value.description
    }
  }
}

Expected Behavior

With version 1.33.0 we could run a plan on an empty state and it would take 39 seconds.

Actual Behavior

Now we are finding that a plan will take 19 minutes and 52 seconds with the 2.0.0 version of the provider.

Steps to Reproduce

  1. terraform plan

Additional Context

We have been successfully running this provider for a while now, and are working to make our HCL compatible with the new 2.0.0. We have addressed the errors around setting fields to null rather than false and empty arrays to null where needed as well. We can now successfully perform a plan, but are seeing the long run times.

Also I wanted to note the use of the junos_null_commit_file.
When we detect there is no statefile we will set fake_create_with_setfile_enabled to true.
This seemed to speed things up on initial plan/deploy in the past.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions