diff --git a/internal/services/containers/kubernetes_cluster_addons_resource_test.go b/internal/services/containers/kubernetes_cluster_addons_resource_test.go index 763b91004c93..e17b2db6932f 100644 --- a/internal/services/containers/kubernetes_cluster_addons_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_addons_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" ) var addOnAppGatewaySubnetCIDR string = "10.225.0.0/16" // AKS will use 10.224.0.0/12 for the aks subnet so use 10.225.0.0/16 for the app gateway subnet @@ -309,23 +308,19 @@ func TestAccKubernetesCluster_addonProfileServiceMeshProfile_certificateAuthorit } func TestAccKubernetesCluster_addonProfileServiceMeshProfile_revisions(t *testing.T) { - if !features.FourPointOhBeta() { - t.Skip("Service Mesh Profile Revisions are only available in version 4.0.0 and later") - } - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.addonProfileServiceMeshProfileRevisionsConfig(data, `["asm-1-20"]`), + Config: r.addonProfileServiceMeshProfileRevisionsConfig(data, `["asm-1-22"]`), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep(), { - Config: r.addonProfileServiceMeshProfileRevisionsConfig(data, `["asm-1-20", "asm-1-21"]`), + Config: r.addonProfileServiceMeshProfileRevisionsConfig(data, `["asm-1-22", "asm-1-23"]`), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), @@ -1209,270 +1204,6 @@ resource "azurerm_kubernetes_cluster" "test" { } func (k KubernetesClusterResource) addonProfileServiceMeshProfileCertificateAuthorityConfig(data acceptance.TestData) string { - if !features.FourPointOhBeta() { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%[1]s" - location = "%[2]s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctestvirtnet%[1]s" - address_space = ["10.1.0.0/16", "fd00:db8:deca::/48"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctestsubnet%[1]s" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.1.0.0/24", "fd00:db8:deca:deed::/64"] -} - -data "azurerm_client_config" "current" {} - -resource "azurerm_key_vault" "test" { - name = "acctestKV-%[1]s" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - tenant_id = data.azurerm_client_config.current.tenant_id - sku_name = "standard" -} - -resource "azurerm_key_vault_access_policy" "test" { - key_vault_id = azurerm_key_vault.test.id - tenant_id = data.azurerm_client_config.current.tenant_id - object_id = data.azurerm_client_config.current.object_id - certificate_permissions = [ - "Create", - "Delete", - "DeleteIssuers", - "Get", - "GetIssuers", - "Import", - "List", - "ListIssuers", - "ManageContacts", - "ManageIssuers", - "SetIssuers", - "Update", - "Purge", - ] - key_permissions = [ - "Create", - "Delete", - "Get", - "List", - "Purge", - "Recover", - "Update", - "GetRotationPolicy", - "SetRotationPolicy", - ] -} - -resource "azurerm_key_vault_certificate" "test_cert1" { - name = "acctestKVcert%[1]s-cert1" - key_vault_id = azurerm_key_vault.test.id - - certificate_policy { - issuer_parameters { - name = "Self" - } - key_properties { - exportable = true - key_size = 2048 - key_type = "RSA" - reuse_key = true - } - secret_properties { - content_type = "application/x-pkcs12" - } - x509_certificate_properties { - extended_key_usage = ["1.3.6.1.5.5.7.3.1"] - key_usage = [ - "cRLSign", - "dataEncipherment", - "digitalSignature", - "keyAgreement", - "keyCertSign", - "keyEncipherment", - ] - subject_alternative_names { - dns_names = ["api.pluginsdk.io"] - } - subject = "CN=api.pluginsdk.io" - validity_in_months = 1 - } - } - - depends_on = [azurerm_key_vault_access_policy.test] -} - -resource "azurerm_key_vault_certificate" "test_cert2" { - name = "acctestKVcert%[1]s-cert2" - key_vault_id = azurerm_key_vault.test.id - - certificate_policy { - issuer_parameters { - name = "Self" - } - key_properties { - exportable = true - key_size = 2048 - key_type = "RSA" - reuse_key = true - } - secret_properties { - content_type = "application/x-pkcs12" - } - x509_certificate_properties { - extended_key_usage = ["1.3.6.1.5.5.7.3.1"] - key_usage = [ - "cRLSign", - "dataEncipherment", - "digitalSignature", - "keyAgreement", - "keyCertSign", - "keyEncipherment", - ] - subject_alternative_names { - dns_names = ["api.pluginsdk.io"] - } - subject = "CN=api.pluginsdk.io" - validity_in_months = 1 - } - } - - depends_on = [azurerm_key_vault_access_policy.test] -} - -resource "azurerm_key_vault_certificate" "test_cert3" { - name = "acctestKVcert%[1]s-cert3" - key_vault_id = azurerm_key_vault.test.id - - certificate_policy { - issuer_parameters { - name = "Self" - } - key_properties { - exportable = true - key_size = 2048 - key_type = "RSA" - reuse_key = true - } - secret_properties { - content_type = "application/x-pkcs12" - } - x509_certificate_properties { - extended_key_usage = ["1.3.6.1.5.5.7.3.1"] - key_usage = [ - "cRLSign", - "dataEncipherment", - "digitalSignature", - "keyAgreement", - "keyCertSign", - "keyEncipherment", - ] - subject_alternative_names { - dns_names = ["api.pluginsdk.io"] - } - subject = "CN=api.pluginsdk.io" - validity_in_months = 1 - } - } - - depends_on = [azurerm_key_vault_access_policy.test] -} - -resource "azurerm_key_vault_key" "test" { - name = "testkeyvaultkey%[1]s" - key_vault_id = azurerm_key_vault.test.id - - key_type = "RSA" - key_size = 2048 - - key_opts = [ - "decrypt", - "encrypt", - "sign", - "unwrapKey", - "verify", - "wrapKey", - ] - - depends_on = [azurerm_key_vault_access_policy.test] -} - -resource "azurerm_user_assigned_identity" "test" { - name = "acctestUAI-%[1]s" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%[1]s" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%[1]s" - - linux_profile { - admin_username = "acctestuser%[1]s" - - ssh_key { - key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" - } - } - - default_node_pool { - name = "default" - node_count = 2 - vm_size = "Standard_DS2_v2" - vnet_subnet_id = azurerm_subnet.test.id - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "UserAssigned" - identity_ids = [ - azurerm_user_assigned_identity.test.id, - ] - } - - network_profile { - network_plugin = "kubenet" - dns_service_ip = "10.10.0.10" - service_cidr = "10.10.0.0/16" - } - - key_vault_secrets_provider { - secret_rotation_enabled = true - } - - service_mesh_profile { - mode = "Istio" - internal_ingress_gateway_enabled = true - external_ingress_gateway_enabled = true - certificate_authority { - key_vault_id = azurerm_key_vault.test.id - root_cert_object_name = azurerm_key_vault_certificate.test_cert1.name - cert_chain_object_name = azurerm_key_vault_certificate.test_cert2.name - cert_object_name = azurerm_key_vault_certificate.test_cert3.name - key_object_name = azurerm_key_vault_key.test.name - } - } - -} -`, data.RandomString, data.Locations.Primary) - } - return fmt.Sprintf(` provider "azurerm" { features {} diff --git a/internal/services/containers/kubernetes_cluster_network_resource_test.go b/internal/services/containers/kubernetes_cluster_network_resource_test.go index 2e6a735329cf..86b370449c28 100644 --- a/internal/services/containers/kubernetes_cluster_network_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_network_resource_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" ) func TestAccKubernetesCluster_advancedNetworkingKubenet(t *testing.T) { @@ -945,24 +944,6 @@ func TestAccKubernetesCluster_networkPluginModeUpdate(t *testing.T) { }) } -func TestAccKubernetesCluster_ebpfDataPlane(t *testing.T) { - if features.FourPointOhBeta() { - t.Skipf("Skipping since `ebpf_data_plane` has been removed in 4.0") - } - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") - r := KubernetesClusterResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.ebpfDataPlane(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - func TestAccKubernetesCluster_networkDataPlane(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{} @@ -978,42 +959,6 @@ func TestAccKubernetesCluster_networkDataPlane(t *testing.T) { }) } -func TestAccKubernetesCluster_apiServerInManagedSubnet(t *testing.T) { - if features.FourPointOhBeta() { - t.Skip("Skipping this test in 4.0 beta as it is not supported") - } - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") - r := KubernetesClusterResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.apiServerInManagedSubnet(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccKubernetesCluster_apiServerInBYOSubnet(t *testing.T) { - if features.FourPointOhBeta() { - t.Skip("Skipping this test in 4.0 beta as it is not supported") - } - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") - r := KubernetesClusterResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.apiServerInBYOSubnet(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - func TestAccKubernetesCluster_clusterPoolNodePublicIPTags(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{} @@ -1073,153 +1018,6 @@ func TestAccKubernetesCluster_clusterPoolNetworkProfileUpdate(t *testing.T) { }) } -func (KubernetesClusterResource) apiServerInBYOSubnet(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%d" - location = "%s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctestvirtnet%d" - address_space = ["10.0.0.0/8"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctestsubnet%d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.1.0.0/16"] - - delegation { - name = "aks-delegation" - - service_delegation { - actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"] - name = "Microsoft.ContainerService/managedClusters" - } - } -} - -resource "azurerm_subnet" "test1" { - name = "acctestsubnet1%d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.2.0.0/16"] -} - -resource "azurerm_user_assigned_identity" "test" { - name = "acctestRG-aks-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location -} - -resource "azurerm_role_assignment" "test" { - scope = azurerm_subnet.test.id - role_definition_name = "Network Contributor" - principal_id = azurerm_user_assigned_identity.test.principal_id -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%d" - - api_server_access_profile { - vnet_integration_enabled = true - subnet_id = azurerm_subnet.test.id - } - - linux_profile { - admin_username = "acctestuser%d" - - ssh_key { - key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" - } - } - - default_node_pool { - name = "default" - node_count = 2 - vm_size = "Standard_DS2_v2" - vnet_subnet_id = azurerm_subnet.test1.id - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "UserAssigned" - identity_ids = [azurerm_user_assigned_identity.test.id] - } - - network_profile { - network_plugin = "azure" - } - - depends_on = [ - azurerm_role_assignment.test, - ] -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) -} - -func (KubernetesClusterResource) apiServerInManagedSubnet(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%d" - location = "%s" -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%d" - - api_server_access_profile { - vnet_integration_enabled = true - } - - linux_profile { - admin_username = "acctestuser%d" - - ssh_key { - key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" - } - } - - default_node_pool { - name = "default" - node_count = 2 - vm_size = "Standard_DS2_v2" - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "SystemAssigned" - } - - network_profile { - network_plugin = "azure" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) -} - func (KubernetesClusterResource) advancedNetworkingConfig(data acceptance.TestData, networkPlugin string) string { return fmt.Sprintf(` provider "azurerm" { @@ -1281,75 +1079,6 @@ resource "azurerm_kubernetes_cluster" "test" { } func (KubernetesClusterResource) serviceMeshProfile(data acceptance.TestData, internalIngressEnabled bool, externalIngressEnabled bool) string { - if !features.FourPointOhBeta() { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%[1]d" - location = "%[2]s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctestvirtnet%[1]d" - address_space = ["10.1.0.0/16", "fd00:db8:deca::/48"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctestsubnet%[1]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.1.0.0/24", "fd00:db8:deca:deed::/64"] -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%[1]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%[1]d" - - linux_profile { - admin_username = "acctestuser%[1]d" - - ssh_key { - key_data = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" - } - } - - default_node_pool { - name = "default" - node_count = 2 - vm_size = "Standard_DS2_v2" - vnet_subnet_id = azurerm_subnet.test.id - upgrade_settings { - max_surge = "10%%" - } - } - - identity { - type = "SystemAssigned" - } - - network_profile { - network_plugin = "kubenet" - dns_service_ip = "10.10.0.10" - service_cidr = "10.10.0.0/16" - } - - service_mesh_profile { - mode = "Istio" - internal_ingress_gateway_enabled = %[3]t - external_ingress_gateway_enabled = %[4]t - } - -} -`, data.RandomInteger, data.Locations.Primary, internalIngressEnabled, externalIngressEnabled) - } - return fmt.Sprintf(` provider "azurerm" { features {} @@ -1412,7 +1141,7 @@ resource "azurerm_kubernetes_cluster" "test" { mode = "Istio" internal_ingress_gateway_enabled = %[3]t external_ingress_gateway_enabled = %[4]t - revisions = ["asm-1-20"] + revisions = ["asm-1-22"] } } @@ -3166,7 +2895,7 @@ provider "azurerm" { } resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%d" + name = "acctestRG-%d" location = "%s" } @@ -4156,60 +3885,6 @@ resource "azurerm_kubernetes_cluster" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, currentKubernetesVersion, data.RandomInteger) } -func (KubernetesClusterResource) ebpfDataPlane(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} -resource "azurerm_resource_group" "test" { - name = "acctestRG-aks-%[2]d" - location = "%[1]s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctestRG-vnet-%[2]d" - address_space = ["10.0.0.0/8"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctestRG-subnet-%[2]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.10.0.0/16"] - -} - -resource "azurerm_kubernetes_cluster" "test" { - name = "acctestaks%[2]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - dns_prefix = "acctestaks%[2]d" - default_node_pool { - name = "default" - node_count = 1 - vm_size = "Standard_DS2_v2" - vnet_subnet_id = azurerm_subnet.test.id - upgrade_settings { - max_surge = "10%%" - } - } - identity { - type = "SystemAssigned" - } - network_profile { - pod_cidr = "192.168.0.0/16" - network_plugin = "azure" - - network_data_plane = "cilium" - network_plugin_mode = "overlay" - } -} - `, data.Locations.Primary, data.RandomInteger) - -} - func (KubernetesClusterResource) networkDataPlane(data acceptance.TestData, networkDataPlane string) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go index 38cacc41258a..81445236ddf5 100644 --- a/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_node_pool_resource_test.go @@ -326,28 +326,6 @@ func TestAccKubernetesClusterNodePool_manualScaleUpdate(t *testing.T) { }) } -func TestAccKubernetesClusterNodePool_manualScaleVMSku(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_node_pool", "test") - r := KubernetesClusterNodePoolResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.manualScaleVMSkuConfig(data, "Standard_F2s_v2"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.manualScaleVMSkuConfig(data, "Standard_F4s_v2"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - func TestAccKubernetesClusterNodePool_modeSystem(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_node_pool", "test") r := KubernetesClusterNodePoolResource{} @@ -768,13 +746,6 @@ func TestAccKubernetesClusterNodePool_ultraSSD(t *testing.T) { r := KubernetesClusterNodePoolResource{} data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.ultraSSD(data, false), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), { Config: r.ultraSSD(data, true), Check: acceptance.ComposeTestCheckFunc( @@ -1728,23 +1699,6 @@ resource "azurerm_kubernetes_cluster_node_pool" "test" { `, r.templateConfig(data), numberOfAgents) } -func (r KubernetesClusterNodePoolResource) manualScaleVMSkuConfig(data acceptance.TestData, sku string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -%s - -resource "azurerm_kubernetes_cluster_node_pool" "test" { - name = "internal" - kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id - vm_size = "%s" - node_count = 1 -} -`, r.templateConfig(data), sku) -} - func (r KubernetesClusterNodePoolResource) modeSystemConfig(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/containers/kubernetes_cluster_other_resource_test.go b/internal/services/containers/kubernetes_cluster_other_resource_test.go index b17a285b69d8..86c612648b22 100644 --- a/internal/services/containers/kubernetes_cluster_other_resource_test.go +++ b/internal/services/containers/kubernetes_cluster_other_resource_test.go @@ -466,35 +466,6 @@ func TestAccKubernetesCluster_windowsProfileLicense(t *testing.T) { }) } -func TestAccKubernetesCluster_updateWindowsProfileLicense(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") - r := KubernetesClusterResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.windowsProfileConfig(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep("windows_profile.0.admin_password"), - { - Config: r.windowsProfileLicense(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep("windows_profile.0.admin_password"), - { - Config: r.windowsProfileConfig(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep("windows_profile.0.admin_password"), - }) -} - func TestAccKubernetesCluster_diskEncryption(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster", "test") r := KubernetesClusterResource{}