From 31453172c41ce1b7d6260360ba8e77ee135508c1 Mon Sep 17 00:00:00 2001 From: hjoshi123 Date: Thu, 26 Dec 2024 00:51:22 -0700 Subject: [PATCH 1/9] feat: added node_repair_config to aws_eks_node_group --- internal/service/eks/node_group.go | 60 ++++++++++++++++++++++++- internal/service/eks/node_group_test.go | 51 +++++++++++++++++++++ tools/tfsdk2fw/go.mod | 26 +++++------ tools/tfsdk2fw/go.sum | 13 ++++++ 4 files changed, 136 insertions(+), 14 deletions(-) diff --git a/internal/service/eks/node_group.go b/internal/service/eks/node_group.go index acf4093b7cc..fe7e3af4d8b 100644 --- a/internal/service/eks/node_group.go +++ b/internal/service/eks/node_group.go @@ -146,6 +146,21 @@ func resourceNodeGroup() *schema.Resource { ConflictsWith: []string{"node_group_name"}, ValidateFunc: validation.StringLenBetween(0, 63-id.UniqueIDSuffixLength), }, + "node_repair_config": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + }, + }, + }, "node_role_arn": { Type: schema.TypeString, Required: true, @@ -341,6 +356,10 @@ func resourceNodeGroupCreate(ctx context.Context, d *schema.ResourceData, meta i input.LaunchTemplate = expandLaunchTemplateSpecification(v) } + if v, ok := d.GetOk("node_repair_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + input.NodeRepairConfig = expandNodegroupRepairConfig(v.([]interface{})[0].(map[string]interface{})) + } + if v, ok := d.GetOk("release_version"); ok { input.ReleaseVersion = aws.String(v.(string)) } @@ -414,6 +433,11 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta int } d.Set("node_group_name", nodeGroup.NodegroupName) d.Set("node_group_name_prefix", create.NamePrefixFromName(aws.ToString(nodeGroup.NodegroupName))) + if nodeGroup.NodeRepairConfig != nil { + if err := d.Set("node_repair_config", flattenNodeGroupRepairConfig(nodeGroup.NodeRepairConfig)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting node_repair_config: %s", err) + } + } d.Set("node_role_arn", nodeGroup.NodeRole) d.Set("release_version", nodeGroup.ReleaseVersion) if err := d.Set("remote_access", flattenRemoteAccessConfig(nodeGroup.RemoteAccess)); err != nil { @@ -508,7 +532,7 @@ func resourceNodeGroupUpdate(ctx context.Context, d *schema.ResourceData, meta i } } - if d.HasChanges("labels", "scaling_config", "taint", "update_config") { + if d.HasChanges("labels", "scaling_config", "taint", "update_config", "node_repair_config") { oldLabelsRaw, newLabelsRaw := d.GetChange("labels") oldTaintsRaw, newTaintsRaw := d.GetChange("taint") @@ -520,6 +544,12 @@ func resourceNodeGroupUpdate(ctx context.Context, d *schema.ResourceData, meta i Taints: expandUpdateTaintsPayload(oldTaintsRaw.(*schema.Set).List(), newTaintsRaw.(*schema.Set).List()), } + if d.HasChange("node_repair_config") { + if v, ok := d.GetOk("node_repair_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + input.NodeRepairConfig = expandNodegroupRepairConfig(v.([]interface{})[0].(map[string]interface{})) + } + } + if d.HasChange("scaling_config") { if v, ok := d.GetOk("scaling_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { input.ScalingConfig = expandNodegroupScalingConfig(v.([]interface{})[0].(map[string]interface{})) @@ -915,6 +945,20 @@ func expandNodegroupUpdateConfig(tfMap map[string]interface{}) *types.NodegroupU return apiObject } +func expandNodegroupRepairConfig(tfMap map[string]interface{}) *types.NodeRepairConfig { + if tfMap == nil { + return nil + } + + apiObject := &types.NodeRepairConfig{} + + if v, ok := tfMap["enabled"].(bool); ok { + apiObject.Enabled = aws.Bool(v) + } + + return apiObject +} + func expandUpdateLabelsPayload(ctx context.Context, oldLabelsMap, newLabelsMap interface{}) *types.UpdateLabelsPayload { // EKS Labels operate similarly to keyvaluetags oldLabels := tftags.New(ctx, oldLabelsMap) @@ -1015,6 +1059,20 @@ func flattenNodeGroupScalingConfig(apiObject *types.NodegroupScalingConfig) map[ return tfMap } +func flattenNodeGroupRepairConfig(apiObject *types.NodeRepairConfig) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := make(map[string]interface{}) + + if v := apiObject.Enabled; v != nil { + tfMap["enabled"] = aws.ToBool(v) + } + + return tfMap +} + func flattenNodeGroupUpdateConfig(apiObject *types.NodegroupUpdateConfig) map[string]interface{} { if apiObject == nil { return nil diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index cda03d5e304..1c4634dab4c 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -513,6 +513,30 @@ func TestAccEKSNodeGroup_LaunchTemplate_version(t *testing.T) { }) } +func TestAccEKSNodeGroup_RepairConfig(t *testing.T) { + ctx := acctest.Context(t) + var nodeGroup1 types.Nodegroup + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EKSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckNodeGroupDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccNodeGroupConfig_repairConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "node_repair_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "node_repair_config.0.enabled", acctest.CtTrue), + ), + }, + }, + }) +} + func TestAccEKSNodeGroup_releaseVersion(t *testing.T) { ctx := acctest.Context(t) var nodeGroup1, nodeGroup2 types.Nodegroup @@ -2044,6 +2068,33 @@ resource "aws_eks_node_group" "test" { `, rName, taintKey1, taintValue1, taintEffect1, taintKey2, taintValue2, taintEffect2)) } +func testAccNodeGroupConfig_repairConfig(rName string) string { + return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 3 + min_size = 1 + } + + node_repair_config = { + enabled = true + } + + depends_on = [ + aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy, + aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy, + aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly, + ] +} +`, rName)) +} + func testAccNodeGroupConfig_update1(rName string) string { return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { diff --git a/tools/tfsdk2fw/go.mod b/tools/tfsdk2fw/go.mod index 9d8b34c9258..00e263eb695 100644 --- a/tools/tfsdk2fw/go.mod +++ b/tools/tfsdk2fw/go.mod @@ -57,7 +57,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/batch v1.49.1 // indirect github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2 // indirect - github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1 // indirect + github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.0 // indirect github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1 // indirect github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.2 // indirect github.com/aws/aws-sdk-go-v2/service/chime v1.34.8 // indirect @@ -67,7 +67,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloud9 v1.28.9 // indirect github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.23.3 // indirect github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.1 // indirect github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8 // indirect github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.28.1 // indirect github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.26.7 // indirect @@ -86,15 +86,15 @@ require ( github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.29.8 // indirect github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.26.8 // indirect github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9 // indirect - github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2 // indirect + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.3 // indirect github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8 // indirect github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.40.2 // indirect github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2 // indirect - github.com/aws/aws-sdk-go-v2/service/connect v1.122.1 // indirect + github.com/aws/aws-sdk-go-v2/service/connect v1.123.0 // indirect github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8 // indirect github.com/aws/aws-sdk-go-v2/service/controltower v1.20.2 // indirect github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8 // indirect - github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2 // indirect + github.com/aws/aws-sdk-go-v2/service/costexplorer v1.46.0 // indirect github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.44.1 // indirect github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.45.1 // indirect @@ -110,7 +110,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/directconnect v1.30.2 // indirect github.com/aws/aws-sdk-go-v2/service/directoryservice v1.30.9 // indirect github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7 // indirect + github.com/aws/aws-sdk-go-v2/service/docdb v1.40.0 // indirect github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5 // indirect github.com/aws/aws-sdk-go-v2/service/drs v1.30.8 // indirect github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.1 // indirect @@ -119,7 +119,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.8 // indirect github.com/aws/aws-sdk-go-v2/service/ecs v1.53.1 // indirect github.com/aws/aws-sdk-go-v2/service/efs v1.34.2 // indirect - github.com/aws/aws-sdk-go-v2/service/eks v1.54.1 // indirect + github.com/aws/aws-sdk-go-v2/service/eks v1.55.0 // indirect github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2 // indirect github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.7 // indirect @@ -171,7 +171,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.27.8 // indirect github.com/aws/aws-sdk-go-v2/service/kms v1.37.8 // indirect github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2 // indirect - github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1 // indirect + github.com/aws/aws-sdk-go-v2/service/lambda v1.69.2 // indirect github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8 // indirect github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.49.8 // indirect @@ -180,7 +180,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/location v1.42.8 // indirect github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.31.8 // indirect github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1 // indirect - github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8 // indirect + github.com/aws/aws-sdk-go-v2/service/macie2 v1.44.0 // indirect github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1 // indirect github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.64.0 // indirect github.com/aws/aws-sdk-go-v2/service/medialive v1.65.0 // indirect @@ -202,7 +202,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/opsworks v1.26.8 // indirect github.com/aws/aws-sdk-go-v2/service/organizations v1.36.2 // indirect github.com/aws/aws-sdk-go-v2/service/osis v1.14.8 // indirect - github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/service/outposts v1.48.0 // indirect github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3 // indirect github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.9.8 // indirect github.com/aws/aws-sdk-go-v2/service/pcs v1.2.9 // indirect @@ -215,7 +215,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/qldb v1.25.8 // indirect github.com/aws/aws-sdk-go-v2/service/quicksight v1.82.1 // indirect github.com/aws/aws-sdk-go-v2/service/ram v1.29.8 // indirect - github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2 // indirect + github.com/aws/aws-sdk-go-v2/service/rbin v1.21.3 // indirect github.com/aws/aws-sdk-go-v2/service/rds v1.93.1 // indirect github.com/aws/aws-sdk-go-v2/service/redshift v1.53.1 // indirect github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.31.5 // indirect @@ -237,7 +237,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3control v1.52.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3outposts v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sagemaker v1.170.0 // indirect github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9 // indirect github.com/aws/aws-sdk-go-v2/service/schemas v1.28.9 // indirect github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.8 // indirect @@ -246,7 +246,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.24.8 // indirect github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.32.8 // indirect github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8 // indirect - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0 // indirect + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.1 // indirect github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8 // indirect github.com/aws/aws-sdk-go-v2/service/ses v1.29.2 // indirect github.com/aws/aws-sdk-go-v2/service/sesv2 v1.40.1 // indirect diff --git a/tools/tfsdk2fw/go.sum b/tools/tfsdk2fw/go.sum index 4b5e2f9d5f0..5b82ec1e040 100644 --- a/tools/tfsdk2fw/go.sum +++ b/tools/tfsdk2fw/go.sum @@ -99,6 +99,7 @@ github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2 h1:j68iNEyVNTTg8NSAr0KJF66/ github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2/go.mod h1:EyyHjPLtcZUu2eg+aB7K9xs4AKskGN1T755632T/Df8= github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1 h1:h/oJnoWSxz56jAuLTIc60LQLI+NITvx4eT3YIFYrbRs= github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1/go.mod h1:DsVlL/WBmekQaLyt+puVryiwgPRVmdG4iYtXFKk1D0o= +github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.0/go.mod h1:DsVlL/WBmekQaLyt+puVryiwgPRVmdG4iYtXFKk1D0o= github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1 h1:tVNnwsNTeo+Etw9gr1sWV+Kj3ZoMJc43iZpVU4R8eeg= github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1/go.mod h1:JY7T8MaH4rW9YFQEWexD4WKErgSgSqozoV3sKghAhNI= github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.2 h1:Pk375myUxoD39hTn0b/+7nYIlG3SP7f4aOsoH3NVk70= @@ -119,6 +120,7 @@ github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2 h1:6USen+lDo8xYQutfn github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2/go.mod h1:10A7sHyxlTZSB7419K2wq/1tn0x/K9/drbD2j8VRZVc= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0 h1:zYk75ljFsvA6PgmbkMVy5b3M/arUF7EY3kHJz7LDaDk= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0/go.mod h1:fXHLupAMPNGhRAW7e2kS0aoDY/KsQ9GHu80GSK70cRs= +github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.1/go.mod h1:m70SuBWmdnAnd6e3Z2PxtLL8PfgzFXx4hcGlySK/yik= github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8 h1:9st+40hamlQ/98Q7ppwFJQMoWa0HbnmVX7+JlWNVQeU= github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8/go.mod h1:qb90fXDbbwuDneZ1VlhEXRFULd7+pkwoqzqzJ/ygm34= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.28.1 h1:4ESEUP6oHjykdCx1ab21nKpYQlkadizCqZ3OD/9SU/4= @@ -157,6 +159,7 @@ github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9 h1:45fUrgNmm/p7K3jZ github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9/go.mod h1:YKkFAyQpB2INvqQCRqund14d8HOwz3r8lA+9ZwzoPWs= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2 h1:qdBokbj4eZVXEy0VUrygCeko152JHlqwlYEIJMOcV9c= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2/go.mod h1:Rb0ZVYhF0yOeUKciNUNOsUwMwnlZCod7zyiF2+C7qVQ= +github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.3/go.mod h1:Rb0ZVYhF0yOeUKciNUNOsUwMwnlZCod7zyiF2+C7qVQ= github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8 h1:DVmvbYjA+ZwyzDiPyexJp5TS2d0A0lJXQwII5XXOifc= github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8/go.mod h1:B54u0dzMmGt47kJ98a/lFwByBscvrIWT2HX1p/szNWc= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.40.2 h1:DxMFMEcH8cXMB2KSfDSY/QWQ3LQMBbCRVS9OxB+D3s0= @@ -165,6 +168,7 @@ github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2 h1:DbzEBJvSIuk5yPyzD9 github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2/go.mod h1:nm1OoNlPmGfPdBvK/xqNvh3aqnsCXu8N3cyLk28kRfc= github.com/aws/aws-sdk-go-v2/service/connect v1.122.1 h1:vu+ORfPdLzi5JYX2xOKaBMBlmLtOvzo/Zk6u6Y0nEq4= github.com/aws/aws-sdk-go-v2/service/connect v1.122.1/go.mod h1:nZpWdBCj5AvfqaUYTZiP8RrF0M7og3aIVhf9KoQFqNg= +github.com/aws/aws-sdk-go-v2/service/connect v1.123.0/go.mod h1:nZpWdBCj5AvfqaUYTZiP8RrF0M7og3aIVhf9KoQFqNg= github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8 h1:hj206zH/z7il1iX09N8S46Qzs8k6v6sacJrIp1Jcpj0= github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8/go.mod h1:MS/Qch0cTw1+b2VeFNt71D8krYxjuYlmWvnYV8Nof5k= github.com/aws/aws-sdk-go-v2/service/controltower v1.20.2 h1:cVkS7f2tetfZz55XO64+GlDecSJslcxVrwJ8nZVwcpc= @@ -173,6 +177,7 @@ github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8 h1:tNRHv8 github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8/go.mod h1:mj6abMUDCI9R5smS3ZLCprpxBvjV8ljxROlA0VcEXpQ= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2 h1:q9j9CnWD6UAtx4TwIEt6sFphNQbj7ZNw7pg7UrC4PqQ= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2/go.mod h1:5WHHpqKGSnRAIbRHXrslVwNyIx/oGCPCz7swI7Iotbg= +github.com/aws/aws-sdk-go-v2/service/costexplorer v1.46.0/go.mod h1:5WHHpqKGSnRAIbRHXrslVwNyIx/oGCPCz7swI7Iotbg= github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2 h1:Ek+aYopz3wADJJft8YOHZYVZiMPK66laU/rKvl8pVTA= github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2/go.mod h1:yvizjKqbFymZRI19hE6XLehO5hULzK66hthy/5kOvG8= github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.44.1 h1:a+ECmdBt81/vUkUDBKI3xz1tz2rVRegE0TxgNYbIaho= @@ -205,6 +210,7 @@ github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1 h1:X0DKU9+oDntUnhgJLsh2zxSr5HVx github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1/go.mod h1:U/tY2rV+/oZ2YsUUe49PMoz9XKbN0+CQHzT5JhbXyBc= github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7 h1:oCYSt6G9i8wv6Gj8Svy7fnYDbb9knLTT71OVTYrUXGk= github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7/go.mod h1:MQ9uU7FnemGLCkLCfl4ikGvq7UVduD169Kxft07J4kw= +github.com/aws/aws-sdk-go-v2/service/docdb v1.40.0/go.mod h1:MQ9uU7FnemGLCkLCfl4ikGvq7UVduD169Kxft07J4kw= github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5 h1:JEGaqPMALXNvkwMAQFaWHFmsJeEQxokYxklxnYOo66o= github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5/go.mod h1:USqXLryQqswYCghqSEITP/qIKwMGaFiMt7CohdHwVIc= github.com/aws/aws-sdk-go-v2/service/drs v1.30.8 h1:lTmz5+1IUklrXFIay3glpkS4UG8BuojaqsR+zfE65Mo= @@ -223,6 +229,7 @@ github.com/aws/aws-sdk-go-v2/service/efs v1.34.2 h1:gV7yKX8euN6W9vXiPutShochfx5r github.com/aws/aws-sdk-go-v2/service/efs v1.34.2/go.mod h1:SB5IpCGoPDDTpf7wMLVtq5MRsad+vqIMONmJf/l4nqY= github.com/aws/aws-sdk-go-v2/service/eks v1.54.1 h1:3sdH9XCjhoB7mpTGveksfT35NLbTahjTf7Sf4rPcqZk= github.com/aws/aws-sdk-go-v2/service/eks v1.54.1/go.mod h1:kNUWaiotRWCnfQlprrxSMg8ALqbZyA9xLCwKXuLumSk= +github.com/aws/aws-sdk-go-v2/service/eks v1.55.0/go.mod h1:kNUWaiotRWCnfQlprrxSMg8ALqbZyA9xLCwKXuLumSk= github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2 h1:+dzQKj9hOytVJOQjRxBI1nWyfoyB4gPh91vUTnPPOTk= github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2/go.mod h1:XIxNB7tOhWeEBxjR73NTGrQ6tTHM2YBCKS/5CL2YKqE= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.28.8 h1:A6w8FeT/ZD67gHTlJLdemN3eZbvcVXOcmeHvTLbkeCY= @@ -327,6 +334,7 @@ github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2 h1:IUlID9r2gZKHN+oxQ7 github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2/go.mod h1:/8URO3jdXHx2trFkw8886/BvIymTacL7D8ycHuYly6M= github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1 h1:q1NrvoJiz0rm9ayKOJ9wsMGmStK6rZSY36BDICMrcuY= github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1/go.mod h1:hDj7He9kbR9T5zugnS+T21l4z6do4SEGuno/BpJLpA0= +github.com/aws/aws-sdk-go-v2/service/lambda v1.69.2/go.mod h1:jWFEZMgQ48dPvuAWy2zcRIq8Mx/L0eO0iR1xkGR4Ov8= github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8 h1:Kxrp+zOb2WYS4BDRS7osCBOPIK1T7OedcOytIe2I8CY= github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8/go.mod h1:f+ruiwPQPaXW7OnTCUn5ttZm21UvB3WKMd7PxFxaSaM= github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.28.8 h1:wlqWZFl1a5658FCynvBGxlZVRzwgltRkAbggFSc48Jc= @@ -345,6 +353,7 @@ github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1 h1:01gzWPcmywLIDTNsuMTMkwDd56DOp github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1/go.mod h1:QmxK4noc4FpL88R5hgX00wMhJeaqwxGcXC3SxoIXoQc= github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8 h1:usVxo62y3iObzvgXR6+Vx7F6GSEM9sa6vcCxPcOdgpI= github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8/go.mod h1:+55oP7voi8jWtWudP3C6df7b4+XEQ50rOs2/Y2P136A= +github.com/aws/aws-sdk-go-v2/service/macie2 v1.44.0/go.mod h1:+55oP7voi8jWtWudP3C6df7b4+XEQ50rOs2/Y2P136A= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1 h1:3/O+TzUvCfOeb8RZCyRlrRkBYdgBWiIt8SFuPcTR6IU= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1/go.mod h1:nQRm3vFS++fo+i1pixS31pDKDaWSMBjyVCOSL4po3ps= github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.64.0 h1:/MobMJ7VPnNxykUTUDkaloZBEKMl/t08QBBQlU2SdbU= @@ -389,6 +398,7 @@ github.com/aws/aws-sdk-go-v2/service/osis v1.14.8 h1:C5t9VoY0Rgec9zAdzXlvXXkhj+z github.com/aws/aws-sdk-go-v2/service/osis v1.14.8/go.mod h1:eyPTDZRCYMT/LOsDMiMgB4uzGcBWX3o2DpVyvrBsCOs= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3 h1:YE0eVKRQuBEyDp5N7MLus5kxU58+QUHv6JBQXi6/tzg= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3/go.mod h1:W4/z6UyMkYcZ9wXH+K9NuAgORXhSSOeSf9Jy/tcnoGM= +github.com/aws/aws-sdk-go-v2/service/outposts v1.48.0/go.mod h1:W4/z6UyMkYcZ9wXH+K9NuAgORXhSSOeSf9Jy/tcnoGM= github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3 h1:ktY4tL7IGLYYjx9PIqH+dM8gneIsFJ++Nu6n1MHu6MQ= github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3/go.mod h1:jnbiXijUeMw/egLenN/Q2YHVo3zw3k53wtHpAOh6F6Q= github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.9.8 h1:XG8VNHO0HovBRoumSh6aa4lE2zvcWwYGn6liEDedeXw= @@ -415,6 +425,7 @@ github.com/aws/aws-sdk-go-v2/service/ram v1.29.8 h1:pKGf+FzvKag4RMGY5SYw/RDPyzPv github.com/aws/aws-sdk-go-v2/service/ram v1.29.8/go.mod h1:AfzjV8GA6ZIolmqP4UrZX9OXKJeCH8xQKwI12T+HbCU= github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2 h1:usYDBaq4/OMKdInWQ957wa503N26Wj/cDLkUX6VhhNA= github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2/go.mod h1:bDv9F4WCfs6gGlvVCNAWgrIN4vuRdmfNafdvLjnI/Vc= +github.com/aws/aws-sdk-go-v2/service/rbin v1.21.3/go.mod h1:bDv9F4WCfs6gGlvVCNAWgrIN4vuRdmfNafdvLjnI/Vc= github.com/aws/aws-sdk-go-v2/service/rds v1.93.1 h1:v5ip0TLUaZqECeHBeBsCR3sTroCUFM1gcUY6vfqyHYM= github.com/aws/aws-sdk-go-v2/service/rds v1.93.1/go.mod h1:QEpwiX4BS6nos2d/ele6gRGalNW0Hzc1TZMmhkywQb0= github.com/aws/aws-sdk-go-v2/service/redshift v1.53.1 h1:fpuhuF5DuY26w61bBq8YrMYecLVs6eiQK7JbD9womPI= @@ -459,6 +470,7 @@ github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1 h1:lYUf+JdG7N/AulNkJMBltvXf github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1/go.mod h1:LfkUcn8gnPNKpiN+A+b3zD6Gtw7Vu1LNlnBZAOd4N9E= github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1 h1:D/vrtWIZiWdTS7RuMe0mYflx+p0QBiuIdxefh8OuoIk= github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1/go.mod h1:hzu5ncs1K7l08GCup8WRVxw/uqgw1BQLDyfVomRM3sY= +github.com/aws/aws-sdk-go-v2/service/sagemaker v1.170.0/go.mod h1:hzu5ncs1K7l08GCup8WRVxw/uqgw1BQLDyfVomRM3sY= github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9 h1:isM0cEE6tsKx0nN8PN6mD5KE875ZoXpBOyuhVg9eizw= github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9/go.mod h1:GjSCVTlF0mOfHmQCl1MKcQIwmMOX4HYkKO3twXbm8+k= github.com/aws/aws-sdk-go-v2/service/schemas v1.28.9 h1:/GpTD05rBAVsnlnK+8uTTystVVb/tcCumvdvUhgwDAo= @@ -477,6 +489,7 @@ github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8 h1:G9LHlc github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8/go.mod h1:PqH0Z4nbCtd1+zDrMTxLK+v4JaYdHSDzZb+FurGamcs= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0 h1:e1QcVk0DcUPLPUjnBC3A+Z5kvDc0Sqp3jWQvhjGEwSE= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0/go.mod h1:YMM+e0OfZQVBpTJs+WNZWP/hdodeWnepXgancR5NFFw= +github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.1/go.mod h1:KmNFSoNNh6qNFUCfNAVf3yW+gZXgEPc//PGttodQ1KU= github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8 h1:05g+xF2b6eqAwCeHpl8v6nRY0+u8CpgIOd+vwtnyB10= github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8/go.mod h1:l6nMNVvoAEbRczyvXiYGChtzbm3UuZdrbMW7/FWelI0= github.com/aws/aws-sdk-go-v2/service/ses v1.29.2 h1:ezumdYONyhe5B4OvSZxQfqfSyKW9kjekr56u1UjQmys= From 0229adf44cc8c992958a3c94e8356fdadce1dcd6 Mon Sep 17 00:00:00 2001 From: hjoshi123 Date: Thu, 26 Dec 2024 00:57:12 -0700 Subject: [PATCH 2/9] reverting go.mod changes --- tools/tfsdk2fw/go.mod | 26 +++++++++++++------------- tools/tfsdk2fw/go.sum | 13 ------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/tools/tfsdk2fw/go.mod b/tools/tfsdk2fw/go.mod index 00e263eb695..9d8b34c9258 100644 --- a/tools/tfsdk2fw/go.mod +++ b/tools/tfsdk2fw/go.mod @@ -57,7 +57,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/batch v1.49.1 // indirect github.com/aws/aws-sdk-go-v2/service/bcmdataexports v1.7.8 // indirect github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2 // indirect - github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.0 // indirect + github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1 // indirect github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1 // indirect github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.2 // indirect github.com/aws/aws-sdk-go-v2/service/chime v1.34.8 // indirect @@ -67,7 +67,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloud9 v1.28.9 // indirect github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.23.3 // indirect github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.1 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0 // indirect github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8 // indirect github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.28.1 // indirect github.com/aws/aws-sdk-go-v2/service/cloudsearch v1.26.7 // indirect @@ -86,15 +86,15 @@ require ( github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.29.8 // indirect github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.26.8 // indirect github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9 // indirect - github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.3 // indirect + github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2 // indirect github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8 // indirect github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.40.2 // indirect github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2 // indirect - github.com/aws/aws-sdk-go-v2/service/connect v1.123.0 // indirect + github.com/aws/aws-sdk-go-v2/service/connect v1.122.1 // indirect github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8 // indirect github.com/aws/aws-sdk-go-v2/service/controltower v1.20.2 // indirect github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8 // indirect - github.com/aws/aws-sdk-go-v2/service/costexplorer v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2 // indirect github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.44.1 // indirect github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.45.1 // indirect @@ -110,7 +110,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/directconnect v1.30.2 // indirect github.com/aws/aws-sdk-go-v2/service/directoryservice v1.30.9 // indirect github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1 // indirect - github.com/aws/aws-sdk-go-v2/service/docdb v1.40.0 // indirect + github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7 // indirect github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5 // indirect github.com/aws/aws-sdk-go-v2/service/drs v1.30.8 // indirect github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.1 // indirect @@ -119,7 +119,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.8 // indirect github.com/aws/aws-sdk-go-v2/service/ecs v1.53.1 // indirect github.com/aws/aws-sdk-go-v2/service/efs v1.34.2 // indirect - github.com/aws/aws-sdk-go-v2/service/eks v1.55.0 // indirect + github.com/aws/aws-sdk-go-v2/service/eks v1.54.1 // indirect github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2 // indirect github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.7 // indirect @@ -171,7 +171,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/kinesisvideo v1.27.8 // indirect github.com/aws/aws-sdk-go-v2/service/kms v1.37.8 // indirect github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2 // indirect - github.com/aws/aws-sdk-go-v2/service/lambda v1.69.2 // indirect + github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1 // indirect github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8 // indirect github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.49.8 // indirect @@ -180,7 +180,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/location v1.42.8 // indirect github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.31.8 // indirect github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1 // indirect - github.com/aws/aws-sdk-go-v2/service/macie2 v1.44.0 // indirect + github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8 // indirect github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1 // indirect github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.64.0 // indirect github.com/aws/aws-sdk-go-v2/service/medialive v1.65.0 // indirect @@ -202,7 +202,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/opsworks v1.26.8 // indirect github.com/aws/aws-sdk-go-v2/service/organizations v1.36.2 // indirect github.com/aws/aws-sdk-go-v2/service/osis v1.14.8 // indirect - github.com/aws/aws-sdk-go-v2/service/outposts v1.48.0 // indirect + github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3 // indirect github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3 // indirect github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.9.8 // indirect github.com/aws/aws-sdk-go-v2/service/pcs v1.2.9 // indirect @@ -215,7 +215,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/qldb v1.25.8 // indirect github.com/aws/aws-sdk-go-v2/service/quicksight v1.82.1 // indirect github.com/aws/aws-sdk-go-v2/service/ram v1.29.8 // indirect - github.com/aws/aws-sdk-go-v2/service/rbin v1.21.3 // indirect + github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2 // indirect github.com/aws/aws-sdk-go-v2/service/rds v1.93.1 // indirect github.com/aws/aws-sdk-go-v2/service/redshift v1.53.1 // indirect github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.31.5 // indirect @@ -237,7 +237,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3control v1.52.1 // indirect github.com/aws/aws-sdk-go-v2/service/s3outposts v1.28.8 // indirect github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sagemaker v1.170.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1 // indirect github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9 // indirect github.com/aws/aws-sdk-go-v2/service/schemas v1.28.9 // indirect github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.8 // indirect @@ -246,7 +246,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository v1.24.8 // indirect github.com/aws/aws-sdk-go-v2/service/servicecatalog v1.32.8 // indirect github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8 // indirect - github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.1 // indirect + github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0 // indirect github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8 // indirect github.com/aws/aws-sdk-go-v2/service/ses v1.29.2 // indirect github.com/aws/aws-sdk-go-v2/service/sesv2 v1.40.1 // indirect diff --git a/tools/tfsdk2fw/go.sum b/tools/tfsdk2fw/go.sum index 5b82ec1e040..4b5e2f9d5f0 100644 --- a/tools/tfsdk2fw/go.sum +++ b/tools/tfsdk2fw/go.sum @@ -99,7 +99,6 @@ github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2 h1:j68iNEyVNTTg8NSAr0KJF66/ github.com/aws/aws-sdk-go-v2/service/bedrock v1.25.2/go.mod h1:EyyHjPLtcZUu2eg+aB7K9xs4AKskGN1T755632T/Df8= github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1 h1:h/oJnoWSxz56jAuLTIc60LQLI+NITvx4eT3YIFYrbRs= github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.32.1/go.mod h1:DsVlL/WBmekQaLyt+puVryiwgPRVmdG4iYtXFKk1D0o= -github.com/aws/aws-sdk-go-v2/service/bedrockagent v1.33.0/go.mod h1:DsVlL/WBmekQaLyt+puVryiwgPRVmdG4iYtXFKk1D0o= github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1 h1:tVNnwsNTeo+Etw9gr1sWV+Kj3ZoMJc43iZpVU4R8eeg= github.com/aws/aws-sdk-go-v2/service/budgets v1.29.1/go.mod h1:JY7T8MaH4rW9YFQEWexD4WKErgSgSqozoV3sKghAhNI= github.com/aws/aws-sdk-go-v2/service/chatbot v1.9.2 h1:Pk375myUxoD39hTn0b/+7nYIlG3SP7f4aOsoH3NVk70= @@ -120,7 +119,6 @@ github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2 h1:6USen+lDo8xYQutfn github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.2/go.mod h1:10A7sHyxlTZSB7419K2wq/1tn0x/K9/drbD2j8VRZVc= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0 h1:zYk75ljFsvA6PgmbkMVy5b3M/arUF7EY3kHJz7LDaDk= github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.0/go.mod h1:fXHLupAMPNGhRAW7e2kS0aoDY/KsQ9GHu80GSK70cRs= -github.com/aws/aws-sdk-go-v2/service/cloudfront v1.44.1/go.mod h1:m70SuBWmdnAnd6e3Z2PxtLL8PfgzFXx4hcGlySK/yik= github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8 h1:9st+40hamlQ/98Q7ppwFJQMoWa0HbnmVX7+JlWNVQeU= github.com/aws/aws-sdk-go-v2/service/cloudfrontkeyvaluestore v1.8.8/go.mod h1:qb90fXDbbwuDneZ1VlhEXRFULd7+pkwoqzqzJ/ygm34= github.com/aws/aws-sdk-go-v2/service/cloudhsmv2 v1.28.1 h1:4ESEUP6oHjykdCx1ab21nKpYQlkadizCqZ3OD/9SU/4= @@ -159,7 +157,6 @@ github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9 h1:45fUrgNmm/p7K3jZ github.com/aws/aws-sdk-go-v2/service/cognitoidentity v1.27.9/go.mod h1:YKkFAyQpB2INvqQCRqund14d8HOwz3r8lA+9ZwzoPWs= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2 h1:qdBokbj4eZVXEy0VUrygCeko152JHlqwlYEIJMOcV9c= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.2/go.mod h1:Rb0ZVYhF0yOeUKciNUNOsUwMwnlZCod7zyiF2+C7qVQ= -github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.48.3/go.mod h1:Rb0ZVYhF0yOeUKciNUNOsUwMwnlZCod7zyiF2+C7qVQ= github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8 h1:DVmvbYjA+ZwyzDiPyexJp5TS2d0A0lJXQwII5XXOifc= github.com/aws/aws-sdk-go-v2/service/comprehend v1.35.8/go.mod h1:B54u0dzMmGt47kJ98a/lFwByBscvrIWT2HX1p/szNWc= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.40.2 h1:DxMFMEcH8cXMB2KSfDSY/QWQ3LQMBbCRVS9OxB+D3s0= @@ -168,7 +165,6 @@ github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2 h1:DbzEBJvSIuk5yPyzD9 github.com/aws/aws-sdk-go-v2/service/configservice v1.51.2/go.mod h1:nm1OoNlPmGfPdBvK/xqNvh3aqnsCXu8N3cyLk28kRfc= github.com/aws/aws-sdk-go-v2/service/connect v1.122.1 h1:vu+ORfPdLzi5JYX2xOKaBMBlmLtOvzo/Zk6u6Y0nEq4= github.com/aws/aws-sdk-go-v2/service/connect v1.122.1/go.mod h1:nZpWdBCj5AvfqaUYTZiP8RrF0M7og3aIVhf9KoQFqNg= -github.com/aws/aws-sdk-go-v2/service/connect v1.123.0/go.mod h1:nZpWdBCj5AvfqaUYTZiP8RrF0M7og3aIVhf9KoQFqNg= github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8 h1:hj206zH/z7il1iX09N8S46Qzs8k6v6sacJrIp1Jcpj0= github.com/aws/aws-sdk-go-v2/service/connectcases v1.21.8/go.mod h1:MS/Qch0cTw1+b2VeFNt71D8krYxjuYlmWvnYV8Nof5k= github.com/aws/aws-sdk-go-v2/service/controltower v1.20.2 h1:cVkS7f2tetfZz55XO64+GlDecSJslcxVrwJ8nZVwcpc= @@ -177,7 +173,6 @@ github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8 h1:tNRHv8 github.com/aws/aws-sdk-go-v2/service/costandusagereportservice v1.28.8/go.mod h1:mj6abMUDCI9R5smS3ZLCprpxBvjV8ljxROlA0VcEXpQ= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2 h1:q9j9CnWD6UAtx4TwIEt6sFphNQbj7ZNw7pg7UrC4PqQ= github.com/aws/aws-sdk-go-v2/service/costexplorer v1.45.2/go.mod h1:5WHHpqKGSnRAIbRHXrslVwNyIx/oGCPCz7swI7Iotbg= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.46.0/go.mod h1:5WHHpqKGSnRAIbRHXrslVwNyIx/oGCPCz7swI7Iotbg= github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2 h1:Ek+aYopz3wADJJft8YOHZYVZiMPK66laU/rKvl8pVTA= github.com/aws/aws-sdk-go-v2/service/costoptimizationhub v1.11.2/go.mod h1:yvizjKqbFymZRI19hE6XLehO5hULzK66hthy/5kOvG8= github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.44.1 h1:a+ECmdBt81/vUkUDBKI3xz1tz2rVRegE0TxgNYbIaho= @@ -210,7 +205,6 @@ github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1 h1:X0DKU9+oDntUnhgJLsh2zxSr5HVx github.com/aws/aws-sdk-go-v2/service/dlm v1.29.1/go.mod h1:U/tY2rV+/oZ2YsUUe49PMoz9XKbN0+CQHzT5JhbXyBc= github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7 h1:oCYSt6G9i8wv6Gj8Svy7fnYDbb9knLTT71OVTYrUXGk= github.com/aws/aws-sdk-go-v2/service/docdb v1.39.7/go.mod h1:MQ9uU7FnemGLCkLCfl4ikGvq7UVduD169Kxft07J4kw= -github.com/aws/aws-sdk-go-v2/service/docdb v1.40.0/go.mod h1:MQ9uU7FnemGLCkLCfl4ikGvq7UVduD169Kxft07J4kw= github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5 h1:JEGaqPMALXNvkwMAQFaWHFmsJeEQxokYxklxnYOo66o= github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.14.5/go.mod h1:USqXLryQqswYCghqSEITP/qIKwMGaFiMt7CohdHwVIc= github.com/aws/aws-sdk-go-v2/service/drs v1.30.8 h1:lTmz5+1IUklrXFIay3glpkS4UG8BuojaqsR+zfE65Mo= @@ -229,7 +223,6 @@ github.com/aws/aws-sdk-go-v2/service/efs v1.34.2 h1:gV7yKX8euN6W9vXiPutShochfx5r github.com/aws/aws-sdk-go-v2/service/efs v1.34.2/go.mod h1:SB5IpCGoPDDTpf7wMLVtq5MRsad+vqIMONmJf/l4nqY= github.com/aws/aws-sdk-go-v2/service/eks v1.54.1 h1:3sdH9XCjhoB7mpTGveksfT35NLbTahjTf7Sf4rPcqZk= github.com/aws/aws-sdk-go-v2/service/eks v1.54.1/go.mod h1:kNUWaiotRWCnfQlprrxSMg8ALqbZyA9xLCwKXuLumSk= -github.com/aws/aws-sdk-go-v2/service/eks v1.55.0/go.mod h1:kNUWaiotRWCnfQlprrxSMg8ALqbZyA9xLCwKXuLumSk= github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2 h1:+dzQKj9hOytVJOQjRxBI1nWyfoyB4gPh91vUTnPPOTk= github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.2/go.mod h1:XIxNB7tOhWeEBxjR73NTGrQ6tTHM2YBCKS/5CL2YKqE= github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk v1.28.8 h1:A6w8FeT/ZD67gHTlJLdemN3eZbvcVXOcmeHvTLbkeCY= @@ -334,7 +327,6 @@ github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2 h1:IUlID9r2gZKHN+oxQ7 github.com/aws/aws-sdk-go-v2/service/lakeformation v1.39.2/go.mod h1:/8URO3jdXHx2trFkw8886/BvIymTacL7D8ycHuYly6M= github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1 h1:q1NrvoJiz0rm9ayKOJ9wsMGmStK6rZSY36BDICMrcuY= github.com/aws/aws-sdk-go-v2/service/lambda v1.69.1/go.mod h1:hDj7He9kbR9T5zugnS+T21l4z6do4SEGuno/BpJLpA0= -github.com/aws/aws-sdk-go-v2/service/lambda v1.69.2/go.mod h1:jWFEZMgQ48dPvuAWy2zcRIq8Mx/L0eO0iR1xkGR4Ov8= github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8 h1:Kxrp+zOb2WYS4BDRS7osCBOPIK1T7OedcOytIe2I8CY= github.com/aws/aws-sdk-go-v2/service/launchwizard v1.8.8/go.mod h1:f+ruiwPQPaXW7OnTCUn5ttZm21UvB3WKMd7PxFxaSaM= github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice v1.28.8 h1:wlqWZFl1a5658FCynvBGxlZVRzwgltRkAbggFSc48Jc= @@ -353,7 +345,6 @@ github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1 h1:01gzWPcmywLIDTNsuMTMkwDd56DOp github.com/aws/aws-sdk-go-v2/service/m2 v1.19.1/go.mod h1:QmxK4noc4FpL88R5hgX00wMhJeaqwxGcXC3SxoIXoQc= github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8 h1:usVxo62y3iObzvgXR6+Vx7F6GSEM9sa6vcCxPcOdgpI= github.com/aws/aws-sdk-go-v2/service/macie2 v1.43.8/go.mod h1:+55oP7voi8jWtWudP3C6df7b4+XEQ50rOs2/Y2P136A= -github.com/aws/aws-sdk-go-v2/service/macie2 v1.44.0/go.mod h1:+55oP7voi8jWtWudP3C6df7b4+XEQ50rOs2/Y2P136A= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1 h1:3/O+TzUvCfOeb8RZCyRlrRkBYdgBWiIt8SFuPcTR6IU= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.36.1/go.mod h1:nQRm3vFS++fo+i1pixS31pDKDaWSMBjyVCOSL4po3ps= github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.64.0 h1:/MobMJ7VPnNxykUTUDkaloZBEKMl/t08QBBQlU2SdbU= @@ -398,7 +389,6 @@ github.com/aws/aws-sdk-go-v2/service/osis v1.14.8 h1:C5t9VoY0Rgec9zAdzXlvXXkhj+z github.com/aws/aws-sdk-go-v2/service/osis v1.14.8/go.mod h1:eyPTDZRCYMT/LOsDMiMgB4uzGcBWX3o2DpVyvrBsCOs= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3 h1:YE0eVKRQuBEyDp5N7MLus5kxU58+QUHv6JBQXi6/tzg= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.3/go.mod h1:W4/z6UyMkYcZ9wXH+K9NuAgORXhSSOeSf9Jy/tcnoGM= -github.com/aws/aws-sdk-go-v2/service/outposts v1.48.0/go.mod h1:W4/z6UyMkYcZ9wXH+K9NuAgORXhSSOeSf9Jy/tcnoGM= github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3 h1:ktY4tL7IGLYYjx9PIqH+dM8gneIsFJ++Nu6n1MHu6MQ= github.com/aws/aws-sdk-go-v2/service/paymentcryptography v1.16.3/go.mod h1:jnbiXijUeMw/egLenN/Q2YHVo3zw3k53wtHpAOh6F6Q= github.com/aws/aws-sdk-go-v2/service/pcaconnectorad v1.9.8 h1:XG8VNHO0HovBRoumSh6aa4lE2zvcWwYGn6liEDedeXw= @@ -425,7 +415,6 @@ github.com/aws/aws-sdk-go-v2/service/ram v1.29.8 h1:pKGf+FzvKag4RMGY5SYw/RDPyzPv github.com/aws/aws-sdk-go-v2/service/ram v1.29.8/go.mod h1:AfzjV8GA6ZIolmqP4UrZX9OXKJeCH8xQKwI12T+HbCU= github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2 h1:usYDBaq4/OMKdInWQ957wa503N26Wj/cDLkUX6VhhNA= github.com/aws/aws-sdk-go-v2/service/rbin v1.21.2/go.mod h1:bDv9F4WCfs6gGlvVCNAWgrIN4vuRdmfNafdvLjnI/Vc= -github.com/aws/aws-sdk-go-v2/service/rbin v1.21.3/go.mod h1:bDv9F4WCfs6gGlvVCNAWgrIN4vuRdmfNafdvLjnI/Vc= github.com/aws/aws-sdk-go-v2/service/rds v1.93.1 h1:v5ip0TLUaZqECeHBeBsCR3sTroCUFM1gcUY6vfqyHYM= github.com/aws/aws-sdk-go-v2/service/rds v1.93.1/go.mod h1:QEpwiX4BS6nos2d/ele6gRGalNW0Hzc1TZMmhkywQb0= github.com/aws/aws-sdk-go-v2/service/redshift v1.53.1 h1:fpuhuF5DuY26w61bBq8YrMYecLVs6eiQK7JbD9womPI= @@ -470,7 +459,6 @@ github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1 h1:lYUf+JdG7N/AulNkJMBltvXf github.com/aws/aws-sdk-go-v2/service/s3tables v1.0.1/go.mod h1:LfkUcn8gnPNKpiN+A+b3zD6Gtw7Vu1LNlnBZAOd4N9E= github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1 h1:D/vrtWIZiWdTS7RuMe0mYflx+p0QBiuIdxefh8OuoIk= github.com/aws/aws-sdk-go-v2/service/sagemaker v1.169.1/go.mod h1:hzu5ncs1K7l08GCup8WRVxw/uqgw1BQLDyfVomRM3sY= -github.com/aws/aws-sdk-go-v2/service/sagemaker v1.170.0/go.mod h1:hzu5ncs1K7l08GCup8WRVxw/uqgw1BQLDyfVomRM3sY= github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9 h1:isM0cEE6tsKx0nN8PN6mD5KE875ZoXpBOyuhVg9eizw= github.com/aws/aws-sdk-go-v2/service/scheduler v1.12.9/go.mod h1:GjSCVTlF0mOfHmQCl1MKcQIwmMOX4HYkKO3twXbm8+k= github.com/aws/aws-sdk-go-v2/service/schemas v1.28.9 h1:/GpTD05rBAVsnlnK+8uTTystVVb/tcCumvdvUhgwDAo= @@ -489,7 +477,6 @@ github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8 h1:G9LHlc github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry v1.30.8/go.mod h1:PqH0Z4nbCtd1+zDrMTxLK+v4JaYdHSDzZb+FurGamcs= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0 h1:e1QcVk0DcUPLPUjnBC3A+Z5kvDc0Sqp3jWQvhjGEwSE= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.0/go.mod h1:YMM+e0OfZQVBpTJs+WNZWP/hdodeWnepXgancR5NFFw= -github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.34.1/go.mod h1:KmNFSoNNh6qNFUCfNAVf3yW+gZXgEPc//PGttodQ1KU= github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8 h1:05g+xF2b6eqAwCeHpl8v6nRY0+u8CpgIOd+vwtnyB10= github.com/aws/aws-sdk-go-v2/service/servicequotas v1.25.8/go.mod h1:l6nMNVvoAEbRczyvXiYGChtzbm3UuZdrbMW7/FWelI0= github.com/aws/aws-sdk-go-v2/service/ses v1.29.2 h1:ezumdYONyhe5B4OvSZxQfqfSyKW9kjekr56u1UjQmys= From 012e0a32f0686212f447447fd3d81c3d0ce256ad Mon Sep 17 00:00:00 2001 From: hjoshi123 Date: Thu, 26 Dec 2024 01:34:40 -0700 Subject: [PATCH 3/9] fixed test issues --- internal/service/eks/node_group.go | 4 +++- internal/service/eks/node_group_test.go | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/service/eks/node_group.go b/internal/service/eks/node_group.go index fe7e3af4d8b..c527ae0c8c2 100644 --- a/internal/service/eks/node_group.go +++ b/internal/service/eks/node_group.go @@ -434,9 +434,11 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta int d.Set("node_group_name", nodeGroup.NodegroupName) d.Set("node_group_name_prefix", create.NamePrefixFromName(aws.ToString(nodeGroup.NodegroupName))) if nodeGroup.NodeRepairConfig != nil { - if err := d.Set("node_repair_config", flattenNodeGroupRepairConfig(nodeGroup.NodeRepairConfig)); err != nil { + if err := d.Set("node_repair_config", []interface{}{flattenNodeGroupRepairConfig(nodeGroup.NodeRepairConfig)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting node_repair_config: %s", err) } + } else { + d.Set("node_repair_config", nil) } d.Set("node_role_arn", nodeGroup.NodeRole) d.Set("release_version", nodeGroup.ReleaseVersion) diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 1c4634dab4c..2476e91ab96 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -533,6 +533,11 @@ func TestAccEKSNodeGroup_RepairConfig(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "node_repair_config.0.enabled", acctest.CtTrue), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -2082,7 +2087,7 @@ resource "aws_eks_node_group" "test" { min_size = 1 } - node_repair_config = { + node_repair_config { enabled = true } From ed88ae03b171a057720f0c2562801598f052f0dc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 26 Dec 2024 08:16:47 -0500 Subject: [PATCH 4/9] Add CHANGELOG entry. --- .changelog/40698.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/40698.txt diff --git a/.changelog/40698.txt b/.changelog/40698.txt new file mode 100644 index 00000000000..8f1405f17e5 --- /dev/null +++ b/.changelog/40698.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_eks_node_group: Add `node_repair_config` configuration block +``` \ No newline at end of file From 8342dcac445fa8aa61cb9ab535e76b196b83c69e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 26 Dec 2024 08:19:45 -0500 Subject: [PATCH 5/9] Update documentation. --- website/docs/r/eks_node_group.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/r/eks_node_group.html.markdown b/website/docs/r/eks_node_group.html.markdown index bcbbd5b62c9..49c8f712cc3 100644 --- a/website/docs/r/eks_node_group.html.markdown +++ b/website/docs/r/eks_node_group.html.markdown @@ -150,6 +150,7 @@ The following arguments are optional: * `launch_template` - (Optional) Configuration block with Launch Template settings. See [`launch_template`](#launch_template-configuration-block) below for details. Conflicts with `remote_access`. * `node_group_name` – (Optional) Name of the EKS Node Group. If omitted, Terraform will assign a random, unique name. Conflicts with `node_group_name_prefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters. * `node_group_name_prefix` – (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `node_group_name`. +* `node_repair_config` - (Optional) The node auto repair configuration for the node group. See [`node_repair_config`](#node_repair_config-configuration-block) below for details. * `release_version` – (Optional) AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version. * `remote_access` - (Optional) Configuration block with remote access settings. See [`remote_access`](#remote_access-configuration-block) below for details. Conflicts with `launch_template`. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -165,6 +166,10 @@ The following arguments are optional: * `name` - (Optional) Name of the EC2 Launch Template. Conflicts with `id`. * `version` - (Required) EC2 Launch Template version number. While the API accepts values like `$Default` and `$Latest`, the API will convert the value to the associated version number (e.g., `1`) on read and Terraform will show a difference on next plan. Using the `default_version` or `latest_version` attribute of the `aws_launch_template` resource or data source is recommended for this argument. +### node_repair_config Configuration Block + +* `enabled` - (Required) Specifies whether to enable node auto repair for the node group. Node auto repair is disabled by default. + ### remote_access Configuration Block * `ec2_ssh_key` - (Optional) EC2 Key Pair name that provides access for remote communication with the worker nodes in the EKS Node Group. If you specify this configuration, but do not specify `source_security_group_ids` when you create an EKS Node Group, either port 3389 for Windows, or port 22 for all other operating systems is opened on the worker nodes to the Internet (0.0.0.0/0). For Windows nodes, this will allow you to use RDP, for all others this allows you to SSH into the worker nodes. From eb97727aac306e3b8c64138b8ec786411b19adc6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 26 Dec 2024 08:35:18 -0500 Subject: [PATCH 6/9] Cosmetics. --- internal/service/eks/node_group.go | 179 +++++++++--------- .../service/eks/node_group_data_source.go | 4 +- .../eks/node_group_data_source_test.go | 4 +- internal/service/eks/node_group_test.go | 95 +++++----- .../eks/node_groups_data_source_test.go | 2 +- 5 files changed, 138 insertions(+), 146 deletions(-) diff --git a/internal/service/eks/node_group.go b/internal/service/eks/node_group.go index c527ae0c8c2..41b6585d333 100644 --- a/internal/service/eks/node_group.go +++ b/internal/service/eks/node_group.go @@ -357,7 +357,7 @@ func resourceNodeGroupCreate(ctx context.Context, d *schema.ResourceData, meta i } if v, ok := d.GetOk("node_repair_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - input.NodeRepairConfig = expandNodegroupRepairConfig(v.([]interface{})[0].(map[string]interface{})) + input.NodeRepairConfig = expandNodeRepairConfig(v.([]interface{})[0].(map[string]interface{})) } if v, ok := d.GetOk("release_version"); ok { @@ -434,7 +434,7 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta int d.Set("node_group_name", nodeGroup.NodegroupName) d.Set("node_group_name_prefix", create.NamePrefixFromName(aws.ToString(nodeGroup.NodegroupName))) if nodeGroup.NodeRepairConfig != nil { - if err := d.Set("node_repair_config", []interface{}{flattenNodeGroupRepairConfig(nodeGroup.NodeRepairConfig)}); err != nil { + if err := d.Set("node_repair_config", []interface{}{flattenNodeRepairConfig(nodeGroup.NodeRepairConfig)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting node_repair_config: %s", err) } } else { @@ -445,11 +445,11 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta int if err := d.Set("remote_access", flattenRemoteAccessConfig(nodeGroup.RemoteAccess)); err != nil { return sdkdiag.AppendErrorf(diags, "setting remote_access: %s", err) } - if err := d.Set(names.AttrResources, flattenNodeGroupResources(nodeGroup.Resources)); err != nil { + if err := d.Set(names.AttrResources, flattenNodegroupResources(nodeGroup.Resources)); err != nil { return sdkdiag.AppendErrorf(diags, "setting resources: %s", err) } if nodeGroup.ScalingConfig != nil { - if err := d.Set("scaling_config", []interface{}{flattenNodeGroupScalingConfig(nodeGroup.ScalingConfig)}); err != nil { + if err := d.Set("scaling_config", []interface{}{flattenNodegroupScalingConfig(nodeGroup.ScalingConfig)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting scaling_config: %s", err) } } else { @@ -461,7 +461,7 @@ func resourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta int return sdkdiag.AppendErrorf(diags, "setting taint: %s", err) } if nodeGroup.UpdateConfig != nil { - if err := d.Set("update_config", []interface{}{flattenNodeGroupUpdateConfig(nodeGroup.UpdateConfig)}); err != nil { + if err := d.Set("update_config", []interface{}{flattenNodegroupUpdateConfig(nodeGroup.UpdateConfig)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting update_config: %s", err) } } else { @@ -534,7 +534,7 @@ func resourceNodeGroupUpdate(ctx context.Context, d *schema.ResourceData, meta i } } - if d.HasChanges("labels", "scaling_config", "taint", "update_config", "node_repair_config") { + if d.HasChanges("labels", "node_repair_config", "scaling_config", "taint", "update_config") { oldLabelsRaw, newLabelsRaw := d.GetChange("labels") oldTaintsRaw, newTaintsRaw := d.GetChange("taint") @@ -548,7 +548,7 @@ func resourceNodeGroupUpdate(ctx context.Context, d *schema.ResourceData, meta i if d.HasChange("node_repair_config") { if v, ok := d.GetOk("node_repair_config"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - input.NodeRepairConfig = expandNodegroupRepairConfig(v.([]interface{})[0].(map[string]interface{})) + input.NodeRepairConfig = expandNodeRepairConfig(v.([]interface{})[0].(map[string]interface{})) } } @@ -777,28 +777,28 @@ func issuesError(apiObjects []types.Issue) error { return errors.Join(errs...) } -func expandLaunchTemplateSpecification(l []interface{}) *types.LaunchTemplateSpecification { - if len(l) == 0 || l[0] == nil { +func expandLaunchTemplateSpecification(tfList []interface{}) *types.LaunchTemplateSpecification { + if len(tfList) == 0 || tfList[0] == nil { return nil } - m := l[0].(map[string]interface{}) + tfMap := tfList[0].(map[string]interface{}) - config := &types.LaunchTemplateSpecification{} + apiObject := &types.LaunchTemplateSpecification{} - if v, ok := m[names.AttrID].(string); ok && v != "" { - config.Id = aws.String(v) + if v, ok := tfMap[names.AttrID].(string); ok && v != "" { + apiObject.Id = aws.String(v) } - if v, ok := m[names.AttrName].(string); ok && v != "" { - config.Name = aws.String(v) + if v, ok := tfMap[names.AttrName].(string); ok && v != "" { + apiObject.Name = aws.String(v) } - if v, ok := m[names.AttrVersion].(string); ok && v != "" { - config.Version = aws.String(v) + if v, ok := tfMap[names.AttrVersion].(string); ok && v != "" { + apiObject.Version = aws.String(v) } - return config + return apiObject } func expandNodegroupScalingConfig(tfMap map[string]interface{}) *types.NodegroupScalingConfig { @@ -823,38 +823,37 @@ func expandNodegroupScalingConfig(tfMap map[string]interface{}) *types.Nodegroup return apiObject } -func expandTaints(l []interface{}) []types.Taint { - if len(l) == 0 { +func expandTaints(tfList []interface{}) []types.Taint { + if len(tfList) == 0 { return nil } - var taints []types.Taint - - for _, raw := range l { - t, ok := raw.(map[string]interface{}) + var apiObjects []types.Taint + for _, tfMapRaw := range tfList { + tfMap, ok := tfMapRaw.(map[string]interface{}) if !ok { continue } - taint := types.Taint{} + apiObject := types.Taint{} - if k, ok := t[names.AttrKey].(string); ok { - taint.Key = aws.String(k) + if v, ok := tfMap["effect"].(string); ok { + apiObject.Effect = types.TaintEffect(v) } - if v, ok := t[names.AttrValue].(string); ok { - taint.Value = aws.String(v) + if v, ok := tfMap[names.AttrKey].(string); ok { + apiObject.Key = aws.String(v) } - if e, ok := t["effect"].(string); ok { - taint.Effect = types.TaintEffect(e) + if v, ok := tfMap[names.AttrValue].(string); ok { + apiObject.Value = aws.String(v) } - taints = append(taints, taint) + apiObjects = append(apiObjects, apiObject) } - return taints + return apiObjects } func expandUpdateTaintsPayload(oldTaintsRaw, newTaintsRaw []interface{}) *types.UpdateTaintsPayload { @@ -909,24 +908,24 @@ func expandUpdateTaintsPayload(oldTaintsRaw, newTaintsRaw []interface{}) *types. return updateTaintsPayload } -func expandRemoteAccessConfig(l []interface{}) *types.RemoteAccessConfig { - if len(l) == 0 || l[0] == nil { +func expandRemoteAccessConfig(tfList []interface{}) *types.RemoteAccessConfig { + if len(tfList) == 0 || tfList[0] == nil { return nil } - m := l[0].(map[string]interface{}) + tfMap := tfList[0].(map[string]interface{}) - config := &types.RemoteAccessConfig{} + apiObject := &types.RemoteAccessConfig{} - if v, ok := m["ec2_ssh_key"].(string); ok && v != "" { - config.Ec2SshKey = aws.String(v) + if v, ok := tfMap["ec2_ssh_key"].(string); ok && v != "" { + apiObject.Ec2SshKey = aws.String(v) } - if v, ok := m["source_security_group_ids"].(*schema.Set); ok && v.Len() > 0 { - config.SourceSecurityGroups = flex.ExpandStringValueSet(v) + if v, ok := tfMap["source_security_group_ids"].(*schema.Set); ok && v.Len() > 0 { + apiObject.SourceSecurityGroups = flex.ExpandStringValueSet(v) } - return config + return apiObject } func expandNodegroupUpdateConfig(tfMap map[string]interface{}) *types.NodegroupUpdateConfig { @@ -947,7 +946,7 @@ func expandNodegroupUpdateConfig(tfMap map[string]interface{}) *types.NodegroupU return apiObject } -func expandNodegroupRepairConfig(tfMap map[string]interface{}) *types.NodeRepairConfig { +func expandNodeRepairConfig(tfMap map[string]interface{}) *types.NodeRepairConfig { if tfMap == nil { return nil } @@ -986,60 +985,60 @@ func expandUpdateLabelsPayload(ctx context.Context, oldLabelsMap, newLabelsMap i return updateLabelsPayload } -func flattenAutoScalingGroups(autoScalingGroups []types.AutoScalingGroup) []map[string]interface{} { - if len(autoScalingGroups) == 0 { - return []map[string]interface{}{} +func flattenAutoScalingGroups(apiObjects []types.AutoScalingGroup) []interface{} { + if len(apiObjects) == 0 { + return []interface{}{} } - l := make([]map[string]interface{}, 0, len(autoScalingGroups)) + tfList := make([]interface{}, 0, len(apiObjects)) - for _, autoScalingGroup := range autoScalingGroups { - m := map[string]interface{}{ - names.AttrName: aws.ToString(autoScalingGroup.Name), + for _, apiObject := range apiObjects { + tfMap := map[string]interface{}{ + names.AttrName: aws.ToString(apiObject.Name), } - l = append(l, m) + tfList = append(tfList, tfMap) } - return l + return tfList } -func flattenLaunchTemplateSpecification(config *types.LaunchTemplateSpecification) []map[string]interface{} { - if config == nil { +func flattenLaunchTemplateSpecification(apiObject *types.LaunchTemplateSpecification) []interface{} { + if apiObject == nil { return nil } - m := map[string]interface{}{} + tfMap := map[string]interface{}{} - if v := config.Id; v != nil { - m[names.AttrID] = aws.ToString(v) + if v := apiObject.Id; v != nil { + tfMap[names.AttrID] = aws.ToString(v) } - if v := config.Name; v != nil { - m[names.AttrName] = aws.ToString(v) + if v := apiObject.Name; v != nil { + tfMap[names.AttrName] = aws.ToString(v) } - if v := config.Version; v != nil { - m[names.AttrVersion] = aws.ToString(v) + if v := apiObject.Version; v != nil { + tfMap[names.AttrVersion] = aws.ToString(v) } - return []map[string]interface{}{m} + return []interface{}{tfMap} } -func flattenNodeGroupResources(resources *types.NodegroupResources) []map[string]interface{} { - if resources == nil { - return []map[string]interface{}{} +func flattenNodegroupResources(apiObject *types.NodegroupResources) []interface{} { + if apiObject == nil { + return []interface{}{} } - m := map[string]interface{}{ - "autoscaling_groups": flattenAutoScalingGroups(resources.AutoScalingGroups), - "remote_access_security_group_id": aws.ToString(resources.RemoteAccessSecurityGroup), + tfMap := map[string]interface{}{ + "autoscaling_groups": flattenAutoScalingGroups(apiObject.AutoScalingGroups), + "remote_access_security_group_id": aws.ToString(apiObject.RemoteAccessSecurityGroup), } - return []map[string]interface{}{m} + return []interface{}{tfMap} } -func flattenNodeGroupScalingConfig(apiObject *types.NodegroupScalingConfig) map[string]interface{} { +func flattenNodegroupScalingConfig(apiObject *types.NodegroupScalingConfig) map[string]interface{} { if apiObject == nil { return nil } @@ -1061,7 +1060,7 @@ func flattenNodeGroupScalingConfig(apiObject *types.NodegroupScalingConfig) map[ return tfMap } -func flattenNodeGroupRepairConfig(apiObject *types.NodeRepairConfig) map[string]interface{} { +func flattenNodeRepairConfig(apiObject *types.NodeRepairConfig) map[string]interface{} { if apiObject == nil { return nil } @@ -1075,7 +1074,7 @@ func flattenNodeGroupRepairConfig(apiObject *types.NodeRepairConfig) map[string] return tfMap } -func flattenNodeGroupUpdateConfig(apiObject *types.NodegroupUpdateConfig) map[string]interface{} { +func flattenNodegroupUpdateConfig(apiObject *types.NodegroupUpdateConfig) map[string]interface{} { if apiObject == nil { return nil } @@ -1093,33 +1092,35 @@ func flattenNodeGroupUpdateConfig(apiObject *types.NodegroupUpdateConfig) map[st return tfMap } -func flattenRemoteAccessConfig(config *types.RemoteAccessConfig) []map[string]interface{} { - if config == nil { - return []map[string]interface{}{} +func flattenRemoteAccessConfig(apiObject *types.RemoteAccessConfig) []interface{} { + if apiObject == nil { + return []interface{}{} } - m := map[string]interface{}{ - "ec2_ssh_key": aws.ToString(config.Ec2SshKey), - "source_security_group_ids": config.SourceSecurityGroups, + tfMap := map[string]interface{}{ + "ec2_ssh_key": aws.ToString(apiObject.Ec2SshKey), + "source_security_group_ids": apiObject.SourceSecurityGroups, } - return []map[string]interface{}{m} + return []interface{}{tfMap} } -func flattenTaints(taints []types.Taint) []interface{} { - if len(taints) == 0 { +func flattenTaints(apiObjects []types.Taint) []interface{} { + if len(apiObjects) == 0 { return nil } - var results []interface{} + var tfList []interface{} - for _, taint := range taints { - t := make(map[string]interface{}) - t[names.AttrKey] = aws.ToString(taint.Key) - t[names.AttrValue] = aws.ToString(taint.Value) - t["effect"] = taint.Effect + for _, apiObject := range apiObjects { + tfMap := make(map[string]interface{}) - results = append(results, t) + tfMap["effect"] = apiObject.Effect + tfMap[names.AttrKey] = aws.ToString(apiObject.Key) + tfMap[names.AttrValue] = aws.ToString(apiObject.Value) + + tfList = append(tfList, tfMap) } - return results + + return tfList } diff --git a/internal/service/eks/node_group_data_source.go b/internal/service/eks/node_group_data_source.go index dd98bd86695..d240a572a63 100644 --- a/internal/service/eks/node_group_data_source.go +++ b/internal/service/eks/node_group_data_source.go @@ -216,11 +216,11 @@ func dataSourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta i if err := d.Set("remote_access", flattenRemoteAccessConfig(nodeGroup.RemoteAccess)); err != nil { return sdkdiag.AppendErrorf(diags, "setting remote_access: %s", err) } - if err := d.Set(names.AttrResources, flattenNodeGroupResources(nodeGroup.Resources)); err != nil { + if err := d.Set(names.AttrResources, flattenNodegroupResources(nodeGroup.Resources)); err != nil { return sdkdiag.AppendErrorf(diags, "setting resources: %s", err) } if nodeGroup.ScalingConfig != nil { - if err := d.Set("scaling_config", []interface{}{flattenNodeGroupScalingConfig(nodeGroup.ScalingConfig)}); err != nil { + if err := d.Set("scaling_config", []interface{}{flattenNodegroupScalingConfig(nodeGroup.ScalingConfig)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting scaling_config: %s", err) } } else { diff --git a/internal/service/eks/node_group_data_source_test.go b/internal/service/eks/node_group_data_source_test.go index 994617458df..b969c134817 100644 --- a/internal/service/eks/node_group_data_source_test.go +++ b/internal/service/eks/node_group_data_source_test.go @@ -25,7 +25,7 @@ func TestAccEKSNodeGroupDataSource_basic(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccNodeGroupConfig_dataSourceName(rName), + Config: testAccNodeGroupConfig_name(rName), Check: resource.ComposeTestCheckFunc(), }, { @@ -57,7 +57,7 @@ func TestAccEKSNodeGroupDataSource_basic(t *testing.T) { } func testAccNodeGroupDataSourceConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupConfig_dataSourceName(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_name(rName), fmt.Sprintf(` data "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 2476e91ab96..1783fe56036 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -40,7 +40,7 @@ func TestAccEKSNodeGroup_basic(t *testing.T) { CheckDestroy: testAccCheckNodeGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccNodeGroupConfig_dataSourceName(rName), + Config: testAccNodeGroupConfig_name(rName), Check: resource.ComposeTestCheckFunc( testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup), resource.TestCheckResourceAttr(resourceName, "ami_type", string(types.AMITypesAl2X8664)), @@ -149,7 +149,7 @@ func TestAccEKSNodeGroup_disappears(t *testing.T) { CheckDestroy: testAccCheckNodeGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccNodeGroupConfig_dataSourceName(rName), + Config: testAccNodeGroupConfig_name(rName), Check: resource.ComposeTestCheckFunc( testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfeks.ResourceNodeGroup(), resourceName), @@ -513,7 +513,7 @@ func TestAccEKSNodeGroup_LaunchTemplate_version(t *testing.T) { }) } -func TestAccEKSNodeGroup_RepairConfig(t *testing.T) { +func TestAccEKSNodeGroup_nodeRepairConfig(t *testing.T) { ctx := acctest.Context(t) var nodeGroup1 types.Nodegroup rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -526,7 +526,7 @@ func TestAccEKSNodeGroup_RepairConfig(t *testing.T) { CheckDestroy: testAccCheckNodeGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccNodeGroupConfig_repairConfig(rName), + Config: testAccNodeGroupConfig_nodeRepairConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup1), resource.TestCheckResourceAttr(resourceName, "node_repair_config.#", "1"), @@ -1095,17 +1095,8 @@ func testAccCheckNodeGroupRecreated(i, j *types.Nodegroup) resource.TestCheckFun } } -func testAccNodeGroupBaseIAMAndVPCConfig(rName string) string { - return fmt.Sprintf(` -data "aws_availability_zones" "available" { - state = "available" - - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] - } -} - +func testAccNodeGroupConfig_iamAndVPCBase(rName string) string { + return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` data "aws_partition" "current" {} resource "aws_iam_role" "cluster" { @@ -1234,12 +1225,12 @@ resource "aws_subnet" "test" { "kubernetes.io/cluster/%[1]s" = "shared" } } -`, rName) +`, rName)) } -func testAccNodeGroupBaseConfig(rName string) string { +func testAccNodeGroupConfig_base(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseIAMAndVPCConfig(rName), + testAccNodeGroupConfig_iamAndVPCBase(rName), fmt.Sprintf(` resource "aws_eks_cluster" "test" { name = %[1]q @@ -1257,9 +1248,9 @@ resource "aws_eks_cluster" "test" { `, rName)) } -func testAccNodeGroupBaseVersionConfig(rName string, version string) string { +func testAccNodeGroupConfig_versionBase(rName string, version string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseIAMAndVPCConfig(rName), + testAccNodeGroupConfig_iamAndVPCBase(rName), fmt.Sprintf(` resource "aws_eks_cluster" "test" { name = %[1]q @@ -1278,8 +1269,8 @@ resource "aws_eks_cluster" "test" { `, rName, version)) } -func testAccNodeGroupConfig_dataSourceName(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` +func testAccNodeGroupConfig_name(rName string) string { + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -1302,7 +1293,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_nameGenerated(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), ` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), ` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_role_arn = aws_iam_role.node.arn @@ -1324,7 +1315,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_namePrefix(rName, namePrefix string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name_prefix = %[1]q @@ -1347,7 +1338,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_amiType(rName, amiType string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { ami_type = %[2]q cluster_name = aws_eks_cluster.test.name @@ -1371,7 +1362,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_capacityType(rName, capacityType string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { capacity_type = %[2]q cluster_name = aws_eks_cluster.test.name @@ -1395,7 +1386,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_diskSize(rName string, diskSize int) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name disk_size = %[2]d @@ -1419,7 +1410,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_forceUpdateVersion(rName, version string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseVersionConfig(rName, version), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_versionBase(rName, version), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name force_update_version = true @@ -1445,7 +1436,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_instanceTypesMultiple(rName, instanceTypes string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name @@ -1473,7 +1464,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_instanceTypesSingle(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ec2_instance_type_offering" "available" { filter { @@ -1507,7 +1498,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_labels1(rName, labelKey1, labelValue1 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -1534,7 +1525,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_labels2(rName, labelKey1, labelValue1, labelKey2, labelValue2 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -1563,7 +1554,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateId1(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1611,7 +1602,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateId2(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1659,7 +1650,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateName1(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1707,7 +1698,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateName2(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1755,7 +1746,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateVersion1(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1797,7 +1788,7 @@ resource "aws_eks_node_group" "test" { func testAccNodeGroupConfig_launchTemplateVersion2(rName string) string { return acctest.ConfigCompose( - testAccNodeGroupBaseConfig(rName), + testAccNodeGroupConfig_base(rName), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/image_id" @@ -1838,7 +1829,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_releaseVersion(rName string, version string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseVersionConfig(rName, version), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_versionBase(rName, version), fmt.Sprintf(` data "aws_ssm_parameter" "test" { name = "/aws/service/eks/optimized-ami/${aws_eks_cluster.test.version}/amazon-linux-2/recommended/release_version" } @@ -1867,7 +1858,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_remoteAccessEC2SSHKey(rName, publicKey string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_key_pair" "test" { key_name = %[1]q public_key = %[2]q @@ -1899,7 +1890,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_remoteAccessSourceSecurityIds1(rName, publicKey string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_key_pair" "test" { key_name = %[1]q public_key = %[2]q @@ -1932,7 +1923,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_scalingSizes(rName string, desiredSize, maxSize, minSize int) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -1955,7 +1946,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -1982,7 +1973,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2010,7 +2001,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_taints1(rName, taintKey1, taintValue1, taintEffect1 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2039,7 +2030,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_taints2(rName, taintKey1, taintValue1, taintEffect1, taintKey2, taintValue2, taintEffect2 string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2073,8 +2064,8 @@ resource "aws_eks_node_group" "test" { `, rName, taintKey1, taintValue1, taintEffect1, taintKey2, taintValue2, taintEffect2)) } -func testAccNodeGroupConfig_repairConfig(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` +func testAccNodeGroupConfig_nodeRepairConfig(rName string) string { + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2088,7 +2079,7 @@ resource "aws_eks_node_group" "test" { } node_repair_config { - enabled = true + enabled = true } depends_on = [ @@ -2101,7 +2092,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_update1(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2128,7 +2119,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_update2(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q @@ -2155,7 +2146,7 @@ resource "aws_eks_node_group" "test" { } func testAccNodeGroupConfig_version(rName, version string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseVersionConfig(rName, version), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_versionBase(rName, version), fmt.Sprintf(` resource "aws_eks_node_group" "test" { cluster_name = aws_eks_cluster.test.name node_group_name = %[1]q diff --git a/internal/service/eks/node_groups_data_source_test.go b/internal/service/eks/node_groups_data_source_test.go index 11a11466b00..c42d3d82da1 100644 --- a/internal/service/eks/node_groups_data_source_test.go +++ b/internal/service/eks/node_groups_data_source_test.go @@ -50,7 +50,7 @@ data "aws_eks_node_groups" "test" { } func testAccNodeGroupsDataSourceConfig_namesBasic(rName string) string { - return acctest.ConfigCompose(testAccNodeGroupBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccNodeGroupConfig_base(rName), fmt.Sprintf(` resource "aws_eks_node_group" "test_a" { cluster_name = aws_eks_cluster.test.name node_group_name = "%[1]s-test-a" From 7ea0771f6d1cd71110c10718414ea0870a8fb11c Mon Sep 17 00:00:00 2001 From: hjoshi123 Date: Thu, 26 Dec 2024 08:18:18 -0700 Subject: [PATCH 7/9] replacing string with names --- internal/service/eks/node_group.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/eks/node_group.go b/internal/service/eks/node_group.go index 41b6585d333..46a86f9d933 100644 --- a/internal/service/eks/node_group.go +++ b/internal/service/eks/node_group.go @@ -153,7 +153,7 @@ func resourceNodeGroup() *schema.Resource { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "enabled": { + names.AttrEnabled: { Type: schema.TypeBool, Optional: true, Default: false, @@ -953,7 +953,7 @@ func expandNodeRepairConfig(tfMap map[string]interface{}) *types.NodeRepairConfi apiObject := &types.NodeRepairConfig{} - if v, ok := tfMap["enabled"].(bool); ok { + if v, ok := tfMap[names.AttrEnabled].(bool); ok { apiObject.Enabled = aws.Bool(v) } @@ -1068,7 +1068,7 @@ func flattenNodeRepairConfig(apiObject *types.NodeRepairConfig) map[string]inter tfMap := make(map[string]interface{}) if v := apiObject.Enabled; v != nil { - tfMap["enabled"] = aws.ToBool(v) + tfMap[names.AttrEnabled] = aws.ToBool(v) } return tfMap From d1dbe97cd246760e7a948fecfa7d0c7468b84d12 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 26 Dec 2024 14:23:15 -0500 Subject: [PATCH 8/9] Fix 'TestAccEKSNodeGroup_basic'. --- internal/service/eks/node_group_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 1783fe56036..d64bffc06bc 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -41,9 +41,9 @@ func TestAccEKSNodeGroup_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccNodeGroupConfig_name(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup), - resource.TestCheckResourceAttr(resourceName, "ami_type", string(types.AMITypesAl2X8664)), + resource.TestCheckResourceAttr(resourceName, "ami_type", string(types.AMITypesAl2023X8664Standard)), acctest.MatchResourceAttrRegionalARN(ctx, resourceName, names.AttrARN, "eks", regexache.MustCompile(fmt.Sprintf("nodegroup/%[1]s/%[1]s/.+", rName))), resource.TestCheckResourceAttrPair(resourceName, names.AttrClusterName, eksClusterResourceName, names.AttrName), resource.TestCheckResourceAttr(resourceName, "capacity_type", string(types.CapacityTypesOnDemand)), From ae3dc34fdca06cc9b04d63440fd083dd65c56d72 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 26 Dec 2024 14:25:24 -0500 Subject: [PATCH 9/9] Fix 'TestAccEKSNodeGroup_amiType'. --- internal/service/eks/node_group_test.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index d64bffc06bc..74cb82e2580 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -162,7 +162,7 @@ func TestAccEKSNodeGroup_disappears(t *testing.T) { func TestAccEKSNodeGroup_amiType(t *testing.T) { ctx := acctest.Context(t) - var nodeGroup1, nodeGroup2 types.Nodegroup + var nodeGroup1 types.Nodegroup rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_eks_node_group.test" @@ -184,13 +184,6 @@ func TestAccEKSNodeGroup_amiType(t *testing.T) { ImportState: true, ImportStateVerify: true, }, - { - Config: testAccNodeGroupConfig_amiType(rName, string(types.AMITypesAl2Arm64)), - Check: resource.ComposeTestCheckFunc( - testAccCheckNodeGroupExists(ctx, resourceName, &nodeGroup2), - resource.TestCheckResourceAttr(resourceName, "ami_type", string(types.AMITypesAl2Arm64)), - ), - }, }, }) }