cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1192
Views
0
Helpful
2
Replies

Terraform to export contracts in ACI

zaifisafi
Level 1
Level 1

Please can someone point to resource group or attribute that can be used to export contracts in ACI for inter-vrf communication

2 Replies 2

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @zaifisafi 

I do not think there is already an existing resource for it, but you can use the aci_rest.

This is how the rest call looks like:

method: POST
url: https://apic1/api/node/mo/uni/tn-destination_tenant/cif-exported_ctr_name.json
payload:
{
  "vzCPIf": {
    "attributes": {
      "dn": "uni/tn-destination_tenant/cif-exported_ctr_name",
      "name": "exported_ctr_name",
      "status": "created,modified"
    },
    "children": [
      {
        "vzRsIf": {
          "attributes": {
            "tDn": "uni/tn-source_tenant/source_tenant-ctr_name",
            "status": "created,modified"
          },
          "children": []
        }
      }
    ]
  }
}

You can adapt the above data into the aci_rest: https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest

 

Stay safe,

Sergiu

Doug Byrd
Level 5
Level 5

I know this is an old thread but I found the solution with the 'aci_imported_contract'.

 

 

resource "aci_imported_contract" "example" {
  tenant_dn = aci_tenant.tenant_that_is_importing_contract.id
  name = "name_of_imported_contract"
  relation_vz_rs_if = aci_contract.exported_contract.id
}

 

 

Save 25% on Day-2 Operations Add-On License