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

func TestAccResourceL3extInstPWithL3extOut(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:             testConfigL3extInstPMinDependencyWithL3extOutAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "target_dscp", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "target_dscp", "unspecified"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.allow_test", "intra_epg_isolation", "unenforced"),
						resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "intra_epg_isolation", "unenforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.allow_test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_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:      testConfigL3extInstPMinDependencyWithL3extOutAllowExisting + 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:             testConfigL3extInstPMinDependencyWithL3extOutAllowExisting + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test", "target_dscp", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "target_dscp", "unspecified"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.allow_test", "intra_epg_isolation", "unenforced"),
						resource.TestCheckResourceAttr("aci_external_epg.allow_test_2", "intra_epg_isolation", "unenforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.allow_test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.allow_test_2", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.allow_test", "scope"),
					resource.TestCheckResourceAttrSet("aci_external_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:             testConfigL3extInstPMinDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "target_dscp", "unspecified"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.test", "intra_epg_isolation", "unenforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config:             testConfigL3extInstPAllDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "contract_exception_tag", "contract_exception_tag_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "target_dscp", "AF11"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.test", "intra_epg_isolation", "enforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config:             testConfigL3extInstPMinDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
				),
			},
			// Update with empty strings config or default value
			{
				Config:             testConfigL3extInstPResetDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "target_dscp", "unspecified"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.test", "intra_epg_isolation", "unenforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_external_epg.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config:             testConfigL3extInstPChildrenDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "contract_exception_tag", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "description", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "flood_in_encapsulation", "disabled"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_external_epg.test", "preferred_group_member", "exclude"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "priority", "unspecified"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "target_dscp", "unspecified"),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_external_epg.test", "intra_epg_isolation", "unenforced")),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_name/out-test_l3_outside/instP-ext_epg_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_name/out-test_l3_outside/instP-ext_epg_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.direction", "export"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.route_control_profile_name", "route_control_profile_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.direction", "import"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.route_control_profile_name", "route_control_profile_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_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_external_epg.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children removed from config
			{
				Config:             testConfigL3extInstPChildrenRemoveFromConfigDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_name/out-test_l3_outside/instP-ext_epg_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.1.target_dn", "uni/tn-test_name/out-test_l3_outside/instP-ext_epg_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.match_criteria", "All"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.priority", "level1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.1.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.direction", "export"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.route_control_profile_name", "route_control_profile_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.direction", "import"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.1.route_control_profile_name", "route_control_profile_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.1.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.#", "2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config:             testConfigL3extInstPChildrenRemoveOneDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.0.target_dn", "uni/tn-test_name/out-test_l3_outside/instP-ext_epg_0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.imported_contract_name", "imported_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.contract_name", "contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.match_criteria", "AtleastOne"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.0.priority", "level2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.direction", "import"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.0.route_control_profile_name", "route_control_profile_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotation", "annotation_2"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.0.taboo_contract_name", "taboo_contract_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.#", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "1"),
				),
			},
			// Update with all children removed
			{
				Config:             testConfigL3extInstPChildrenRemoveAllDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "pc_tag"),
					resource.TestCheckResourceAttrSet("aci_external_epg.test", "scope"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_consumed_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_contract_masters.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_custom_qos_policy.custom_qos_policy_name", "custom_qos_policy_name_1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_imported_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_intra_epg_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_provided_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_route_control_profiles.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "relation_to_taboo_contracts.#", "0"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "tags.#", "0"),
				),
			},
			// Update with minimum config and custom type semantic equivalent values
			{
				Config:             testConfigL3extInstPCustomTypeDependencyWithL3extOut + testConfigDataSourceSystem,
				ExpectNonEmptyPlan: false,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_external_epg.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "priority", "1"),
					resource.TestCheckResourceAttr("aci_external_epg.test", "target_dscp", "0"),
				),
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testChildDependencyConfigL3extInstP = `
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_taboo_contract" "test_taboo_contract_1"{
  tenant_dn = aci_tenant.test.id
  name = "taboo_contract_name_0"
}
resource "aci_taboo_contract" "test_taboo_contract_0"{
  tenant_dn = aci_tenant.test.id
  name = "taboo_contract_name_1"
}
resource "aci_external_epg" "test_external_epg_1"{
  parent_dn = aci_l3_outside.test.id
  name = "ext_epg_0"
}
resource "aci_external_epg" "test_external_epg_0"{
  parent_dn = aci_l3_outside.test.id
  name = "ext_epg_1"
}
`

const testConfigL3extInstPMinDependencyWithL3extOutAllowExisting = testConfigL3extOutMin + `
resource "aci_external_epg" "allow_test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
}
resource "aci_external_epg" "allow_test_2" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  depends_on = [aci_external_epg.allow_test]
}
`

const testConfigL3extInstPMinDependencyWithL3extOut = testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
}
`

const testConfigL3extInstPAllDependencyWithL3extOut = testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  annotation = "annotation"
  contract_exception_tag = "contract_exception_tag_1"
  description = "description_1"
  flood_in_encapsulation = "disabled"
  match_criteria = "All"
  name_alias = "name_alias_1"
  preferred_group_member = "exclude"
  priority = "level1"
  target_dscp = "AF11"
  intra_epg_isolation = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "enforced" : null
}
`

const testConfigL3extInstPResetDependencyWithL3extOut = testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  annotation = "orchestrator:terraform"
  contract_exception_tag = ""
  description = ""
  flood_in_encapsulation = "disabled"
  match_criteria = "AtleastOne"
  name_alias = ""
  preferred_group_member = "exclude"
  priority = "unspecified"
  target_dscp = "unspecified"
  intra_epg_isolation = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "unenforced" : null
}
`
const testConfigL3extInstPChildrenDependencyWithL3extOut = testChildDependencyConfigL3extInstP + testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  annotations = [
    {
      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_external_epg.test_external_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_external_epg.test_external_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_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_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_route_control_profiles = [
    {
      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"
	    },
      ]
      direction = "export"
      route_control_profile_name = "route_control_profile_name_0"
    },
    {
      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"
	    },
      ]
      direction = "import"
      route_control_profile_name = "route_control_profile_name_1"
    },
  ]
  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_1.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_0.name
    },
  ]
  tags = [
    {
      key = "key_0"
      value = "value_1"
    },
    {
      key = "key_1"
      value = "test_value"
    },
  ]
}
`

const testConfigL3extInstPChildrenRemoveFromConfigDependencyWithL3extOut = testChildDependencyConfigL3extInstP + testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
}
`

const testConfigL3extInstPChildrenRemoveOneDependencyWithL3extOut = testChildDependencyConfigL3extInstP + testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  annotations = [ 
	{
	  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_external_epg.test_external_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_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_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_route_control_profiles = [ 
	{
	  annotation = "annotation_2"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
	  direction = "import"
	  route_control_profile_name = "route_control_profile_name_1"
	},
  ]
  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_0.name
	},
  ]
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigL3extInstPChildrenRemoveAllDependencyWithL3extOut = testChildDependencyConfigL3extInstP + testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  annotations = []
  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_imported_contracts = []
  relation_to_intra_epg_contracts = []
  relation_to_provided_contracts = []
  relation_to_route_control_profiles = []
  relation_to_taboo_contracts = []
  tags = []
}
`

const testConfigL3extInstPCustomTypeDependencyWithL3extOut = testChildDependencyConfigL3extInstP + testConfigL3extOutMin + `
resource "aci_external_epg" "test" {
  parent_dn = aci_l3_outside.test.id
  name = "test_name"
  priority = "1"
  target_dscp = "0"
}
`
