Skip to content

Commit 6649522

Browse files
committed
chore: Add test to show new test case fails when setting auto mode to
disabled Error: updating EKS Cluster (tf-acc-test-4542960997365135908) compute config: operation error EKS: UpdateClusterConfig, https response error StatusCode: 400, RequestID: 96e8e0d8-e66e-4bc0-a20b-aca0b88079e5, InvalidRequestException: No changes needed for EKS Auto Mode configuration provided Signed-off-by: Bryant Biggs <[email protected]>
1 parent d96fc93 commit 6649522

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

internal/service/eks/cluster_test.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func TestAccEKSCluster_ComputeConfig_OnCreate(t *testing.T) {
380380

381381
func TestAccEKSCluster_ComputeConfig_OnUpdate(t *testing.T) {
382382
ctx := acctest.Context(t)
383-
var cluster1, cluster2 types.Cluster
383+
var cluster1, cluster2, cluster3 types.Cluster
384384
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
385385
resourceName := "aws_eks_cluster.test"
386386

@@ -411,11 +411,32 @@ func TestAccEKSCluster_ComputeConfig_OnUpdate(t *testing.T) {
411411
ImportStateVerifyIgnore: []string{"bootstrap_self_managed_addons"},
412412
},
413413
{
414-
Config: testAccClusterConfig_computeConfig(rName, true, "aws_iam_role.node.arn"),
414+
Config: testAccClusterConfig_computeConfig_nodePoolsSetup(rName, false),
415415
Check: resource.ComposeAggregateTestCheckFunc(
416416
testAccCheckClusterExists(ctx, resourceName, &cluster2),
417417
testAccCheckClusterNotRecreated(&cluster1, &cluster2),
418418
resource.TestCheckResourceAttr(resourceName, "compute_config.#", "1"),
419+
resource.TestCheckResourceAttr(resourceName, "compute_config.0.enabled", acctest.CtFalse),
420+
resource.TestCheckResourceAttr(resourceName, "kubernetes_network_config.#", "1"),
421+
resource.TestCheckResourceAttr(resourceName, "kubernetes_network_config.0.elastic_load_balancing.#", "1"),
422+
resource.TestCheckResourceAttr(resourceName, "kubernetes_network_config.0.elastic_load_balancing.0.enabled", acctest.CtFalse),
423+
resource.TestCheckResourceAttr(resourceName, "storage_config.#", "1"),
424+
resource.TestCheckResourceAttr(resourceName, "storage_config.0.block_storage.#", "1"),
425+
resource.TestCheckResourceAttr(resourceName, "storage_config.0.block_storage.0.enabled", acctest.CtFalse),
426+
),
427+
},
428+
{
429+
ResourceName: resourceName,
430+
ImportState: true,
431+
ImportStateVerify: true,
432+
ImportStateVerifyIgnore: []string{"bootstrap_self_managed_addons"},
433+
},
434+
{
435+
Config: testAccClusterConfig_computeConfig(rName, true, "aws_iam_role.node.arn"),
436+
Check: resource.ComposeAggregateTestCheckFunc(
437+
testAccCheckClusterExists(ctx, resourceName, &cluster3),
438+
testAccCheckClusterNotRecreated(&cluster2, &cluster3),
439+
resource.TestCheckResourceAttr(resourceName, "compute_config.#", "1"),
419440
resource.TestCheckResourceAttr(resourceName, "compute_config.0.enabled", acctest.CtTrue),
420441
resource.TestCheckResourceAttr(resourceName, "compute_config.0.node_pools.#", "1"),
421442
resource.TestCheckResourceAttr(resourceName, "compute_config.0.node_pools.0", "general-purpose"),

0 commit comments

Comments
 (0)