Skip to content

Error: Object already exists #310

@Swarsel

Description

@Swarsel

Hello,

I tried applying a relatively simple config:

  model = {
    apic = {
      tenants = [
        {
          name        = "${var.base_name}-${var.env}"
          application_profiles = [
            {
              name        = "Management"
              endpoint_groups = [
                {
                  name          = "Provisioning"
                  bridge_domain = "Infra"
                  qos_class     = "unspecified"
                }
              ]
            }
          ]
          bridge_domains = [
            {
              name                  = "Infra"
              vrf                   = "test"
              arp_flooding          = true
              ep_move_detection     = true
              ip_dataplane_learning = true
              l3_multicast          = true
              unicast_routing       = true
            },
            {
              name                  = "Mgmt"
              vrf                   = "test"
              arp_flooding          = true
              ep_move_detection     = true
              ip_dataplane_learning = true
              l3_multicast          = true
              unicast_routing       = true
            }
          ]
        },
        {
          name    = "common"
          managed = false
          vrfs = [
            {
              name    = "test"
            }
          ]
        }
      ]
    }
  }
}

together with these modules disabled:

---
modules:
  aci_aaa: false
  aci_apic_connectivity_preference: false
  aci_banner: false
  aci_coop_policy: false
  aci_date_time_format: false
  aci_endpoint_loop_protection: false
  aci_error_disabled_recovery: false
  aci_fabric_isis_bfd: false
  aci_fabric_isis_policy: false
  aci_fabric_l2_mtu: false
  aci_fabric_wide_settings: false
  aci_health_score_evaluation_policy: false
  aci_infra_dscp_translation_policy: false
  aci_ip_aging: false
  aci_mcp: false
  aci_port_tracking: false
  aci_ptp: false
  aci_qos: false
  aci_rogue_endpoint_control: false
  aci_system_global_gipo: false
  aci_system_performance: false

terraform plan runs without issue. However, when I try to apply the config, I am getting errors that objects are already existing, and terraform fails to create VRFs and EPGs:

module.osp_aci.module.logical.module.logical.terraform_data.validation: Creating...
module.osp_aci.module.logical.module.logical.terraform_data.validation: Creation complete after 0s [id=843a3da1-40b5-7cb9-44bf-28fc1832b958]
module.osp_aci.module.logical.module.logical.module.aci_tenant["test-dev"].aci_rest_managed.fvTenant: Creating...
module.osp_aci.module.logical.module.logical.module.aci_tenant["test-dev"].aci_rest_managed.fvTenant: Creation complete after 0s [id=uni/tn-test-dev]
module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Infra"].aci_rest_managed.fvBD: Creating...
module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Mgmt"].aci_rest_managed.fvBD: Creating...
module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Infra"].aci_rest_managed.fvBD: Creation complete after 0s [id=uni/tn-test-dev/BD-Infra]
module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Mgmt"].aci_rest_managed.fvBD: Creation complete after 0s [id=uni/tn-test-dev/BD-Mgmt]
module.osp_aci.module.logical.module.logical.module.aci_application_profile["test-dev/Management"].aci_rest_managed.fvAp: Creating...
module.osp_aci.module.logical.module.logical.module.aci_application_profile["test-dev/Management"].aci_rest_managed.fvAp: Creation complete after 0s [id=uni/tn-test-dev/ap-Management]
╷
│ Error: Object Already Exists
│
│   with module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Infra"].aci_rest_managed.fvRsCtx,
│   on .terraform/modules/osp_aci.logical.logical/modules/terraform-aci-bridge-domain/main.tf line 40, in resource "aci_rest_managed" "fvRsCtx":
│   40: resource "aci_rest_managed" "fvRsCtx" {
│
│ The fvRsCtx object with DN 'uni/tn-test-dev/BD-Infra/rsctx' already exists.
╵
╷
│ Error: Object Already Exists
│
│   with module.osp_aci.module.logical.module.logical.module.aci_bridge_domain["test-dev/Mgmt"].aci_rest_managed.fvRsCtx,
│   on .terraform/modules/osp_aci.logical.logical/modules/terraform-aci-bridge-domain/main.tf line 40, in resource "aci_rest_managed" "fvRsCtx":
│   40: resource "aci_rest_managed" "fvRsCtx" {
│
│ The fvRsCtx object with DN 'uni/tn-test-dev/BD-Mgmt/rsctx' already exists.
╵

Do you have any idea what could be causing this issue? This is on virtual APIC, version 6.0(8f), using terraform v1.13.2 and the latest aci provider v2.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions