@@ -29,11 +29,17 @@ import (
29
29
)
30
30
31
31
const (
32
- clusterVersionUpgradeInitial = "1.27"
33
- clusterVersionUpgradeUpdated = "1.28"
32
+ clusterVersion130 = "1.30"
33
+ clusterVersion131 = "1.31"
34
+ clusterVersion132 = "1.32"
34
35
35
- clusterVersionUpgradeForceInitial = "1.30"
36
- clusterVersionUpgradeForceUpdated = "1.31"
36
+ clusterDefaultVersion = clusterVersion132
37
+
38
+ clusterVersionUpgradeInitial = clusterVersion130
39
+ clusterVersionUpgradeUpdated = clusterVersion131
40
+
41
+ clusterVersionUpgradeForceInitial = clusterVersion130
42
+ clusterVersionUpgradeForceUpdated = clusterVersion131
37
43
)
38
44
39
45
func TestAccEKSCluster_basic (t * testing.T ) {
@@ -275,13 +281,13 @@ func TestAccEKSCluster_BootstrapSelfManagedAddons_migrate(t *testing.T) {
275
281
ExternalProviders : map [string ]resource.ExternalProvider {
276
282
"aws" : {
277
283
Source : "hashicorp/aws" ,
278
- VersionConstraint : "5.56.1 " ,
284
+ VersionConstraint : "6.9.0 " ,
279
285
},
280
286
},
281
287
Config : testAccClusterConfig_basic (rName ),
282
288
Check : resource .ComposeAggregateTestCheckFunc (
283
289
testAccCheckClusterExists (ctx , resourceName , & cluster1 ),
284
- resource .TestCheckNoResourceAttr (resourceName , "bootstrap_self_managed_addons" ),
290
+ resource .TestCheckResourceAttr (resourceName , "bootstrap_self_managed_addons" , acctest . CtTrue ),
285
291
),
286
292
},
287
293
{
@@ -1362,11 +1368,11 @@ func TestAccEKSCluster_upgradePolicy(t *testing.T) {
1362
1368
CheckDestroy : testAccCheckClusterDestroy (ctx ),
1363
1369
Steps : []resource.TestStep {
1364
1370
{
1365
- Config : testAccClusterConfig_upgradePolicy (rName , "STANDARD " ),
1371
+ Config : testAccClusterConfig_upgradePolicy (rName , "EXTENDED " ),
1366
1372
Check : resource .ComposeAggregateTestCheckFunc (
1367
1373
testAccCheckClusterExists (ctx , resourceName , & cluster ),
1368
1374
resource .TestCheckResourceAttr (resourceName , "upgrade_policy.#" , "1" ),
1369
- resource .TestCheckResourceAttr (resourceName , "upgrade_policy.0.support_type" , "STANDARD " ),
1375
+ resource .TestCheckResourceAttr (resourceName , "upgrade_policy.0.support_type" , "EXTENDED " ),
1370
1376
),
1371
1377
},
1372
1378
{
@@ -1376,11 +1382,11 @@ func TestAccEKSCluster_upgradePolicy(t *testing.T) {
1376
1382
ImportStateVerifyIgnore : []string {"bootstrap_self_managed_addons" },
1377
1383
},
1378
1384
{
1379
- Config : testAccClusterConfig_upgradePolicy (rName , "EXTENDED " ),
1385
+ Config : testAccClusterConfig_upgradePolicy (rName , "STANDARD " ),
1380
1386
Check : resource .ComposeAggregateTestCheckFunc (
1381
1387
testAccCheckClusterExists (ctx , resourceName , & cluster ),
1382
1388
resource .TestCheckResourceAttr (resourceName , "upgrade_policy.#" , "1" ),
1383
- resource .TestCheckResourceAttr (resourceName , "upgrade_policy.0.support_type" , "EXTENDED " ),
1389
+ resource .TestCheckResourceAttr (resourceName , "upgrade_policy.0.support_type" , "STANDARD " ),
1384
1390
),
1385
1391
},
1386
1392
{
@@ -1558,6 +1564,10 @@ func testAccClusterConfig_base(rName string) string {
1558
1564
return acctest .ConfigCompose (acctest .ConfigAvailableAZsNoOptIn (), fmt .Sprintf (`
1559
1565
data "aws_partition" "current" {}
1560
1566
1567
+ data "aws_service_principal" "eks" {
1568
+ service_name = "eks"
1569
+ }
1570
+
1561
1571
resource "aws_iam_role" "cluster" {
1562
1572
name = %[1]q
1563
1573
@@ -1568,7 +1578,7 @@ resource "aws_iam_role" "cluster" {
1568
1578
{
1569
1579
"Effect": "Allow",
1570
1580
"Principal": {
1571
- "Service": "eks. ${data.aws_partition.current.dns_suffix }"
1581
+ "Service": "${data.aws_service_principal.eks.name }"
1572
1582
},
1573
1583
"Action": "sts:AssumeRole"
1574
1584
}
@@ -1666,6 +1676,10 @@ func testAccClusterConfig_computeConfigBase(rName string) string {
1666
1676
return acctest .ConfigCompose (acctest .ConfigAvailableAZsNoOptIn (), fmt .Sprintf (`
1667
1677
data "aws_partition" "current" {}
1668
1678
1679
+ data "aws_service_principal" "eks" {
1680
+ service_name = "eks"
1681
+ }
1682
+
1669
1683
resource "aws_iam_role" "cluster" {
1670
1684
name = %[1]q
1671
1685
@@ -1676,7 +1690,7 @@ resource "aws_iam_role" "cluster" {
1676
1690
{
1677
1691
"Effect": "Allow",
1678
1692
"Principal": {
1679
- "Service": "eks. ${data.aws_partition.current.dns_suffix }"
1693
+ "Service": "${data.aws_service_principal.eks.name }"
1680
1694
},
1681
1695
"Action": [
1682
1696
"sts:AssumeRole",
@@ -1713,6 +1727,10 @@ resource "aws_iam_role_policy_attachment" "cluster_AmazonEKSNetworkingPolicy" {
1713
1727
role = aws_iam_role.cluster.name
1714
1728
}
1715
1729
1730
+ data "aws_service_principal" "ec2" {
1731
+ service_name = "ec2"
1732
+ }
1733
+
1716
1734
resource "aws_iam_role" "node" {
1717
1735
name = "%[1]s-node"
1718
1736
@@ -1723,7 +1741,7 @@ resource "aws_iam_role" "node" {
1723
1741
{
1724
1742
"Effect": "Allow",
1725
1743
"Principal": {
1726
- "Service": "ec2. ${data.aws_partition.current.dns_suffix }"
1744
+ "Service": "${data.aws_service_principal.ec2.name }"
1727
1745
},
1728
1746
"Action": ["sts:AssumeRole"]
1729
1747
}
@@ -1752,7 +1770,7 @@ resource "aws_iam_role" "node2" {
1752
1770
{
1753
1771
"Effect": "Allow",
1754
1772
"Principal": {
1755
- "Service": "ec2. ${data.aws_partition.current.dns_suffix }"
1773
+ "Service": "${data.aws_service_principal.ec2.name }"
1756
1774
},
1757
1775
"Action": ["sts:AssumeRole"]
1758
1776
}
0 commit comments