// Code generated by "gen/generator.go"; DO NOT EDIT.
// In order to regenerate this file execute `go generate` from the repository root.
// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).

package provider

import (
	"regexp"
	"testing"

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

func TestAccResourceCommPol(t *testing.T) {

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "6.0(2h)-6.0(8g),6.1(3f)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigCommPolMinAllowExisting + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_tag", ""),
				),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "false")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "6.0(2h)-6.0(8g),6.1(3f)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config:      testConfigCommPolMinAllowExisting,
				ExpectError: regexp.MustCompile("Object Already Exists"),
			},
		},
	})

	setEnvVariable(t, "ACI_ALLOW_EXISTING_ON_CREATE", "true")
	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "6.0(2h)-6.0(8g),6.1(3f)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigCommPolMinAllowExisting + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.allow_test_2", "owner_tag", ""),
				),
			},
		},
	})

	resource.Test(t, resource.TestCase{
		PreCheck:                 func() { testAccPreCheck(t, "both", "6.0(2h)-6.0(8g),6.1(3f)-") },
		ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
		Steps: []resource.TestStep{
			// Create with minimum config and verify default APIC values
			{
				Config: testConfigCommPolMin + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
				),
			},
			// Update with all config and verify default APIC values
			{
				Config: testConfigCommPolAll + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "annotation"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", "owner_tag_1"),
				),
			},
			// Update with minimum config and verify config is unchanged
			{
				Config: testConfigCommPolMin + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", "owner_key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", "owner_tag_1"),
				),
			},
			// Update with empty strings config or default value
			{
				Config: testConfigCommPolReset + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name", "test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
				),
			},
			// Import testing
			{
				ResourceName:      "aci_management_access_policy.test",
				ImportState:       true,
				ImportStateVerify: true,
			},
			// Update with children
			{
				Config: testConfigCommPolChildren + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.target_dn", "uni/userext/pkiext/tp-test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_parameter", "1024"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_certificate_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(7f)-4.2(7w),5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.#", "1"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.0", "curve25519-sha256")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"),
				),
			},
			// Update with children removed from config
			{
				Config: testConfigCommPolChildrenRemoveFromConfig + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.certificate_authority.target_dn", "uni/userext/pkiext/tp-test_name"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_parameter", "1024"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_certificate_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(7f)-4.2(7w),5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.#", "1"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.0", "curve25519-sha256")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "value_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.1.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"),
				),
			},
			// Update with children first child removed
			{
				Config: testConfigCommPolChildrenRemoveOne + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_parameter", "1024"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_certificate_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(7f)-4.2(7w),5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.#", "1"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.0", "curve25519-sha256")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.key", "key_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.0.value", "test_value"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"),
				),
				ConfigStateChecks: []statecheck.StateCheck{
					statecheck.ExpectKnownValue("aci_management_access_policy.test",
						tfjsonpath.New("http_ssl_configuration").AtMapKey("certificate_authority"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":  knownvalue.Null(),
								"annotations": knownvalue.Null(),
								"tags":        knownvalue.Null(),
								"target_dn":   knownvalue.Null(),
							},
						),
					),
				},
			},
			// Update with all children removed
			{
				Config: testConfigCommPolChildrenRemoveAll + testConfigDataSourceSystem,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotation", "orchestrator:terraform"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "description", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "name_alias", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_key", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "owner_tag", ""),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.port", "80"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.redirect_state", "disabled"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.node_exporter", "disabled")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_service.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.admin_state", "enabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_credentials", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.allow_origins", "allow_origins_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.key_ring.key_ring_name", "default"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.dh_parameter", "1024"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_rate", "2"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.login_throttle_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.max_request_status_count", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.port", "443"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.ssl_protocols.0", "TLSv1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.0(1h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.client_certificate_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.cli_only_mode", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_rate", "10000"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_state", "disabled"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.global_throttle_unit", "r/s")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.server_header", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "5.2(3e)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.node_exporter", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "6.0(2h)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.referer", "referer_1")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "http_ssl_configuration.visore_access", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_access_via_web.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.port", "22"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_ciphers.0", "aes192-ctr"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.#", "1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.ssh_macs.0", "hmac-sha1"),
					composeAggregateTestCheckFuncWithVersion(t, "4.1(1i)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.password_authentication_state", "disabled")),
					composeAggregateTestCheckFuncWithVersion(t, "4.2(7f)-4.2(7w),5.2(1g)-", "inside",
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.#", "1"),
						resource.TestCheckResourceAttr("aci_management_access_policy.test", "ssh_service.kex_algorithms.0", "curve25519-sha256")),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.admin_state", "disabled"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotation", "annotation_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.annotations.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.tags.#", "0"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.description", "description_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name", "name_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.name_alias", "name_alias_1"),
					resource.TestCheckResourceAttr("aci_management_access_policy.test", "telnet_service.port", "23"),
				),
				ConfigStateChecks: []statecheck.StateCheck{
					statecheck.ExpectKnownValue("aci_management_access_policy.test",
						tfjsonpath.New("http_ssl_configuration").AtMapKey("certificate_authority"),
						knownvalue.MapExact(
							map[string]knownvalue.Check{
								"annotation":  knownvalue.Null(),
								"annotations": knownvalue.Null(),
								"tags":        knownvalue.Null(),
								"target_dn":   knownvalue.Null(),
							},
						),
					),
				},
			},
		},
		CheckDestroy: testCheckResourceDestroy,
	})
}

