diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index 437d1e4e2..4f374dd59 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -491,6 +491,8 @@ fvRsCons: parent_dependency: "fvAp" targets: - class_name: "vzBrCP" + shared_classes: + - "fvRsProv" parent_dependency: "fvTenant" overwrite_parent_dn_key: "tenant_dn" target_dn: "uni/tn-test_tenant/brc-contract_name_0" @@ -515,6 +517,7 @@ fvRsProv: parent_dependency: "fvAp" - class_name: "fvAEPg" parent_dependency: "fvAp" + fvRsConsIf: ignore_custom_type_docs: @@ -601,17 +604,17 @@ fvRsSecInherited: - class_name: "fvAEPg" parent_dependency: "fvAp" overwrite_parent_dn_key: "application_profile_dn" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_2" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_0" relation_resource_name: "contract_master" properties: - name: "epg_2" + name: "epg_0" - class_name: "fvAEPg" parent_dependency: "fvAp" overwrite_parent_dn_key: "application_profile_dn" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_3" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_1" relation_resource_name: "contract_master" properties: - name: "epg_3" + name: "epg_1" fvCrtrn: overwrites: @@ -858,9 +861,19 @@ fvRsDppPol: name: "data_plane_policing_policy_name_1" fvRsBd: - test_values: - all: - bridge_domain_name: "default" + targets: + - class_name: "fvBD" + parent_dependency: "fvTenant" + target_dn: "uni/tn-test_tenant/BD-bridge_domain_name_1" + relation_resource_name: "bridge_domain_name" + properties: + name: "bridge_domain_name_1" + - class_name: "fvBD" + parent_dependency: "fvTenant" + target_dn: "uni/tn-test_tenant/BD-bridge_domain_name_0" + relation_resource_name: "bridge_domain_name" + properties: + name: "bridge_domain_name_0" fvRsFcPathAtt: default_values: @@ -1625,6 +1638,13 @@ fvRsBDToNetflowMonitorPol: - class_name: "fvBD" parent_dependency: "fvTenant" parent_dn: "aci_bridge_domain.test.id" + targets: + - class_name: "netflowMonitorPol" + parent_dependency: "fvTenant" + target_dn: "uni/tn-test_tenant/monitorpol-netflow_monitor_policy_name_1" + relation_resource_name: "netflow_monitor_policy_name" + properties: + name: "netflow_monitor_policy_name_1" fvRsBDToOut: overwrites: @@ -1652,7 +1672,7 @@ fvRsBDToProfile: relation_resource_name: "l3_outside" properties: name: "l3_outside_name_1" - relation_l3ext_rs_ectx: aci_vrf.test_vrf_1.id + relation_l3ext_rs_ectx: aci_vrf.test_vrf_0.id - class_name: "l3extOut" parent_dependency: "fvTenant" overwrite_parent_dn_key: "tenant_dn" @@ -1660,7 +1680,7 @@ fvRsBDToProfile: relation_resource_name: "l3_outside" properties: name: "l3_outside_name_0" - relation_l3ext_rs_ectx: aci_vrf.test_vrf_1.id + relation_l3ext_rs_ectx: aci_vrf.test_vrf_0.id - class_name: "rtctrlProfile" parent_dependency: "l3extOut" target_dn: "uni/tn-test_tenant/out-abr_l3_outside_name_0/prof-route_control_profile_name_1" diff --git a/gen/generator.go b/gen/generator.go index 9ecc7ab24..edea382c2 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -145,6 +145,99 @@ var templateFuncs = template.FuncMap{ "excludeForNullInSetCheck": ExcludeForNullInSetCheck, "getTestTargetValue": GetTestTargetValue, "isReference": IsReference, + "getLegacyPropertyTestValue": GetTestValue, + "getLegacyBlockTestValue": GetBlockTestValue, +} + +func getChildTarget(model Model, childKey, childValue string, tDn bool) string { + + for index, childDependency := range model.ChildTestDependencies { + targetResourceName := childDependency.TargetResourceName + if !tDn { + if childKey == fmt.Sprintf("%s_name", targetResourceName) { + childKey = "name" + } + if result, ok := childDependency.Properties[childKey]; ok && childValue == result { + return fmt.Sprintf(`aci_%s.test_%s_%d.id`, targetResourceName, targetResourceName, index%2) + } + } else { + if childDependency.Source == childKey || DefinedInList(childDependency.SharedClasses, childKey) { + if !childDependency.Static { + return fmt.Sprintf(`aci_%s.test_%s_%d.id`, targetResourceName, targetResourceName, index%2) + } else { + return childDependency.TargetDn + } + } + } + } + return childValue +} + +func GetBlockTestValue(className, attributeName string, model Model) string { + for _, child := range model.Children { + if child.PkgName == className { + if attributeName == "TargetDn" { + return getChildTarget(model, className, "target_dn_2", true) + } + for _, property := range child.Properties { + if property.Name == attributeName { + if len(property.ValidValues) > 0 { + return property.ValidValues[0] + } else if property.PropertyName == "tDn" { + return getChildTarget(model, className, "target_dn_1", true) + } + childKey := GetOverwriteAttributeName(child.PkgName, property.SnakeCaseName, model.Definitions) + childValue := fmt.Sprintf("%s_1", childKey) + return getChildTarget(model, childKey, childValue, false) + } + } + } + } + return attributeName +} + +func GetTestValue(name string, model Model) string { + + for _, property := range model.Properties { + if property.Name == name { + if len(property.ValidValues) > 0 { + return property.ValidValues[0] + } + return fmt.Sprintf("test_%s", property.SnakeCaseName) + } + } + + for _, child := range model.Children { + if Capitalize(child.PkgName) == name { + properties := []string{} + for _, property := range child.Properties { + if strings.HasSuffix(property.PropertyName, "Name") { + childKey := GetOverwriteAttributeName(child.PkgName, property.SnakeCaseName, model.Definitions) + childValue := fmt.Sprintf("%s_1", childKey) + properties = append(properties, getChildTarget(model, childKey, childValue, false)) + } else if property.PropertyName == "tDn" { + return getChildTarget(model, child.PkgName, "target_dn_0", true) + } + } + // If there are multiple properties that has suffix of Name, return the one that matches the child resource name + if len(properties) > 1 { + for _, property := range properties { + if strings.Contains(property, string(child.ChildResourceName[strings.Index(child.ChildResourceName, "_to_")+4])) { + return property + } + } + } else if len(properties) == 1 { + return properties[0] + } + } + } + if name == "ParentDn" { + if len(model.ContainedBy) > 0 { + parentResource := GetResourceName(model.ContainedBy[0], model.Definitions) + return fmt.Sprintf(`aci_%s.test.id`, parentResource) + } + } + return name } func GetTestTargetValue(targets []interface{}, key, value string) string { @@ -1281,6 +1374,8 @@ type TypeChange struct { } type TestDependency struct { + Source string + SharedClasses interface{} ClassName string ParentDependency string ParentDependencyDnRef string @@ -2727,7 +2822,7 @@ func (m *Model) SetModelTestDependencies(classModels map[string]Model, definitio for index, v := range value.([]interface{}) { targetMap := v.(map[interface{}]interface{}) if className, ok := targetMap["class_name"]; ok { - testDependencies = append(testDependencies, getTestDependency(className.(string), targetMap, definitions, index)) + testDependencies = append(testDependencies, getTestDependency(m.PkgName, className.(string), targetMap, definitions, index)) } } } @@ -2742,7 +2837,7 @@ func (m *Model) SetModelTestDependencies(classModels map[string]Model, definitio for index, v := range value.([]interface{}) { targetMap := v.(map[interface{}]interface{}) if className, ok := targetMap["class_name"]; ok && !slices.Contains(m.getExcludeTargets(), className.(string)) { - childTestDependencies = append(childTestDependencies, getTestDependency(className.(string), targetMap, definitions, index)) + childTestDependencies = append(childTestDependencies, getTestDependency(child, className.(string), targetMap, definitions, index)) } } } @@ -2769,9 +2864,10 @@ func (m *Model) getExcludeTargets() []string { return excludeTargets } -func getTestDependency(className string, targetMap map[interface{}]interface{}, definitions Definitions, index int) TestDependency { +func getTestDependency(sourceClassName, className string, targetMap map[interface{}]interface{}, definitions Definitions, index int) TestDependency { testDependency := TestDependency{} + testDependency.Source = sourceClassName testDependency.ClassName = className testDependency.TargetResourceName = GetResourceName(className, definitions) testDependency.RelationResourceName = testDependency.TargetResourceName @@ -2781,6 +2877,10 @@ func getTestDependency(className string, targetMap map[interface{}]interface{}, testDependency.RelationResourceName = relationResourceName.(string) } + if sharedClasses, ok := targetMap["shared_classes"]; ok { + testDependency.SharedClasses = sharedClasses + } + if parentDependency, ok := targetMap["parent_dependency"]; ok { testDependency.ParentDependency = parentDependency.(string) if parentDependencyDn, ok := targetMap["parent_dependency_dn_ref"]; ok { diff --git a/gen/templates/testvars.yaml.tmpl b/gen/templates/testvars.yaml.tmpl index 3edbccc20..8bc57793f 100644 --- a/gen/templates/testvars.yaml.tmpl +++ b/gen/templates/testvars.yaml.tmpl @@ -2,6 +2,34 @@ # In order to regenerate this file execute `go generate` from the repository root. # More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +{{- if .LegacyAttributes}} +legacy_attributes: + {{- range .LegacyAttributes}} + {{- if ne .ReplacedBy.AttributeName "" }} + {{- if eq (getMigrationType .ValueType) "String"}} + {{.AttributeName}}: "{{getLegacyPropertyTestValue .Name $}}" + {{- else if eq (getMigrationType .ValueType) "Set"}} + {{.AttributeName}}: "{{getLegacyPropertyTestValue .Name $}}" + {{- end}} + {{- end}} + {{- end }} +{{- end}} +{{- if .LegacyBlocks}} +legacy_blocks: + {{- range .LegacyBlocks}}{{$ClassName := .ClassName}} + {{.Name }}: + {{- range .Attributes}} + {{- if ne .ReplacedBy.AttributeName "" }} + {{- if eq (getMigrationType .ValueType) "String"}} + {{.AttributeName}}: "{{getLegacyBlockTestValue $ClassName .Name $}}" + {{- else if eq (getMigrationType .ValueType) "Set"}} + {{.AttributeName}}: "{{getLegacyBlockTestValue $ClassName .Name $}}" + {{- end}} + {{- end}} + {{- end }} + {{- end}} +{{ end}} + {{ $versionMismatch := .VersionMismatched}} default: {{- $versionMismatchExists := false}} diff --git a/gen/testvars/fvAEPg.yaml b/gen/testvars/fvAEPg.yaml index ecc521072..3de3b0d16 100644 --- a/gen/testvars/fvAEPg.yaml +++ b/gen/testvars/fvAEPg.yaml @@ -1,6 +1,38 @@ # Code generated by "gen/generator.go"; DO NOT EDIT. # In order to regenerate this file execute `go generate` from the repository root. # More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +legacy_attributes: + exception_tag: "test_exception_tag" + flood_on_encap: "disabled" + fwd_ctrl: "none" + has_mcast_source: "no" + is_attr_based_epg: "no" + match_t: "All" + application_profile_dn: "aci_application_profile.test.id" + pc_enf_pref: "enforced" + pref_gr_memb: "exclude" + prio: "level1" + shutdown: "no" + relation_fv_rs_aepg_mon_pol: "aci_monitoring_policy.test_monitoring_policy_0.id" + relation_fv_rs_bd: "aci_bridge_domain.test_bridge_domain_1.id" + relation_fv_rs_cons: "aci_contract.test_contract_0.id" + relation_fv_rs_sec_inherited: "aci_application_epg.test_application_epg_0.id" + relation_fv_rs_cust_qos_pol: "custom_qos_policy_name_1" + relation_fv_rs_dpp_pol: "aci_data_plane_policing_policy.test_data_plane_policing_policy_1.id" + relation_fv_rs_fc_path_att: "topology/pod-1/paths-101/pathep-[eth1/1]" + relation_fv_rs_cons_if: "aci_imported_contract.test_imported_contract_0.id" + relation_fv_rs_intra_epg: "aci_contract.test_contract_0.id" + relation_fv_rs_prov: "aci_contract.test_contract_0.id" + relation_fv_rs_prot_by: "aci_taboo_contract.test_taboo_contract_1.id" + relation_fv_rs_trust_ctrl: "aci_trust_control_policy.test_trust_control_policy_0.id" +legacy_blocks: + relation_fv_rs_node_att: + deployment_immediacy: "immediate" + description: "description_1" + encap: "encapsulation_1" + mode: "native" + node_dn: "topology/pod-1/node-101" + default: @@ -104,7 +136,7 @@ children: relation_to_bridge_domain: - annotation: "annotation_1" - bridge_domain_name: "default" + bridge_domain_name: "bridge_domain_name_1" deletable_child: false children: @@ -660,6 +692,28 @@ child_targets: parent_dn_key: "tenant_dn" properties: name: "monitoring_policy_name_1" + - class_name: "fvBD" + target_dn: "uni/tn-test_tenant/BD-bridge_domain_name_1" + relation_resource_name: "bridge_domain_name" + static: false + target_dn_ref: "aci_bridge_domain.test_bridge_domain_0.id" + parent_dependency: "fvTenant" + parent_dependency_dn_ref: "aci_tenant.test.id" + target_resource_name: "bridge_domain" + parent_dn_key: "parent_dn" + properties: + name: "bridge_domain_name_1" + - class_name: "fvBD" + target_dn: "uni/tn-test_tenant/BD-bridge_domain_name_0" + relation_resource_name: "bridge_domain_name" + static: false + target_dn_ref: "aci_bridge_domain.test_bridge_domain_1.id" + parent_dependency: "fvTenant" + parent_dependency_dn_ref: "aci_tenant.test.id" + target_resource_name: "bridge_domain" + parent_dn_key: "parent_dn" + properties: + name: "bridge_domain_name_0" - class_name: "vzBrCP" target_dn: "uni/tn-test_tenant/brc-contract_name_0" relation_resource_name: "contract" @@ -770,7 +824,7 @@ child_targets: properties: name: "taboo_contract_name_1" - class_name: "fvAEPg" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_2" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_0" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_application_epg.test_application_epg_0.id" @@ -779,9 +833,9 @@ child_targets: target_resource_name: "application_epg" parent_dn_key: "application_profile_dn" properties: - name: "epg_2" + name: "epg_0" - class_name: "fvAEPg" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_3" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_1" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_application_epg.test_application_epg_1.id" @@ -790,7 +844,7 @@ child_targets: target_resource_name: "application_epg" parent_dn_key: "application_profile_dn" properties: - name: "epg_3" + name: "epg_1" - class_name: "fhsTrustCtrlPol" target_dn: "uni/tn-test_tenant/trustctrlpol-trust_control_policy_name_1" relation_resource_name: "trust_control_policy" diff --git a/gen/testvars/fvBD.yaml b/gen/testvars/fvBD.yaml index c27dda5b3..fd050ec48 100644 --- a/gen/testvars/fvBD.yaml +++ b/gen/testvars/fvBD.yaml @@ -1,6 +1,38 @@ # Code generated by "gen/generator.go"; DO NOT EDIT. # In order to regenerate this file execute `go generate` from the repository root. # More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +legacy_attributes: + arp_flood: "no" + ep_clear: "no" + ep_move_detect_mode: "garp" + host_based_routing: "no" + intersite_bum_traffic_allow: "no" + ipv6_mcast_allow: "no" + ll_addr: "test_ll_addr" + mac: "test_mac" + mcast_allow: "no" + multi_dst_pkt_act: "bd-flood" + tenant_dn: "aci_tenant.test.id" + unicast_route: "no" + unk_mac_ucast_act: "flood" + unk_mcast_act: "flood" + v6unk_mcast_act: "flood" + vmac: "test_vmac" + relation_fv_rs_bd_to_relay_p: "aci_dhcp_relay_policy.test_dhcp_relay_policy_0.id" + relation_fv_rs_bd_to_ep_ret: "aci_end_point_retention_policy.test_end_point_retention_policy_1.id" + relation_fv_rs_bd_to_fhs: "aci_first_hop_security_policy.test_first_hop_security_policy_1.id" + relation_fv_rs_igmpsn: "aci_igmp_snooping_policy.test_igmp_snooping_policy_0.id" + relation_fv_rs_bd_to_out: "aci_l3_outside.test_l3_outside_1.id" + relation_fv_rs_mldsn: "aci_mld_snooping_policy.test_mld_snooping_policy_1.id" + relation_fv_rs_abd_pol_mon_pol: "aci_monitoring_policy.test_monitoring_policy_0.id" + relation_fv_rs_bd_to_nd_p: "aci_neighbor_discovery_interface_policy.test_neighbor_discovery_interface_policy_0.id" + relation_fv_rs_bd_to_profile: "aci_route_control_profile.test_route_control_profile_1.id" + relation_fv_rs_ctx: "aci_vrf.test_vrf_0.id" +legacy_blocks: + relation_fv_rs_bd_to_netflow_monitor_pol: + flt_type: "ce" + tn_netflow_monitor_pol_name: "aci_netflow_monitor_policy.test_netflow_monitor_policy_1.id" + default: @@ -463,6 +495,17 @@ child_targets: parent_dn_key: "parent_dn" properties: name: "neighbor_discovery_interface_policy_name_1" + - class_name: "netflowMonitorPol" + target_dn: "uni/tn-test_tenant/monitorpol-netflow_monitor_policy_name_1" + relation_resource_name: "netflow_monitor_policy_name" + static: false + target_dn_ref: "aci_netflow_monitor_policy.test_netflow_monitor_policy_0.id" + parent_dependency: "fvTenant" + parent_dependency_dn_ref: "aci_tenant.test.id" + target_resource_name: "netflow_monitor_policy" + parent_dn_key: "parent_dn" + properties: + name: "netflow_monitor_policy_name_1" - class_name: "fvCtx" target_dn: "uni/tn-test_tenant/ctx-vrf_name_1" relation_resource_name: "vrf" @@ -485,7 +528,7 @@ child_targets: parent_dn_key: "tenant_dn" properties: name: "l3_outside_name_1" - relation_l3ext_rs_ectx: "aci_vrf.test_vrf_1.id" + relation_l3ext_rs_ectx: "aci_vrf.test_vrf_0.id" - class_name: "l3extOut" target_dn: "uni/tn-test_tenant/out-abr_l3_outside_name_0" relation_resource_name: "l3_outside" @@ -497,7 +540,7 @@ child_targets: parent_dn_key: "tenant_dn" properties: name: "l3_outside_name_0" - relation_l3ext_rs_ectx: "aci_vrf.test_vrf_1.id" + relation_l3ext_rs_ectx: "aci_vrf.test_vrf_0.id" - class_name: "rtctrlProfile" target_dn: "uni/tn-test_tenant/out-abr_l3_outside_name_0/prof-route_control_profile_name_1" relation_resource_name: "route_control_profile" diff --git a/gen/testvars/fvESg.yaml b/gen/testvars/fvESg.yaml index c42dd5898..7bd0734bb 100644 --- a/gen/testvars/fvESg.yaml +++ b/gen/testvars/fvESg.yaml @@ -1,6 +1,26 @@ # Code generated by "gen/generator.go"; DO NOT EDIT. # In order to regenerate this file execute `go generate` from the repository root. # More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md). +legacy_attributes: + match_t: "All" + application_profile_dn: "aci_application_profile.test.id" + pc_enf_pref: "enforced" + pref_gr_memb: "exclude" + relation_fv_rs_sec_inherited: "aci_endpoint_security_group.test_endpoint_security_group_0.id" + relation_fv_rs_intra_epg: "aci_contract.test_contract_1.id" + relation_fv_rs_scope: "aci_vrf.test_vrf_0.id" +legacy_blocks: + relation_fv_rs_cons: + target_dn: "aci_contract.test_contract_0.id" + prio: "level1" + relation_fv_rs_cons_if: + target_dn: "aci_imported_contract.test_imported_contract_0.id" + prio: "level1" + relation_fv_rs_prov: + target_dn: "aci_contract.test_contract_0.id" + match_t: "All" + prio: "level1" + default: diff --git a/gen/testvars/fvRsBDToNetflowMonitorPol.yaml b/gen/testvars/fvRsBDToNetflowMonitorPol.yaml index 2376f2f0b..9ef2bc1fd 100644 --- a/gen/testvars/fvRsBDToNetflowMonitorPol.yaml +++ b/gen/testvars/fvRsBDToNetflowMonitorPol.yaml @@ -44,4 +44,16 @@ parents: parent_dn: "aci_bridge_domain.test.id" class_in_parent: false test_type: both +targets: + - class_name: "netflowMonitorPol" + target_dn: "uni/tn-test_tenant/monitorpol-netflow_monitor_policy_name_1" + target_dn_ref: "aci_netflow_monitor_policy.test_netflow_monitor_policy_0.id" + parent_dependency: "fvTenant" + parent_dependency_dn_ref: "aci_tenant.test.id" + target_resource_name: "netflow_monitor_policy" + relation_resource_name: "netflow_monitor_policy_name" + parent_dn_key: "parent_dn" + static: false + properties: + name: "netflow_monitor_policy_name_1" class_version: 2.2(1k)- diff --git a/gen/testvars/fvRsSecInherited.yaml b/gen/testvars/fvRsSecInherited.yaml index ad9bb7d49..e8aeaa5c5 100644 --- a/gen/testvars/fvRsSecInherited.yaml +++ b/gen/testvars/fvRsSecInherited.yaml @@ -72,7 +72,7 @@ targets: properties: name: "esg_1" - class_name: "fvAEPg" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_2" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_0" target_dn_ref: "aci_application_epg.test_application_epg_0.id" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" @@ -81,9 +81,9 @@ targets: parent_dn_key: "application_profile_dn" static: false properties: - name: "epg_2" + name: "epg_0" - class_name: "fvAEPg" - target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_3" + target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_1" target_dn_ref: "aci_application_epg.test_application_epg_1.id" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" @@ -92,5 +92,5 @@ targets: parent_dn_key: "application_profile_dn" static: false properties: - name: "epg_3" + name: "epg_1" class_version: 2.3(1e)- diff --git a/internal/provider/data_source_aci_relation_to_contract_master_test.go b/internal/provider/data_source_aci_relation_to_contract_master_test.go index 399995c3a..90dcf0e45 100644 --- a/internal/provider/data_source_aci_relation_to_contract_master_test.go +++ b/internal/provider/data_source_aci_relation_to_contract_master_test.go @@ -21,7 +21,7 @@ func TestAccDataSourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedDataSourceDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("data.aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("data.aci_relation_to_contract_master.test", "annotation", "orchestrator:terraform"), ), }, @@ -65,7 +65,7 @@ data "aci_relation_to_contract_master" "test" { const testConfigFvRsSecInheritedNotExistingFvAEPg = testConfigFvAEPgMinDependencyWithFvAp + ` data "aci_relation_to_contract_master" "test_non_existing" { parent_dn = aci_application_epg.test.id - target_dn = "uni/tn-test_tenant/ap-test_ap/epg-epg_2_not_existing" + target_dn = "uni/tn-test_tenant/ap-test_ap/epg-epg_0_not_existing" } ` const testConfigFvRsSecInheritedDataSourceDependencyWithFvESg = testConfigFvRsSecInheritedMinDependencyWithFvESg + ` diff --git a/internal/provider/resource_aci_application_epg_test.go b/internal/provider/resource_aci_application_epg_test.go index a4cb72c6c..551facc42 100644 --- a/internal/provider/resource_aci_application_epg_test.go +++ b/internal/provider/resource_aci_application_epg_test.go @@ -253,7 +253,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.monitoring_policy_name", "monitoring_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "default"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.priority", "level1"), @@ -261,9 +261,9 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.contract_name", "contract_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_3"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "default"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotation", "annotation_1"), @@ -438,7 +438,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_application_epg_monitoring_policy.monitoring_policy_name", "monitoring_policy_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "default"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.1.key", "key_1"), @@ -487,7 +487,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.1.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.1.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotation", "annotation_2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.0.value", "value_1"), @@ -499,7 +499,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.1.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.1.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_3"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "2"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_0"), @@ -829,7 +829,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "default"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.#", "1"), @@ -853,7 +853,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.#", "1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_3"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_1"), @@ -1039,7 +1039,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "default"), + resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.#", "0"), @@ -1131,6 +1131,14 @@ resource "aci_monitoring_policy" "test_monitoring_policy_0"{ tenant_dn = aci_tenant.test.id name = "monitoring_policy_name_1" } +resource "aci_bridge_domain" "test_bridge_domain_1"{ + parent_dn = aci_tenant.test.id + name = "bridge_domain_name_1" +} +resource "aci_bridge_domain" "test_bridge_domain_0"{ + parent_dn = aci_tenant.test.id + name = "bridge_domain_name_0" +} resource "aci_contract" "test_contract_1"{ tenant_dn = aci_tenant.test.id name = "contract_name_0" @@ -1161,11 +1169,11 @@ resource "aci_taboo_contract" "test_taboo_contract_1"{ } resource "aci_application_epg" "test_application_epg_0"{ application_profile_dn = aci_application_profile.test.id - name = "epg_2" + name = "epg_0" } resource "aci_application_epg" "test_application_epg_1"{ application_profile_dn = aci_application_profile.test.id - name = "epg_3" + name = "epg_1" } resource "aci_trust_control_policy" "test_trust_control_policy_0"{ parent_dn = aci_tenant.test.id @@ -1302,7 +1310,7 @@ resource "aci_application_epg" "test" { } relation_to_bridge_domain = { annotation = "annotation_1" - bridge_domain_name = "default" + bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name annotations = [ { key = "key_0" @@ -2002,7 +2010,7 @@ resource "aci_application_epg" "test" { relation_to_application_epg_monitoring_policy = {} relation_to_bridge_domain = { annotation = "annotation_1" - bridge_domain_name = "default" + bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name annotations = [ { key = "key_1" @@ -2268,7 +2276,7 @@ resource "aci_application_epg" "test" { relation_to_application_epg_monitoring_policy = {} relation_to_bridge_domain = { annotation = "annotation_1" - bridge_domain_name = "default" + bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name annotations = [] tags = [] } diff --git a/internal/provider/resource_aci_bridge_domain_test.go b/internal/provider/resource_aci_bridge_domain_test.go index 90c72ad69..3a04f4185 100644 --- a/internal/provider/resource_aci_bridge_domain_test.go +++ b/internal/provider/resource_aci_bridge_domain_test.go @@ -946,37 +946,41 @@ resource "aci_neighbor_discovery_interface_policy" "test_neighbor_discovery_inte parent_dn = aci_tenant.test.id name = "neighbor_discovery_interface_policy_name_1" } -resource "aci_vrf" "test_vrf_1"{ +resource "aci_netflow_monitor_policy" "test_netflow_monitor_policy_1"{ + parent_dn = aci_tenant.test.id + name = "netflow_monitor_policy_name_1" +} +resource "aci_vrf" "test_vrf_0"{ tenant_dn = aci_tenant.test.id name = "vrf_name_1" } -resource "aci_l3_outside" "test_l3_outside_0"{ +resource "aci_l3_outside" "test_l3_outside_1"{ tenant_dn = aci_tenant.test.id name = "l3_outside_name_1" - relation_l3ext_rs_ectx = aci_vrf.test_vrf_1.id + relation_l3ext_rs_ectx = aci_vrf.test_vrf_0.id } -resource "aci_l3_outside" "test_l3_outside_1"{ +resource "aci_l3_outside" "test_l3_outside_0"{ tenant_dn = aci_tenant.test.id name = "l3_outside_name_0" - relation_l3ext_rs_ectx = aci_vrf.test_vrf_1.id + relation_l3ext_rs_ectx = aci_vrf.test_vrf_0.id } -resource "aci_route_control_profile" "test_route_control_profile_0"{ +resource "aci_route_control_profile" "test_route_control_profile_1"{ parent_dn = aci_l3_outside.test_l3_outside_0.id name = "route_control_profile_name_1" } -resource "aci_dhcp_relay_policy" "test_dhcp_relay_policy_1"{ +resource "aci_dhcp_relay_policy" "test_dhcp_relay_policy_0"{ tenant_dn = aci_tenant.test.id name = "dhcp_relay_policy_name_1" } -resource "aci_end_point_retention_policy" "test_end_point_retention_policy_0"{ +resource "aci_end_point_retention_policy" "test_end_point_retention_policy_1"{ tenant_dn = aci_tenant.test.id name = "end_point_retention_policy_name_1" } -resource "aci_igmp_snooping_policy" "test_igmp_snooping_policy_1"{ +resource "aci_igmp_snooping_policy" "test_igmp_snooping_policy_0"{ parent_dn = aci_tenant.test.id name = "igmp_snooping_policy_name_1" } -resource "aci_mld_snooping_policy" "test_mld_snooping_policy_0"{ +resource "aci_mld_snooping_policy" "test_mld_snooping_policy_1"{ parent_dn = aci_tenant.test.id name = "mld_snooping_policy_name_1" } @@ -1133,7 +1137,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - dhcp_relay_policy_name = aci_dhcp_relay_policy.test_dhcp_relay_policy_1.name + dhcp_relay_policy_name = aci_dhcp_relay_policy.test_dhcp_relay_policy_0.name } relation_to_end_point_retention_policy = { annotation = "annotation_1" @@ -1157,7 +1161,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_0.name + end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_1.name resolve_action = "inherit" } relation_to_first_hop_security_policy = { @@ -1206,7 +1210,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_1.name + igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_0.name } relation_to_l3_outsides = [ { @@ -1231,7 +1235,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - l3_outside_name = aci_l3_outside.test_l3_outside_1.name + l3_outside_name = aci_l3_outside.test_l3_outside_0.name }, { annotation = "annotation_2" @@ -1255,7 +1259,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - l3_outside_name = aci_l3_outside.test_l3_outside_0.name + l3_outside_name = aci_l3_outside.test_l3_outside_1.name }, ] relation_to_mld_snooping_policy = { @@ -1280,7 +1284,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_0.name + mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_1.name } relation_to_monitor_policy = { annotation = "annotation_1" @@ -1379,7 +1383,7 @@ resource "aci_bridge_domain" "test" { }, ] filter_type = "ipv4" - netflow_monitor_policy_name = "netflow_monitor_policy_name_1" + netflow_monitor_policy_name = aci_netflow_monitor_policy.test_netflow_monitor_policy_1.name }, ] relation_to_route_control_profile = { @@ -1404,8 +1408,8 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - l3_outside_name = aci_l3_outside.test_l3_outside_0.name - route_control_profile_name = aci_route_control_profile.test_route_control_profile_0.name + l3_outside_name = aci_l3_outside.test_l3_outside_1.name + route_control_profile_name = aci_route_control_profile.test_route_control_profile_1.name } relation_to_vrf = { annotation = "annotation_1" @@ -1429,7 +1433,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - vrf_name = aci_vrf.test_vrf_1.name + vrf_name = aci_vrf.test_vrf_0.name } rogue_coop_exceptions = [ { @@ -1533,7 +1537,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_0.name + end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_1.name resolve_action = "inherit" } relation_to_first_hop_security_policy = {} @@ -1551,7 +1555,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_1.name + igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_0.name } relation_to_l3_outsides = [ { @@ -1568,7 +1572,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - l3_outside_name = aci_l3_outside.test_l3_outside_0.name + l3_outside_name = aci_l3_outside.test_l3_outside_1.name }, ] relation_to_mld_snooping_policy = { @@ -1585,7 +1589,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_0.name + mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_1.name } relation_to_monitor_policy = {} relation_to_neighbor_discovery_interface_policy = { @@ -1620,7 +1624,7 @@ resource "aci_bridge_domain" "test" { }, ] filter_type = "ipv4" - netflow_monitor_policy_name = "netflow_monitor_policy_name_1" + netflow_monitor_policy_name = aci_netflow_monitor_policy.test_netflow_monitor_policy_1.name }, ] relation_to_route_control_profile = {} @@ -1638,7 +1642,7 @@ resource "aci_bridge_domain" "test" { value = "test_value" }, ] - vrf_name = aci_vrf.test_vrf_1.name + vrf_name = aci_vrf.test_vrf_0.name } rogue_coop_exceptions = [ { @@ -1681,7 +1685,7 @@ resource "aci_bridge_domain" "test" { annotation = "annotation_1" annotations = [] tags = [] - end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_0.name + end_point_retention_policy_name = aci_end_point_retention_policy.test_end_point_retention_policy_1.name resolve_action = "inherit" } relation_to_first_hop_security_policy = {} @@ -1689,14 +1693,14 @@ resource "aci_bridge_domain" "test" { annotation = "annotation_1" annotations = [] tags = [] - igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_1.name + igmp_snooping_policy_name = aci_igmp_snooping_policy.test_igmp_snooping_policy_0.name } relation_to_l3_outsides = [] relation_to_mld_snooping_policy = { annotation = "annotation_1" annotations = [] tags = [] - mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_0.name + mld_snooping_policy_name = aci_mld_snooping_policy.test_mld_snooping_policy_1.name } relation_to_monitor_policy = {} relation_to_neighbor_discovery_interface_policy = { @@ -1711,7 +1715,7 @@ resource "aci_bridge_domain" "test" { annotation = "annotation_1" annotations = [] tags = [] - vrf_name = aci_vrf.test_vrf_1.name + vrf_name = aci_vrf.test_vrf_0.name } rogue_coop_exceptions = [] tags = [] diff --git a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go index eaae97a19..161bd6df4 100644 --- a/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go +++ b/internal/provider/resource_aci_relation_from_bridge_domain_to_netflow_monitor_policy_test.go @@ -189,7 +189,14 @@ func TestAccResourceFvRsBDToNetflowMonitorPolWithFvBD(t *testing.T) { }) } -const testConfigFvRsBDToNetflowMonitorPolMinDependencyWithFvBDAllowExisting = testConfigFvBDMinDependencyWithFvTenant + ` +const testDependencyConfigFvRsBDToNetflowMonitorPol = ` +resource "aci_netflow_monitor_policy" "test_netflow_monitor_policy_0" { + parent_dn = aci_tenant.test.id + name = "netflow_monitor_policy_name_1" +} +` + +const testConfigFvRsBDToNetflowMonitorPolMinDependencyWithFvBDAllowExisting = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "allow_test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" @@ -203,7 +210,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "allow_test } ` -const testConfigFvRsBDToNetflowMonitorPolMinDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolMinDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" @@ -211,7 +218,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { } ` -const testConfigFvRsBDToNetflowMonitorPolAllDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolAllDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id netflow_monitor_policy_name = "test_tn_netflow_monitor_pol_name" @@ -220,7 +227,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { } ` -const testConfigFvRsBDToNetflowMonitorPolResetDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolResetDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id netflow_monitor_policy_name = "test_tn_netflow_monitor_pol_name" @@ -228,7 +235,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { filter_type = "ipv4" } ` -const testConfigFvRsBDToNetflowMonitorPolChildrenDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolChildrenDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" @@ -256,7 +263,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { } ` -const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveFromConfigDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveFromConfigDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" @@ -264,7 +271,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { } ` -const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveOneDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveOneDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" @@ -284,7 +291,7 @@ resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { } ` -const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveAllDependencyWithFvBD = testConfigFvBDMinDependencyWithFvTenant + ` +const testConfigFvRsBDToNetflowMonitorPolChildrenRemoveAllDependencyWithFvBD = testDependencyConfigFvRsBDToNetflowMonitorPol + testConfigFvBDMinDependencyWithFvTenant + ` resource "aci_relation_from_bridge_domain_to_netflow_monitor_policy" "test" { parent_dn = aci_bridge_domain.test.id filter_type = "ipv4" diff --git a/internal/provider/resource_aci_relation_to_contract_master_test.go b/internal/provider/resource_aci_relation_to_contract_master_test.go index e84cac7e0..cf8cfe6ed 100644 --- a/internal/provider/resource_aci_relation_to_contract_master_test.go +++ b/internal/provider/resource_aci_relation_to_contract_master_test.go @@ -22,8 +22,8 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedMinDependencyWithFvAEPgAllowExisting, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), - resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "annotation", "orchestrator:terraform"), ), @@ -54,8 +54,8 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedMinDependencyWithFvAEPgAllowExisting, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), - resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.allow_test_2", "annotation", "orchestrator:terraform"), ), @@ -72,7 +72,7 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedMinDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotation", "orchestrator:terraform"), ), }, @@ -81,7 +81,7 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedAllDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotation", "annotation"), ), }, @@ -90,7 +90,7 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedMinDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), ), }, // Update with empty strings config or default value @@ -98,7 +98,7 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedResetDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotation", "orchestrator:terraform"), ), }, @@ -113,7 +113,7 @@ func TestAccResourceFvRsSecInheritedWithFvAEPg(t *testing.T) { Config: testConfigFvRsSecInheritedChildrenDependencyWithFvAEPg, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_2"), + resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "target_dn", "uni/tn-test_tenant/ap-test_ap/epg-epg_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotation", "orchestrator:terraform"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_relation_to_contract_master.test", "annotations.0.value", "value_1"), @@ -359,11 +359,11 @@ resource "aci_endpoint_security_group" "test_endpoint_security_group_1" { } resource "aci_application_epg" "test_application_epg_0" { application_profile_dn = aci_application_profile.test.id - name = "epg_2" + name = "epg_0" } resource "aci_application_epg" "test_application_epg_1" { application_profile_dn = aci_application_profile.test.id - name = "epg_3" + name = "epg_1" } `