Skip to content

Unable to clear application_persistence_profile_ref from avi_pool #651

@jakauppila

Description

@jakauppila

Describe the bug

When configuring an application_persistence_profile_ref for an avi_pool, it works just fine to add the profile. The problem is that I have not found a way to remove the profile if I want to remove that persistence.

Attempting to comment out application_persistence_profile_ref or explicitly setting it to application_persistence_profile_ref="" fails to remove the persistence profile from the pool.

Reproduction steps

  1. Configure an avi_pool with a application_persistence_profile_ref
  2. Run Terraform Apply
  3. Comment out the application_persistence_profile_ref or set it to application_persistence_profile_ref=""
  4. Run Terraform Apply
  5. Observe that Terraform detects no changes to the avi_pool and thus does not remove the application_persistence_profile_ref from the avi_pool

Reproduction Terraform HCL:

terraform {
  required_providers {
    avi = {
      source  = "vmware/avi"
      version = "30.2.2"
    }
  }
}

provider "avi" {
  avi_controller = "avlb-controller.contoso.com"
  avi_tenant     = "admin"

  avi_version    = "30.2.2"
}

data "avi_cloud" "cloud" {
  name = "mycloud"
}

data "avi_applicationpersistenceprofile" "persistence" {
  name = "System-Persistence-Http-Cookie"
}

resource "avi_pool" "pool" {
  cloud_ref = data.avi_cloud.cloud.id

  name                     = "clear_persistence"

  application_persistence_profile_ref = data.avi_applicationpersistenceprofile.persistence.id
}

Subsequent Terraform apply output:

terraform apply
data.avi_applicationpersistenceprofile.persistence: Reading...
data.avi_cloud.cloud: Reading...
data.avi_cloud.cloud: Read complete after 0s [id=https://avlb-controller.contoso.com/api/cloud/cloud-e56f530b-54c4-45bd-9297-81c5944d3652]
avi_pool.pool: Refreshing state... [id=https://avlb-controller.contoso.com/api/pool/pool-79f823c9-f647-4d51-b3b9-ec50dcee788a]
data.avi_applicationpersistenceprofile.persistence: Read complete after 1s [id=https://avlb-controller.contoso.com/api/applicationpersistenceprofile/applicationpersistenceprofile-878f4af8-5538-4eef-bff1-fdcb2b0bcc79]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Expected behavior

Terraform properly clears application_persistence_profile_ref from the avi_pool.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    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