const testChildDependencyConfigCommPol = `
resource "aci_certificate_authority" "test_certificate_authority_0"{
  certificate_chain = "-----BEGIN CERTIFICATE-----\nMIICODCCAaGgAwIBAgIJAIt8XMntue0VMA0GCSqGSIb3DQEBCwUAMDQxDjAMBgNV\nBAMMBUFkbWluMRUwEwYDVQQKDAxZb3VyIENvbXBhbnkxCzAJBgNVBAYTAlVTMCAX\nDTE4MDEwOTAwNTk0NFoYDzIxMTcxMjE2MDA1OTQ0WjA0MQ4wDAYDVQQDDAVBZG1p\nbjEVMBMGA1UECgwMWW91ciBDb21wYW55MQswCQYDVQQGEwJVUzCBnzANBgkqhkiG\n9w0BAQEFAAOBjQAwgYkCgYEAohG/7axtt7CbSaMP7r+2mhTKbNgh0Ww36C7Ta14i\nv+VmLyKkQHnXinKGhp6uy3Nug+15a+eIu7CrgpBVMQeCiWfsnwRocKcQJWIYDrWl\nXHxGQn31yYKR6mylE7Dcj3rMFybnyhezr5D8GcP85YRPmwG9H2hO/0Y1FUnWu9Iw\nAQkCAwEAAaNQME4wHQYDVR0OBBYEFD0jLXfpkrU/ChzRvfruRs/fy1VXMB8GA1Ud\nIwQYMBaAFD0jLXfpkrU/ChzRvfruRs/fy1VXMAwGA1UdEwQFMAMBAf8wDQYJKoZI\nhvcNAQELBQADgYEAOmvre+5tgZ0+F3DgsfxNQqLTrGiBgGCIymPkP/cBXXkNuJyl\n3ac7tArHQc7WEA4U2R2rZbEq8FC3UJJm4nUVtCPvEh3G9OhN2xwYev79yt6pIn/l\nKU0Td2OpVyo0eLqjoX5u2G90IBWzhyjFbo+CcKMrSVKj1YOdG0E3OuiJf00=\n-----END CERTIFICATE-----"
  name = "test_name"
}
`

const testConfigCommPolMinAllowExisting = `
resource "aci_management_access_policy" "allow_test" {
  name = "test_name"
}
resource "aci_management_access_policy" "allow_test_2" {
  name = "test_name"
  depends_on = [aci_management_access_policy.allow_test]
}
`

const testConfigCommPolMin = `
resource "aci_management_access_policy" "test" {
  name = "test_name"
}
`

const testConfigCommPolAll = `
resource "aci_management_access_policy" "test" {
  name = "test_name"
  annotation = "annotation"
  description = "description_1"
  name_alias = "name_alias_1"
  owner_key = "owner_key_1"
  owner_tag = "owner_tag_1"
}
`

const testConfigCommPolReset = `
resource "aci_management_access_policy" "test" {
  name = "test_name"
  annotation = "orchestrator:terraform"
  description = ""
  name_alias = ""
  owner_key = ""
  owner_tag = ""
}
`
const testConfigCommPolChildren = testChildDependencyConfigCommPol + `
resource "aci_management_access_policy" "test" {
  name = "test_name"
  annotations = [
	{
	  key = "key_0"
	  value = "value_1"
	},
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  http_service = {
    admin_state = "disabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    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"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "80"
    redirect_state = "disabled"
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
    visore_access = "disabled"
  }
  http_ssl_configuration = {
    admin_state = "enabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    annotation = "annotation_1"
    annotations = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    certificate_authority = {
      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 = "uni/userext/pkiext/tp-test_name"
    }
    key_ring = {
      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"
	    },
      ]
      key_ring_name = "default"
    }
    tags = [
	  {
        key = "key_0"
        value = "value_1"
	  },
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    description = "description_1"
    dh_parameter = "1024"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "443"
    ssl_protocols = ["TLSv1"]
  	client_certificate_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "disabled" : null
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
  	referer = provider::aci::compare_versions(data.aci_system.version.version,"inside","6.0(2h)-") ? "referer_1" : null
    visore_access = "disabled"
  }
  ssh_access_via_web = {
    admin_state = "disabled"
    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"
  }
  ssh_service = {
    admin_state = "disabled"
    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"
    port = "22"
    ssh_ciphers = ["aes192-ctr"]
    ssh_macs = ["hmac-sha1"]
  	password_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
	kex_algorithms = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(7f)-4.2(7w),5.2(1g)-") ? ["curve25519-sha256"] : null
  }
  tags = [
	{
	  key = "key_0"
	  value = "value_1"
	},
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  telnet_service = {
    admin_state = "disabled"
    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"
    port = "23"
  }
	  	
  depends_on = [aci_certificate_authority.test_certificate_authority_0]
}
`

