// 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).

package provider

import (
	"regexp"
	"testing"

	"github.com/hashicorp/terraform-plugin-testing/helper/resource"
	"github.com/hashicorp/terraform-plugin-testing/knownvalue"
	"github.com/hashicorp/terraform-plugin-testing/statecheck"
	"github.com/hashicorp/terraform-plugin-testing/tfjsonpath"
)

func TestAccResourceFvAEPgWithFvAp(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvAEPgMinDependencyWithFvApAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "useg_epg", "no"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.allow_test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"),
				),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:      testConfigFvAEPgMinDependencyWithFvApAllowExisting + testConfigDataSourceSystem,
				ExpectError: regexp.MustCompile("Object Already Exists"),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvAEPgMinDependencyWithFvApAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test", "useg_epg", "no"),
					resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.allow_test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"),
					resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "scope"),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:             testConfigFvAEPgMinDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config:             testConfigFvAEPgAllDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "contract_exception_tag", "contract_exception_tag_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "forwarding_control", "proxy-arp"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "intra_epg_isolation", "enforced"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "level1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config:             testConfigFvAEPgMinDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
				),
			},
			// Update with empty strings config or default value
			{
				Config:             testConfigFvAEPgResetDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_application_epg.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config:             testConfigFvAEPgChildrenDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "forwarding_control", "none"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "intra_epg_isolation", "unenforced"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "useg_epg", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.match", "all"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name", "criterion"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_tag", "owner_tag_1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.precedence", "1"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.scope", "scope-bd")),
					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", "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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"),
					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_name/ap-test_name/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_name/ap-test_name/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", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.data_plane_policing_policy_name", "data_plane_policing_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.class_preference", "encap"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.delimiter", "@"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.enable_netflow", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation", "vlan-100"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation_mode", "auto"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos", "Cos0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos_pref", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.lag_policy_name", "lag_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.netflow_direction", "both"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation", "vlan-200"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation_inner", "vlan-300"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.resolution_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.secondary_encapsulation_inner", "vlan-400"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "AVE"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "dynamicBinding"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "1"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "elastic")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_1")),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.class_preference", "useg"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.delimiter", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.enable_netflow", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.encapsulation_mode", "vlan"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.epg_cos", "Cos1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.epg_cos_pref", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.lag_policy_name", "lag_policy_name_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.netflow_direction", "egress"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.primary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.resolution_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.secondary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.switching_mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.target_dn", "uni/vmmp-VMware/dom-domain_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.untagged", "yes"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.binding_type", "ephemeral"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.number_of_ports", "0"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.port_allocation", "fixed")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.custom_epg_name", "custom_epg_name_2")),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan", "vsan-10"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan_mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan_mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.monitoring_policy_name", "monitoring_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.encapsulation", "vlan-100"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.target_dn", "topology/pod-1/node-101"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.encapsulation", "vlan-101"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.target_dn", "topology/pod-1/node-102"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.encapsulation", "vlan-202"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.primary_encapsulation", "vlan-203"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.encapsulation", "vlan-201"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.trust_control_policy_name", "trust_control_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.1.value", "test_value"),
				),
			},
			// Refresh State before import testing to ensure that the state is up to date
			{
				RefreshState:       true,
				ExpectNonEmptyPlan: false,
			},
			// Import testing with children
			{
				ResourceName:      "aci_application_epg.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children removed from config
			{
				Config:             testConfigFvAEPgChildrenRemoveFromConfigDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.match", "all"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name", "criterion"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.owner_tag", "owner_tag_1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.precedence", "1"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "epg_useg_block_statement.scope", "scope-bd")),
					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", "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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					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.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					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_consumed_contracts.#", "2"),
					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.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.tags.0.value", "value_1"),
					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_name/ap-test_name/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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.1.tags.0.value", "value_1"),
					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_name/ap-test_name/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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_data_plane_policing_policy.data_plane_policing_policy_name", "data_plane_policing_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.class_preference", "encap"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.delimiter", "@"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.enable_netflow", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation", "vlan-100"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation_mode", "auto"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos", "Cos0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos_pref", "disabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.lag_policy_name", "lag_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.netflow_direction", "both"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation", "vlan-200"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation_inner", "vlan-300"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.resolution_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.secondary_encapsulation_inner", "vlan-400"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "AVE"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "no"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "dynamicBinding"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "1"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "elastic")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_1")),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.class_preference", "useg"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.delimiter", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.enable_netflow", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.encapsulation_mode", "vlan"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.epg_cos", "Cos1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.epg_cos_pref", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.lag_policy_name", "lag_policy_name_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.netflow_direction", "egress"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.primary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.resolution_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.secondary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.switching_mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.target_dn", "uni/vmmp-VMware/dom-domain_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.untagged", "yes"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.binding_type", "ephemeral"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.number_of_ports", "0"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.port_allocation", "fixed")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.1.custom_epg_name", "custom_epg_name_2")),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan", "vsan-10"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan_mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.1.vsan_mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_monitoring_policy.monitoring_policy_name", "monitoring_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.encapsulation", "vlan-100"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.target_dn", "topology/pod-1/node-101"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.encapsulation", "vlan-101"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.1.target_dn", "topology/pod-1/node-102"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.deployment_immediacy", "immediate"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.description", "description_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.encapsulation", "vlan-202"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.primary_encapsulation", "vlan-203"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/1]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.encapsulation", "vlan-201"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.1.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.1.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_trust_control_policy.trust_control_policy_name", "trust_control_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config:             testConfigFvAEPgChildrenRemoveOneDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_1"),
					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", "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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_consumed_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.0.annotations.#", "1"),
					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_name/ap-test_name/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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.class_preference", "useg"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.delimiter", ""),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.enable_netflow", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.encapsulation_mode", "vlan"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos", "Cos1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.epg_cos_pref", "enabled"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.lag_policy_name", "lag_policy_name_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.netflow_direction", "egress"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.primary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.resolution_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.secondary_encapsulation_inner", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.switching_mode", "native"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.target_dn", "uni/vmmp-VMware/dom-domain_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.untagged", "yes"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.binding_type", "ephemeral"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.number_of_ports", "0"),
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.port_allocation", "fixed")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(3j)-", "inside",
						resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.0.custom_epg_name", "custom_epg_name_2")),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.0.vsan_mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.encapsulation", "vlan-101"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.0.target_dn", "topology/pod-1/node-102"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.deployment_immediacy", "lazy"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.description", "description_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.encapsulation", "vlan-201"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.mode", "regular"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.primary_encapsulation", "unknown"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.0.target_dn", "topology/pod-1/paths-101/pathep-[eth1/2]"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "1"),
				),
				ConfigStateChecks: []statecheck.StateCheck{
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("epg_useg_block_statement"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":  knownvalue.Null(),
								"annotations": knownvalue.Null(),
								"tags":        knownvalue.Null(),
								"description": knownvalue.Null(),
								"match":       knownvalue.Null(),
								"name":        knownvalue.Null(),
								"name_alias":  knownvalue.Null(),
								"owner_key":   knownvalue.Null(),
								"owner_tag":   knownvalue.Null(),
								"precedence":  knownvalue.Null(),
								"scope":       knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_data_plane_policing_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":                      knownvalue.Null(),
								"annotations":                     knownvalue.Null(),
								"tags":                            knownvalue.Null(),
								"data_plane_policing_policy_name": knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_monitoring_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":             knownvalue.Null(),
								"annotations":            knownvalue.Null(),
								"tags":                   knownvalue.Null(),
								"monitoring_policy_name": knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_trust_control_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":                knownvalue.Null(),
								"annotations":               knownvalue.Null(),
								"tags":                      knownvalue.Null(),
								"trust_control_policy_name": knownvalue.Null(),
							},
						),
					),
				},
			},
			// Update with all children removed
			{
				Config:             testConfigFvAEPgChildrenRemoveAllDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"),
					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", "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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_contract_masters.#", "0"),
					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"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_domains.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_fibre_channel_paths.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_imported_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_intra_epg_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_provided_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_leafs.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_static_paths.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_taboo_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "tags.#", "0"),
				),
				ConfigStateChecks: []statecheck.StateCheck{
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("epg_useg_block_statement"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":  knownvalue.Null(),
								"annotations": knownvalue.Null(),
								"tags":        knownvalue.Null(),
								"description": knownvalue.Null(),
								"match":       knownvalue.Null(),
								"name":        knownvalue.Null(),
								"name_alias":  knownvalue.Null(),
								"owner_key":   knownvalue.Null(),
								"owner_tag":   knownvalue.Null(),
								"precedence":  knownvalue.Null(),
								"scope":       knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_data_plane_policing_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":                      knownvalue.Null(),
								"annotations":                     knownvalue.Null(),
								"tags":                            knownvalue.Null(),
								"data_plane_policing_policy_name": knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_monitoring_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":             knownvalue.Null(),
								"annotations":            knownvalue.Null(),
								"tags":                   knownvalue.Null(),
								"monitoring_policy_name": knownvalue.Null(),
							},
						),
					),
					statecheck.ExpectKnownValue("aci_application_epg.test",
						tfjsonpath.New("relation_to_trust_control_policy"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":                knownvalue.Null(),
								"annotations":               knownvalue.Null(),
								"tags":                      knownvalue.Null(),
								"trust_control_policy_name": knownvalue.Null(),
							},
						),
					),
				},
			},
			// Update with minimum config and custom type semantic equivalent values
			{
				Config:             testConfigFvAEPgCustomTypeDependencyWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_application_epg.test", "priority", "1"),
				),
			},
			// Update with legacy attribute config
			{
				Config:             testConfigFvAEPgLegacyAttributesWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "apic", "1.0(1e)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with legacy attribute config
			{
				Config:             testConfigFvAEPgLegacyAttributesWithFvAp + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testChildDependencyConfigFvAEPg = `
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_contract" "test_contract_0"{
  tenant_dn = aci_tenant.test.id
  name = "contract_name_0"
}
resource "aci_contract" "test_contract_1"{
  tenant_dn = aci_tenant.test.id
  name = "contract_name_1"
}
resource "aci_imported_contract" "test_imported_contract_0"{
  tenant_dn = aci_tenant.test.id
  name = "imported_contract_name_0"
}
resource "aci_imported_contract" "test_imported_contract_1"{
  tenant_dn = aci_tenant.test.id
  name = "imported_contract_name_1"
}
resource "aci_custom_qos_policy" "test_custom_qos_policy_0"{
  parent_dn = aci_tenant.test.id
  name = "custom_qos_policy_name_1"
}
resource "aci_data_plane_policing_policy" "test_data_plane_policing_policy_1"{
  parent_dn = aci_tenant.test.id
  name = "data_plane_policing_policy_name_1"
}
resource "aci_taboo_contract" "test_taboo_contract_0"{
  tenant_dn = aci_tenant.test.id
  name = "taboo_contract_name_0"
}
resource "aci_taboo_contract" "test_taboo_contract_1"{
  tenant_dn = aci_tenant.test.id
  name = "taboo_contract_name_1"
}
resource "aci_application_epg" "test_application_epg_0"{
  application_profile_dn = aci_application_profile.test.id
  name = "epg_0"
}
resource "aci_application_epg" "test_application_epg_1"{
  application_profile_dn = aci_application_profile.test.id
  name = "epg_1"
}
resource "aci_trust_control_policy" "test_trust_control_policy_0"{
  parent_dn = aci_tenant.test.id
  name = "trust_control_policy_name_1"
}
`

const testConfigFvAEPgMinDependencyWithFvApAllowExisting = testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "allow_test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
}
resource "aci_application_epg" "allow_test_2" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  depends_on = [aci_application_epg.allow_test]
}
`

const testConfigFvAEPgMinDependencyWithFvAp = testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
}
`

const testConfigFvAEPgAllDependencyWithFvAp = testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  annotation = "annotation"
  contract_exception_tag = "contract_exception_tag_1"
  description = "description_1"
  flood_in_encapsulation = "disabled"
  forwarding_control = "proxy-arp"
  intra_epg_isolation = "enforced"
  match_criteria = "All"
  name_alias = "name_alias_1"
  preferred_group_member = "exclude"
  priority = "level1"
  useg_epg = "no"
  admin_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "no" : null
  has_multicast_source = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "no" : null
}
`

const testConfigFvAEPgResetDependencyWithFvAp = testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  annotation = "orchestrator:terraform"
  contract_exception_tag = ""
  description = ""
  flood_in_encapsulation = "disabled"
  forwarding_control = "none"
  intra_epg_isolation = "unenforced"
  match_criteria = "AtleastOne"
  name_alias = ""
  preferred_group_member = "exclude"
  priority = "unspecified"
  useg_epg = "no"
  admin_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "no" : null
  has_multicast_source = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "no" : null
}
`
const testConfigFvAEPgChildrenDependencyWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  annotations = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
  epg_useg_block_statement = {
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    description = "description_1"
    match = "all"
    name = "criterion"
    name_alias = "name_alias_1"
    owner_key = "owner_key_1"
    owner_tag = "owner_tag_1"
  	precedence = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "1" : null
  	scope = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "scope-bd" : null
  }
  relation_to_bridge_domain = {
    annotation = "annotation_1"
    bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
  }
  relation_to_consumed_contracts = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_0.name
      priority = "level1"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_1.name
      priority = "level2"
    },
  ]
  relation_to_contract_masters = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      target_dn = aci_application_epg.test_application_epg_0.id
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      target_dn = aci_application_epg.test_application_epg_1.id
    },
  ]
  relation_to_custom_qos_policy = {
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    custom_qos_policy_name = aci_custom_qos_policy.test_custom_qos_policy_0.name
  }
  relation_to_data_plane_policing_policy = {
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    data_plane_policing_policy_name = aci_data_plane_policing_policy.test_data_plane_policing_policy_1.name
  }
  relation_to_domains = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      class_preference = "encap"
      delimiter = "@"
      deployment_immediacy = "immediate"
      enable_netflow = "disabled"
      encapsulation = "vlan-100"
      encapsulation_mode = "auto"
      epg_cos = "Cos0"
      epg_cos_pref = "disabled"
      lag_policy_name = "lag_policy_name_1"
      netflow_direction = "both"
      primary_encapsulation = "vlan-200"
      primary_encapsulation_inner = "vlan-300"
      resolution_immediacy = "immediate"
      secondary_encapsulation_inner = "vlan-400"
      switching_mode = "AVE"
      target_dn = "uni/vmmp-VMware/dom-domain_1"
      untagged = "no"
      binding_type = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "dynamicBinding" : null
      number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "1" : null
      port_allocation = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "elastic" : null
      custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(3j)-") ? "custom_epg_name_1" : null
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      class_preference = "useg"
      delimiter = ""
      deployment_immediacy = "lazy"
      enable_netflow = "enabled"
      encapsulation = "unknown"
      encapsulation_mode = "vlan"
      epg_cos = "Cos1"
      epg_cos_pref = "enabled"
      lag_policy_name = "lag_policy_name_2"
      netflow_direction = "egress"
      primary_encapsulation = "unknown"
      primary_encapsulation_inner = "unknown"
      resolution_immediacy = "lazy"
      secondary_encapsulation_inner = "unknown"
      switching_mode = "native"
      target_dn = "uni/vmmp-VMware/dom-domain_2"
      untagged = "yes"
      binding_type = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "ephemeral" : null
      number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "0" : null
      port_allocation = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "fixed" : null
      custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(3j)-") ? "custom_epg_name_2" : null
    },
  ]
  relation_to_fibre_channel_paths = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      description = "description_1"
      target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]"
      vsan = "vsan-10"
      vsan_mode = "native"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      description = "description_2"
      target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]"
      vsan = "unknown"
      vsan_mode = "regular"
    },
  ]
  relation_to_imported_contracts = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      imported_contract_name = aci_imported_contract.test_imported_contract_0.name
      priority = "level1"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      imported_contract_name = aci_imported_contract.test_imported_contract_1.name
      priority = "level2"
    },
  ]
  relation_to_intra_epg_contracts = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_0.name
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_1.name
    },
  ]
  relation_to_monitoring_policy = {
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    monitoring_policy_name = aci_monitoring_policy.test_monitoring_policy_0.name
  }
  relation_to_provided_contracts = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_0.name
      match_criteria = "All"
      priority = "level1"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      contract_name = aci_contract.test_contract_1.name
      match_criteria = "AtleastOne"
      priority = "level2"
    },
  ]
  relation_to_static_leafs = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      deployment_immediacy = "immediate"
      description = "description_1"
      encapsulation = "vlan-100"
      mode = "native"
      target_dn = "topology/pod-1/node-101"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      deployment_immediacy = "lazy"
      description = "description_2"
      encapsulation = "vlan-101"
      mode = "regular"
      target_dn = "topology/pod-1/node-102"
    },
  ]
  relation_to_static_paths = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      deployment_immediacy = "immediate"
      description = "description_1"
      encapsulation = "vlan-202"
      mode = "native"
      primary_encapsulation = "vlan-203"
      target_dn = "topology/pod-1/paths-101/pathep-[eth1/1]"
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      deployment_immediacy = "lazy"
      description = "description_2"
      encapsulation = "vlan-201"
      mode = "regular"
      primary_encapsulation = "unknown"
      target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]"
    },
  ]
  relation_to_taboo_contracts = [
    {
      annotation = "annotation_1"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      taboo_contract_name = aci_taboo_contract.test_taboo_contract_0.name
    },
    {
      annotation = "annotation_2"
      annotations = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [
	    {
          key = "key_0"
          value = "value_1"
	    },
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      taboo_contract_name = aci_taboo_contract.test_taboo_contract_1.name
    },
  ]
  relation_to_trust_control_policy = {
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    trust_control_policy_name = aci_trust_control_policy.test_trust_control_policy_0.name
  }
  tags = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
}
`

const testConfigFvAEPgChildrenRemoveFromConfigDependencyWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
}
`

