// 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 TestAccResourceFvFabricExtConnP(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "2.0(1m)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigFvFabricExtConnPMinAllowExisting,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "site_id", "0"),
				),
			},
		},
	})

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

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "2.0(1m)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigFvFabricExtConnPMinAllowExisting,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.allow_test_2", "site_id", "0"),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "2.0(1m)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigFvFabricExtConnPMin,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config: testConfigFvFabricExtConnPAll,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "1"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config: testConfigFvFabricExtConnPMin,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "1"),
				),
			},
			// Update with empty strings config or default value
			{
				Config: testConfigFvFabricExtConnPReset,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "community", "extended:as2-nn4:5:16"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "fabric_id", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_fabric_external_connection_policy.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config: testConfigFvFabricExtConnPChildren,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.password", "password_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.type", "automatic_with_full_mesh"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.#", "2"),
				),
			},
			// Update with children removed from config
			{
				Config: testConfigFvFabricExtConnPChildrenRemoveFromConfig,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.password", "password_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.type", "automatic_with_full_mesh"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.#", "2"),
				),
			},
			// Update with children first child removed
			{
				Config: testConfigFvFabricExtConnPChildrenRemoveOne,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.password", "password_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.type", "automatic_with_full_mesh"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.#", "1"),
				),
			},
			// Update with all children removed
			{
				Config: testConfigFvFabricExtConnPChildrenRemoveAll,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "site_id", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.description", "description_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name", "name_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.owner_tag", "owner_tag_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.password", "password_1"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "peering_profile.type", "automatic_with_full_mesh"),
					resource.TestCheckResourceAttr("aci_fabric_external_connection_policy.test", "tags.#", "0"),
				),
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testConfigFvFabricExtConnPMinAllowExisting = `
resource "aci_fabric_external_connection_policy" "allow_test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
}
resource "aci_fabric_external_connection_policy" "allow_test_2" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
  depends_on = [aci_fabric_external_connection_policy.allow_test]
}
`

const testConfigFvFabricExtConnPMin = `
resource "aci_fabric_external_connection_policy" "test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
}
`

const testConfigFvFabricExtConnPAll = `
resource "aci_fabric_external_connection_policy" "test" {
  fabric_id = "1"
  annotation = "annotation"
  community = "extended:as2-nn4:5:16"
  description = "description_1"
  name = "name_1"
  name_alias = "name_alias_1"
  owner_key = "owner_key_1"
  owner_tag = "owner_tag_1"
  site_id = "1"
}
`

const testConfigFvFabricExtConnPReset = `
resource "aci_fabric_external_connection_policy" "test" {
  fabric_id = "1"
  annotation = "orchestrator:terraform"
  community = "extended:as2-nn4:5:16"
  description = ""
  name = ""
  name_alias = ""
  owner_key = ""
  owner_tag = ""
  site_id = "0"
}
`
const testConfigFvFabricExtConnPChildren = `
resource "aci_fabric_external_connection_policy" "test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
  annotations = [
	{
	  key = "key_0"
	  value = "value_1"
	},
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  peering_profile = {
    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"
    name = "name_1"
    name_alias = "name_alias_1"
    owner_key = "owner_key_1"
    owner_tag = "owner_tag_1"
    password = "password_1"
    type = "automatic_with_full_mesh"
  }
  tags = [
	{
	  key = "key_0"
	  value = "value_1"
	},
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigFvFabricExtConnPChildrenRemoveFromConfig = `
resource "aci_fabric_external_connection_policy" "test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
}
`

const testConfigFvFabricExtConnPChildrenRemoveOne = `
resource "aci_fabric_external_connection_policy" "test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  peering_profile = {
    annotation = "annotation_1"
    annotations = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    description = "description_1"
    name = "name_1"
    name_alias = "name_alias_1"
    owner_key = "owner_key_1"
    owner_tag = "owner_tag_1"
    password = "password_1"
    type = "automatic_with_full_mesh"
  }
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
}
`

const testConfigFvFabricExtConnPChildrenRemoveAll = `
resource "aci_fabric_external_connection_policy" "test" {
  community = "extended:as2-nn4:5:16"
  fabric_id = "1"
  annotations = []
  peering_profile = {
    annotation = "annotation_1"
    annotations = []
    tags = []
    description = "description_1"
    name = "name_1"
    name_alias = "name_alias_1"
    owner_key = "owner_key_1"
    owner_tag = "owner_tag_1"
    password = "password_1"
    type = "automatic_with_full_mesh"
  }
  tags = []
}
`