const testConfigCommPolChildrenRemoveFromConfig = testChildDependencyConfigCommPol + `
resource "aci_management_access_policy" "test" {
  name = "test_name"
}
`

const testConfigCommPolChildrenRemoveOne = testChildDependencyConfigCommPol + `
resource "aci_management_access_policy" "test" {
  name = "test_name"
  annotations = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  http_service = {
    admin_state = "disabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    annotation = "annotation_1"
    annotations = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    tags = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    description = "description_1"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "80"
    redirect_state = "disabled"
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
    visore_access = "disabled"
  }
  http_ssl_configuration = {
    admin_state = "enabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    annotation = "annotation_1"
    annotations = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    certificate_authority = {}
    key_ring = {
      annotation = "annotation_1"
      annotations = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      tags = [ 
	    {
          key = "key_1"
          value = "test_value"
	    },
      ]
      key_ring_name = "default"
    }
    tags = [ 
	  {
        key = "key_1"
        value = "test_value"
	  },
    ]
    description = "description_1"
    dh_parameter = "1024"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "443"
    ssl_protocols = ["TLSv1"]
  	client_certificate_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "disabled" : null
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
  	referer = provider::aci::compare_versions(data.aci_system.version.version,"inside","6.0(2h)-") ? "referer_1" : null
    visore_access = "disabled"
  }
  ssh_access_via_web = {
    admin_state = "disabled"
    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"
  }
  ssh_service = {
    admin_state = "disabled"
    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"
    port = "22"
    ssh_ciphers = ["aes192-ctr"]
    ssh_macs = ["hmac-sha1"]
  	password_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
	kex_algorithms = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(7f)-4.2(7w),5.2(1g)-") ? ["curve25519-sha256"] : null
  }
  tags = [ 
	{
	  key = "key_1"
	  value = "test_value"
	},
  ]
  telnet_service = {
    admin_state = "disabled"
    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"
    port = "23"
  }
}
`

const testConfigCommPolChildrenRemoveAll = testChildDependencyConfigCommPol + `
resource "aci_management_access_policy" "test" {
  name = "test_name"
  annotations = []
  http_service = {
    admin_state = "disabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    annotation = "annotation_1"
    annotations = []
    tags = []
    description = "description_1"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "80"
    redirect_state = "disabled"
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
    visore_access = "disabled"
  }
  http_ssl_configuration = {
    admin_state = "enabled"
    allow_credentials = "disabled"
    allow_origins = "allow_origins_1"
    annotation = "annotation_1"
    annotations = []
    certificate_authority = {}
    key_ring = {
      annotation = "annotation_1"
      annotations = []
      tags = []
      key_ring_name = "default"
    }
    tags = []
    description = "description_1"
    dh_parameter = "1024"
    login_throttle_rate = "2"
    login_throttle_state = "disabled"
    max_request_status_count = "0"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "443"
    ssl_protocols = ["TLSv1"]
  	client_certificate_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.0(1h)-") ? "disabled" : null
  	cli_only_mode = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
  	global_throttle_rate = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "10000" : null
  	global_throttle_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "disabled" : null
  	global_throttle_unit = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(1i)-") ? "r/s" : null
  	server_header = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(1g)-") ? "disabled" : null
  	node_exporter = provider::aci::compare_versions(data.aci_system.version.version,"inside","5.2(3e)-") ? "disabled" : null
  	referer = provider::aci::compare_versions(data.aci_system.version.version,"inside","6.0(2h)-") ? "referer_1" : null
    visore_access = "disabled"
  }
  ssh_access_via_web = {
    admin_state = "disabled"
    annotation = "annotation_1"
    annotations = []
    tags = []
    description = "description_1"
    name = "name_1"
    name_alias = "name_alias_1"
  }
  ssh_service = {
    admin_state = "disabled"
    annotation = "annotation_1"
    annotations = []
    tags = []
    description = "description_1"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "22"
    ssh_ciphers = ["aes192-ctr"]
    ssh_macs = ["hmac-sha1"]
  	password_authentication_state = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.1(1i)-") ? "disabled" : null
	kex_algorithms = provider::aci::compare_versions(data.aci_system.version.version,"inside","4.2(7f)-4.2(7w),5.2(1g)-") ? ["curve25519-sha256"] : null
  }
  tags = []
  telnet_service = {
    admin_state = "disabled"
    annotation = "annotation_1"
    annotations = []
    tags = []
    description = "description_1"
    name = "name_1"
    name_alias = "name_alias_1"
    port = "23"
  }
}
`