const testConfigFvAEPgChildrenRemoveOneDependencyWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  epg_useg_block_statement = {}
  relation_to_bridge_domain = {
    annotation = "annotation_1"
    bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name
    annotations = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
  }
  relation_to_consumed_contracts = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  contract_name = aci_contract.test_contract_1.name
	  priority = "level2"
	},
  ]
  relation_to_contract_masters = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  target_dn = aci_application_epg.test_application_epg_1.id
	},
  ]
  relation_to_custom_qos_policy = {
    annotation = "annotation_1"
    annotations = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    custom_qos_policy_name = aci_custom_qos_policy.test_custom_qos_policy_0.name
  }
  relation_to_data_plane_policing_policy = {}
  relation_to_domains = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  class_preference = "useg"
	  delimiter = ""
	  deployment_immediacy = "lazy"
	  enable_netflow = "enabled"
	  encapsulation = "unknown"
	  encapsulation_mode = "vlan"
	  epg_cos = "Cos1"
	  epg_cos_pref = "enabled"
	  lag_policy_name = "lag_policy_name_2"
	  netflow_direction = "egress"
	  primary_encapsulation = "unknown"
	  primary_encapsulation_inner = "unknown"
	  resolution_immediacy = "lazy"
	  secondary_encapsulation_inner = "unknown"
	  switching_mode = "native"
	  target_dn = "uni/vmmp-VMware/dom-domain_2"
	  untagged = "yes"
  	  binding_type = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "ephemeral" : null
  	  number_of_ports = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "0" : null
  	  port_allocation = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "fixed" : null
  	  custom_epg_name = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(3j)-") ? "custom_epg_name_2" : null
	},
  ]
  relation_to_fibre_channel_paths = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  description = "description_2"
	  target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]"
	  vsan = "unknown"
	  vsan_mode = "regular"
	},
  ]
  relation_to_imported_contracts = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  imported_contract_name = aci_imported_contract.test_imported_contract_1.name
	  priority = "level2"
	},
  ]
  relation_to_intra_epg_contracts = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  contract_name = aci_contract.test_contract_1.name
	},
  ]
  relation_to_monitoring_policy = {}
  relation_to_provided_contracts = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  contract_name = aci_contract.test_contract_1.name
	  match_criteria = "AtleastOne"
	  priority = "level2"
	},
  ]
  relation_to_static_leafs = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  deployment_immediacy = "lazy"
	  description = "description_2"
	  encapsulation = "vlan-101"
	  mode = "regular"
	  target_dn = "topology/pod-1/node-102"
	},
  ]
  relation_to_static_paths = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  deployment_immediacy = "lazy"
	  description = "description_2"
	  encapsulation = "vlan-201"
	  mode = "regular"
	  primary_encapsulation = "unknown"
	  target_dn = "topology/pod-1/paths-101/pathep-[eth1/2]"
	},
  ]
  relation_to_taboo_contracts = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  taboo_contract_name = aci_taboo_contract.test_taboo_contract_1.name
	},
  ]
  relation_to_trust_control_policy = {}
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigFvAEPgChildrenRemoveAllDependencyWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  annotations = []
  epg_useg_block_statement = {}
  relation_to_bridge_domain = {
    annotation = "annotation_1"
    bridge_domain_name = aci_bridge_domain.test_bridge_domain_1.name
    annotations = []
    tags = []
  }
  relation_to_consumed_contracts = []
  relation_to_contract_masters = []
  relation_to_custom_qos_policy = {
    annotation = "annotation_1"
    annotations = []
    tags = []
    custom_qos_policy_name = aci_custom_qos_policy.test_custom_qos_policy_0.name
  }
  relation_to_data_plane_policing_policy = {}
  relation_to_domains = []
  relation_to_fibre_channel_paths = []
  relation_to_imported_contracts = []
  relation_to_intra_epg_contracts = []
  relation_to_monitoring_policy = {}
  relation_to_provided_contracts = []
  relation_to_static_leafs = []
  relation_to_static_paths = []
  relation_to_taboo_contracts = []
  relation_to_trust_control_policy = {}
  tags = []
}
`

const testConfigFvAEPgCustomTypeDependencyWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  parent_dn = aci_application_profile.test.id
  name = "test_name"
  priority = "1"
}
`
const testConfigFvAEPgLegacyAttributesWithFvAp = testChildDependencyConfigFvAEPg + testConfigFvApMinDependencyWithFvTenant + `
resource "aci_application_epg" "test" {
  name = "test_name"
  application_profile_dn = aci_application_profile.test.id
  exception_tag = "contract_exception_tag_1"
  flood_on_encap = "disabled"
  fwd_ctrl = "none"
  has_mcast_source = "no"
  is_attr_based_epg = "no"
  match_t = "All"
  pc_enf_pref = "enforced"
  pref_gr_memb = "exclude"
  prio = "level1"
  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_1.id]
  relation_fv_rs_cons_if = [aci_imported_contract.test_imported_contract_1.id]
  relation_fv_rs_cust_qos_pol = aci_custom_qos_policy.test_custom_qos_policy_0.id
  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_intra_epg = [aci_contract.test_contract_1.id]
  relation_fv_rs_prot_by = [aci_taboo_contract.test_taboo_contract_1.id]
  relation_fv_rs_prov = [aci_contract.test_contract_1.id]
  relation_fv_rs_sec_inherited = [aci_application_epg.test_application_epg_0.id]
  relation_fv_rs_trust_ctrl = aci_trust_control_policy.test_trust_control_policy_0.id
  shutdown = "no"
  relation_fv_rs_node_att {
    deployment_immediacy = "immediate"
    description = "description_1"
    encap = "vlan-101"
    mode = "native"
    node_dn = "topology/pod-1/node-101"
  }
}
`
