CiscoDevNet / terraform-provider-aci

Terraform Cisco ACI provider
https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs
Mozilla Public License 2.0
88 stars 100 forks source link

problem on how to create a copy service #1159

Closed micronemo closed 7 months ago

micronemo commented 7 months ago

Community Note

Terraform Version

APIC version and APIC Platform

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

resource "aci_tenant" "local" { name = "test2" }

resource "aci_l4_l7_device" "Localname" { name = "NOME" tenant_dn = aci_tenant.local.id device_type = "PHYSICAL" context_aware = "single-Context" function_type = "None" is_copy = "yes" service_type = "COPY" mode = "legacy-Mode" relation_vns_rs_al_dev_to_phys_dom_p = "uni/phys-Heroes_phys" }

resource "aci_concrete_device" "example2" { l4_l7_device_dn = aci_l4_l7_device.Localname.id name = "NOME_Device_1" }

resource "aci_concrete_interface" "physical_interface" { concrete_device_dn = aci_concrete_device.example2.id name = "PHYS1" relation_vns_rs_c_if_path_att = "topology/pod-1/paths-101/pathep-[eth1/29]"

} resource "aci_l4_l7_logical_interface" "localname" { l4_l7_device_dn = aci_l4_l7_device.Localname.id name = "CL1_SONDA" encap = "vlan-450" relation_vns_rs_c_if_att_n = [aci_concrete_interface.physical_interface.id]

resource "aci_l4_l7_service_graph_template" "local" { name = "service-copy" tenant_dn = aci_tenant.local.id }

resource "aci_function_node" "local" { l4_l7_service_graph_template_dn = aci_l4_l7_service_graph_template.local.id name = "sonda" func_type = "None" is_copy = "yes" managed = "no" }

resource "aci_connection" "local" { l4_l7_service_graph_template_dn = aci_l4_l7_service_graph_template.local.id name = "C1" relation_vns_rs_abs_connection_conns = I don't understand what I need to set relation_vns_rs_abs_copy_connection = I don't understand what I need to set

how i can set tenant -> services -> L4-L7 -> devices selection policies ? how i can set tenant -> services -> L4-L7 -> deployed graph instances ? are there missing resouces ?

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

sajagana commented 7 months ago

Hi @micronemo,

Looks like your terraform configuration is incomplete. Could you please explain your requirements.

micronemo commented 7 months ago

Hi @sajagana I know that my configuration is incomplete but I don't understand which resources are missing. can you help me?

sajagana commented 7 months ago

Hi @micronemo,

If you can share your requirements, like what you are trying to configure through the UI?

micronemo commented 7 months ago

Hi @sajagana i want create a copy service to replicate the traffic 1) tenant -> services -> L4-L7 -> devices (aci_l4_l7_device - aci_concrete_device - aci_concrete_interface -aci_l4_l7_logical_interface) 2) tenant -> services -> L4-L7 -> service graph template (aci_l4_l7_service_graph_template - aci_function_node - aci_connection ->relation_vns_rs_abs_connection_conns = I don't understand what I need to set relation_vns_rs_abs_copy_connection = I don't understand what I need to set 3) tenant -> services -> L4-L7 -> devices selection policies ( I don't know how to configure it) 4) tenant -> services -> L4-L7 -> deployed graph instances (( I don't know how to configure it) i attach json of tenant tn-TEST_COPY_SERVICE.json

micronemo commented 7 months ago

Hi @sajagana there is problem with the resource aci_function_node , inside this resource there is not the possibily to create the class vnsAbsFuncConn so i must create manually: resource "aci_rest_managed" "vnsAbsFuncConn" { class_name = "vnsAbsFuncConn" dn = "${aci_function_node.local.id}/AbsFConn-copy" content = { name = "copy" } }

sajagana commented 7 months ago

Hi @micronemo,

Please use the below resource to create the function node. Also, you can find the full example to create the function node here. If you still face the issues while creating the function node and other objects let me know.

resource "aci_function_node" "function_node_0" {
  l4_l7_service_graph_template_dn     = aci_l4_l7_service_graph_template.cloud_service_graph.id
  name                                = "N0"
  func_template_type                  = "ADC_ONE_ARM"
  managed                             = "yes"
  relation_vns_rs_node_to_cloud_l_dev = aci_cloud_l4_l7_native_load_balancer.cloud_native_alb.id
}
micronemo commented 7 months ago

@sajagana the correct implemtation is : resource "aci_function_node" "local" { l4_l7_service_graph_template_dn = aci_l4_l7_service_graph_template.local.id name = "sonda" func_type = "None" is_copy = "yes" managed = "no" relation_vns_rs_node_to_l_dev = aci_l4_l7_device.Localname.id

here is problem with the resource aci_function_node , inside this resource there is not the possibily to create the class vnsAbsFuncConn so i must create manually: resource "aci_rest_managed" "vnsAbsFuncConn" { class_name = "vnsAbsFuncConn" dn = "${aci_function_node.local.id}/AbsFConn-copy" content = { name = "copy" } } there are bug inside the resource "aci_function_node"

akinross commented 7 months ago

Hi @micronemo, thank you for your research. I see you have opened another issue (https://github.com/CiscoDevNet/terraform-provider-aci/issues/1161) for the enhancement of copy services. I will close this issue so we can track it in a single issue.