From cc4b14b77d9d43095b8335376b6e70a3d48b5894 Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Sat, 3 Feb 2024 08:44:45 +0200 Subject: [PATCH 1/6] feat: support for GuardDuty Member Detector Features --- internal/service/guardduty/guardduty_test.go | 16 + .../guardduty/member_detector_feature.go | 287 ++++++++++++++++++ .../guardduty/member_detector_feature_test.go | 206 +++++++++++++ .../service/guardduty/service_package_gen.go | 5 + ...duty_member_detector_feature.html.markdown | 59 ++++ 5 files changed, 573 insertions(+) create mode 100644 internal/service/guardduty/member_detector_feature.go create mode 100644 internal/service/guardduty/member_detector_feature_test.go create mode 100644 website/docs/r/guardduty_member_detector_feature.html.markdown diff --git a/internal/service/guardduty/guardduty_test.go b/internal/service/guardduty/guardduty_test.go index fa0ccf8b32b..3948c531293 100644 --- a/internal/service/guardduty/guardduty_test.go +++ b/internal/service/guardduty/guardduty_test.go @@ -64,6 +64,11 @@ func TestAccGuardDuty_serial(t *testing.T) { "additional_configuration": testAccOrganizationConfigurationFeature_additionalConfiguration, "multiple": testAccOrganizationConfigurationFeature_multiple, }, + "MemberDetectorFeature": { + "basic": testAccMemberDetectorFeature_basic, + "additional_configuration": testAccMemberDetectorFeature_additionalConfiguration, + "multiple": testAccMemberDetectorFeature_multiple, + }, "ThreatIntelSet": { "basic": testAccThreatIntelSet_basic, "tags": testAccThreatIntelSet_tags, @@ -101,6 +106,17 @@ func testAccMemberFromEnv(t *testing.T) (string, string) { return accountID, email } +func testAccMemberAccountFromEnv(t *testing.T) string { + accountID := os.Getenv("AWS_GUARDDUTY_MEMBER_ACCOUNT_ID") + if accountID == "" { + t.Skip( + "Environment variable AWS_GUARDDUTY_MEMBER_ACCOUNT_ID is not set. " + + "To properly test GuardDuty member accounts, " + + "a valid AWS account ID must be provided.") + } + return accountID +} + // testAccPreCheckDetectorExists verifies the current account has a single active GuardDuty detector configured. func testAccPreCheckDetectorExists(ctx context.Context, t *testing.T) { conn := acctest.Provider.Meta().(*conns.AWSClient).GuardDutyConn(ctx) diff --git a/internal/service/guardduty/member_detector_feature.go b/internal/service/guardduty/member_detector_feature.go new file mode 100644 index 00000000000..a6cde782d1b --- /dev/null +++ b/internal/service/guardduty/member_detector_feature.go @@ -0,0 +1,287 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package guardduty + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/verify" +) + +// @SDKResource("aws_guardduty_member_detector_feature", name="Member Detector Feature") +func ResourceMemberDetectorFeature() *schema.Resource { + return &schema.Resource{ + CreateWithoutTimeout: resourceMemberDetectorFeaturePut, + ReadWithoutTimeout: resourceMemberDetectorFeatureRead, + UpdateWithoutTimeout: resourceMemberDetectorFeaturePut, + DeleteWithoutTimeout: schema.NoopContext, + + Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: verify.ValidAccountID, + }, + "additional_configuration": { + Optional: true, + ForceNew: true, + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(guardduty.FeatureAdditionalConfiguration_Values(), false), + }, + "status": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(guardduty.FeatureStatus_Values(), false), + }, + }, + }, + }, + "detector_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(guardduty.DetectorFeature_Values(), false), + }, + "status": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(guardduty.FeatureStatus_Values(), false), + }, + }, + } +} + +func resourceMemberDetectorFeaturePut(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).GuardDutyConn(ctx) + + detectorID, accountID, name := d.Get("detector_id").(string), d.Get("account_id").(string), d.Get("name").(string) + + // Use a mutex to ensure that multiple features being updated concurrently don't trample on each other. + conns.GlobalMutexKV.Lock(detectorID) + defer conns.GlobalMutexKV.Unlock(detectorID) + + feature := &guardduty.MemberFeaturesConfiguration{ + Name: aws.String(name), + Status: aws.String(d.Get("status").(string)), + } + + if v, ok := d.GetOk("additional_configuration"); ok && len(v.([]interface{})) > 0 { + feature.AdditionalConfiguration = expandMemberDetectorAdditionalConfigurations(v.([]interface{})) + } + + input := &guardduty.UpdateMemberDetectorsInput{ + DetectorId: aws.String(detectorID), + AccountIds: []*string{aws.String(accountID)}, + Features: []*guardduty.MemberFeaturesConfiguration{feature}, + } + + output, err := conn.UpdateMemberDetectorsWithContext(ctx, input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating GuardDuty Member Detector (%s) Feature (%s): %s", detectorID, name, err) + } + + // {"unprocessedAccounts":[{"result":"The request is rejected because the given account ID is not an associated member of account the current account.","accountId":"123456789012"}]} + if len(output.UnprocessedAccounts) > 0 { + return sdkdiag.AppendErrorf(diags, "updating GuardDuty Member Detector (%s) Feature (%s): %s", detectorID, name, aws.StringValue(output.UnprocessedAccounts[0].Result)) + } + + if d.IsNewResource() { + d.SetId(memberDetectorFeatureCreateResourceID(detectorID, accountID, name)) + } + + return append(diags, resourceMemberDetectorFeatureRead(ctx, d, meta)...) +} + +func resourceMemberDetectorFeatureRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).GuardDutyConn(ctx) + + detectorID, accountID, name, err := memberDetectorFeatureParseResourceID(d.Id()) + if err != nil { + return sdkdiag.AppendFromErr(diags, err) + } + + feature, err := FindMemberDetectorFeatureByThreePartKey(ctx, conn, detectorID, accountID, name) + + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] GuardDuty Member Detector Feature (%s) not found, removing from state", d.Id()) + d.SetId("") + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading GuardDuty Member Detector Feature (%s): %s", d.Id(), err) + } + + if err := d.Set("additional_configuration", flattenMemberDetectorAdditionalConfigurationResults(feature.AdditionalConfiguration)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting additional_configuration: %s", err) + } + + d.Set("detector_id", detectorID) + d.Set("account_id", accountID) + d.Set("name", feature.Name) + d.Set("status", feature.Status) + + return diags +} + +const memberDetectorFeatureResourceIDSeparator = "/" + +func memberDetectorFeatureCreateResourceID(detectorID, accountID, name string) string { + parts := []string{detectorID, accountID, name} + id := strings.Join(parts, memberDetectorFeatureResourceIDSeparator) + + return id +} + +func memberDetectorFeatureParseResourceID(id string) (string, string, string, error) { + parts := strings.Split(id, memberDetectorFeatureResourceIDSeparator) + + if len(parts) == 3 && parts[0] != "" && parts[1] != "" && parts[2] != "" { + return parts[0], parts[1], parts[2], nil + } + + return "", "", "", fmt.Errorf("unexpected format for ID (%[1]s), expected DETECTORID%[2]sACCOUNTID%[2]sFEATURENAME", id, memberDetectorFeatureResourceIDSeparator) +} + +func FindMemberDetectorFeatureByThreePartKey(ctx context.Context, conn *guardduty.GuardDuty, detectorID, accountID, name string) (*guardduty.MemberFeaturesConfigurationResult, error) { + output, err := findMemberConfigurationByDetectorAndAccountID(ctx, conn, detectorID, accountID) + + if err != nil { + return nil, err + } + + return tfresource.AssertSinglePtrResult(tfslices.Filter(output.Features, func(v *guardduty.MemberFeaturesConfigurationResult) bool { + return aws.StringValue(v.Name) == name + })) +} + +func expandMemberDetectorAdditionalConfiguration(tfMap map[string]interface{}) *guardduty.MemberAdditionalConfiguration { + if tfMap == nil { + return nil + } + + apiObject := &guardduty.MemberAdditionalConfiguration{} + + if v, ok := tfMap["name"].(string); ok && v != "" { + apiObject.Name = aws.String(v) + } + + if v, ok := tfMap["status"].(string); ok && v != "" { + apiObject.Status = aws.String(v) + } + + return apiObject +} + +func expandMemberDetectorAdditionalConfigurations(tfList []interface{}) []*guardduty.MemberAdditionalConfiguration { + if len(tfList) == 0 { + return nil + } + + var apiObjects []*guardduty.MemberAdditionalConfiguration + + for _, tfMapRaw := range tfList { + tfMap, ok := tfMapRaw.(map[string]interface{}) + + if !ok { + continue + } + + apiObject := expandMemberDetectorAdditionalConfiguration(tfMap) + + if apiObject == nil { + continue + } + + apiObjects = append(apiObjects, apiObject) + } + + return apiObjects +} + +func flattenMemberDetectorAdditionalConfigurationResult(apiObject *guardduty.MemberAdditionalConfigurationResult) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.Name; v != nil { + tfMap["name"] = aws.StringValue(v) + } + + if v := apiObject.Status; v != nil { + tfMap["status"] = aws.StringValue(v) + } + + return tfMap +} + +func flattenMemberDetectorAdditionalConfigurationResults(apiObjects []*guardduty.MemberAdditionalConfigurationResult) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenMemberDetectorAdditionalConfigurationResult(apiObject)) + } + + return tfList +} + +func findMemberConfigurationByDetectorAndAccountID(ctx context.Context, conn *guardduty.GuardDuty, detectorID string, accountID string) (*guardduty.MemberDataSourceConfiguration, error) { + input := &guardduty.GetMemberDetectorsInput{ + DetectorId: aws.String(detectorID), + AccountIds: []*string{aws.String(accountID)}, + } + + output, err := conn.GetMemberDetectorsWithContext(ctx, input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if output.MemberDataSourceConfigurations == nil || len(output.MemberDataSourceConfigurations) == 0 { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.MemberDataSourceConfigurations[0], nil +} diff --git a/internal/service/guardduty/member_detector_feature_test.go b/internal/service/guardduty/member_detector_feature_test.go new file mode 100644 index 00000000000..a59a5fae43f --- /dev/null +++ b/internal/service/guardduty/member_detector_feature_test.go @@ -0,0 +1,206 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package guardduty_test + +import ( + "context" + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfguardduty "github.com/hashicorp/terraform-provider-aws/internal/service/guardduty" +) + +func testAccMemberDetectorFeature_basic(t *testing.T) { + ctx := acctest.Context(t) + resourceName := "aws_guardduty_member_detector_feature.test" + accountID := testAccMemberAccountFromEnv(t) + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckOrganizationManagementAccount(ctx, t) + testAccPreCheckDetectorExists(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: acctest.CheckDestroyNoop, + Steps: []resource.TestStep{ + { + Config: testAccMemberDetectorFeatureConfig_basic("RDS_LOGIN_EVENTS", "ENABLED", accountID), + Check: resource.ComposeAggregateTestCheckFunc( + testAccMemberDetectorFeatureExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.#", "0"), + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + resource.TestCheckResourceAttrSet(resourceName, "detector_id"), + resource.TestCheckResourceAttr(resourceName, "name", "RDS_LOGIN_EVENTS"), + resource.TestCheckResourceAttr(resourceName, "account_id", accountID), + ), + }, + }, + }) +} + +func testAccMemberDetectorFeature_additionalConfiguration(t *testing.T) { + ctx := acctest.Context(t) + resourceName := "aws_guardduty_member_detector_feature.test" + accountID := testAccMemberAccountFromEnv(t) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckOrganizationManagementAccount(ctx, t) + testAccPreCheckDetectorExists(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: acctest.CheckDestroyNoop, + Steps: []resource.TestStep{ + { + Config: testAccMemberDetectorFeatureConfig_additionalConfiguration(accountID, "ENABLED", "DISABLED"), + Check: resource.ComposeTestCheckFunc( + testAccMemberDetectorFeatureExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.#", "2"), + // TODO: member_detector_feature_test.go:53: Step 1/1 error: After applying this test step, the plan was not empty. + //resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.status", "ENABLED"), + //resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.name", "ECS_FARGATE_AGENT_MANAGEMENT"), + //resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.status", "DISABLED"), + //resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.name", "EKS_ADDON_MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "name", "RUNTIME_MONITORING"), + resource.TestCheckResourceAttr(resourceName, "account_id", accountID), + ), + }, + }, + }) +} + +func testAccMemberDetectorFeature_multiple(t *testing.T) { + ctx := acctest.Context(t) + resource1Name := "aws_guardduty_member_detector_feature.test1" + resource2Name := "aws_guardduty_member_detector_feature.test2" + resource3Name := "aws_guardduty_member_detector_feature.test3" + accountID := testAccMemberAccountFromEnv(t) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckOrganizationManagementAccount(ctx, t) + testAccPreCheckDetectorExists(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: acctest.CheckDestroyNoop, + Steps: []resource.TestStep{ + { + Config: testAccMemberDetectorFeatureConfig_multiple(accountID, "ENABLED", "DISABLED", "ENABLED"), + Check: resource.ComposeTestCheckFunc( + testAccMemberDetectorFeatureExists(ctx, resource1Name), + testAccMemberDetectorFeatureExists(ctx, resource2Name), + testAccMemberDetectorFeatureExists(ctx, resource3Name), + resource.TestCheckResourceAttr(resource1Name, "additional_configuration.#", "1"), + resource.TestCheckResourceAttr(resource1Name, "additional_configuration.0.status", "ENABLED"), + resource.TestCheckResourceAttr(resource1Name, "additional_configuration.0.name", "EKS_ADDON_MANAGEMENT"), + resource.TestCheckResourceAttr(resource1Name, "status", "ENABLED"), + resource.TestCheckResourceAttr(resource1Name, "name", "EKS_RUNTIME_MONITORING"), + resource.TestCheckResourceAttr(resource1Name, "account_id", accountID), + resource.TestCheckResourceAttr(resource2Name, "additional_configuration.#", "0"), + resource.TestCheckResourceAttr(resource2Name, "status", "DISABLED"), + resource.TestCheckResourceAttr(resource2Name, "name", "S3_DATA_EVENTS"), + resource.TestCheckResourceAttr(resource2Name, "account_id", accountID), + resource.TestCheckResourceAttr(resource3Name, "additional_configuration.#", "0"), + resource.TestCheckResourceAttr(resource3Name, "status", "ENABLED"), + resource.TestCheckResourceAttr(resource3Name, "name", "LAMBDA_NETWORK_LOGS"), + resource.TestCheckResourceAttr(resource3Name, "account_id", accountID), + ), + }, + }, + }) +} + +func testAccMemberDetectorFeatureExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).GuardDutyConn(ctx) + + _, err := tfguardduty.FindMemberDetectorFeatureByThreePartKey(ctx, conn, rs.Primary.Attributes["detector_id"], rs.Primary.Attributes["account_id"], rs.Primary.Attributes["name"]) + + return err + } +} + +func testAccMemberDetectorFeatureConfig_basic(name, status, accountID string) string { + return acctest.ConfigCompose(testAccMemberDetectorFeatureConfig_base, fmt.Sprintf(` +resource "aws_guardduty_member_detector_feature" "test" { + detector_id = data.aws_guardduty_detector.test.id + name = "%[1]s" + status = "%[2]s" + account_id = "%[3]s" +} +`, name, status, accountID)) +} + +func testAccMemberDetectorFeatureConfig_additionalConfiguration(accountID, eksStatus, ecsStatus string) string { + return acctest.ConfigCompose(testAccMemberDetectorFeatureConfig_base, fmt.Sprintf(` +resource "aws_guardduty_member_detector_feature" "test" { + detector_id = data.aws_guardduty_detector.test.id + name = "RUNTIME_MONITORING" + status = "ENABLED" + account_id = "%[1]s" + + additional_configuration { + name = "EKS_ADDON_MANAGEMENT" + status = "%[3]s" + } + additional_configuration { + name = "ECS_FARGATE_AGENT_MANAGEMENT" + status = "%[2]s" + } +} +`, accountID, ecsStatus, eksStatus)) +} + +func testAccMemberDetectorFeatureConfig_multiple(accountID, status1, status2, status3 string) string { + return acctest.ConfigCompose(testAccMemberDetectorFeatureConfig_base, fmt.Sprintf(` +resource "aws_guardduty_member_detector_feature" "test1" { + detector_id = data.aws_guardduty_detector.test.id + name = "EKS_RUNTIME_MONITORING" + status = "%[2]s" + account_id = "%[1]s" + + additional_configuration { + name = "EKS_ADDON_MANAGEMENT" + status = "%[2]s" + } +} + +resource "aws_guardduty_member_detector_feature" "test2" { + detector_id = data.aws_guardduty_detector.test.id + name = "S3_DATA_EVENTS" + status = "%[3]s" + account_id = "%[1]s" +} + +resource "aws_guardduty_member_detector_feature" "test3" { + detector_id = data.aws_guardduty_detector.test.id + name = "LAMBDA_NETWORK_LOGS" + status = "%[4]s" + account_id = "%[1]s" +} + +`, accountID, status1, status2, status3)) +} + +const testAccMemberDetectorFeatureConfig_base = ` + +data "aws_guardduty_detector" "test" {} + +` diff --git a/internal/service/guardduty/service_package_gen.go b/internal/service/guardduty/service_package_gen.go index 034bfff562b..7575b17316d 100644 --- a/internal/service/guardduty/service_package_gen.go +++ b/internal/service/guardduty/service_package_gen.go @@ -76,6 +76,11 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka Factory: ResourceMember, TypeName: "aws_guardduty_member", }, + { + Factory: ResourceMemberDetectorFeature, + TypeName: "aws_guardduty_member_detector_feature", + Name: "Member Detector Feature", + }, { Factory: ResourceOrganizationAdminAccount, TypeName: "aws_guardduty_organization_admin_account", diff --git a/website/docs/r/guardduty_member_detector_feature.html.markdown b/website/docs/r/guardduty_member_detector_feature.html.markdown new file mode 100644 index 00000000000..c01424444e2 --- /dev/null +++ b/website/docs/r/guardduty_member_detector_feature.html.markdown @@ -0,0 +1,59 @@ +--- +subcategory: "GuardDuty" +layout: "aws" +page_title: "AWS: aws_guardduty_member_detector_feature" +description: |- + Provides a resource to manage an Amazon GuardDuty member account detector feature +--- + +# Resource: aws_guardduty_member_detector_feature + +Provides a resource to manage a single Amazon GuardDuty [detector feature](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-features-activation-model.html#guardduty-features) for a member account. + +~> **NOTE:** Deleting this resource does not disable the detector feature in the member account, the resource in simply removed from state instead. + +## Example Usage + +```terraform +resource "aws_guardduty_detector" "example" { + enable = true +} + +resource "aws_guardduty_member_detector_feature" "runtime_monitoring" { + detector_id = aws_guardduty_detector.example.id + account_id = "123456789012" + name = "RUNTIME_MONITORING" + status = "ENABLED" + + additional_configuration { + name = "EKS_ADDON_MANAGEMENT" + status = "ENABLED" + } + + additional_configuration { + name = "ECS_FARGATE_AGENT_MANAGEMENT" + status = "ENABLED" + } +} +``` + +## Argument Reference + +This resource supports the following arguments: + +* `detector_id` - (Required) Amazon GuardDuty detector ID. +* `account_id` - (Required) Member account ID to be updated. +* `name` - (Required) The name of the detector feature. Valid values: `S3_DATA_EVENTS`, `EKS_AUDIT_LOGS`, `EBS_MALWARE_PROTECTION`, `RDS_LOGIN_EVENTS`, `EKS_RUNTIME_MONITORING`,`RUNTIME_MONITORING`, `LAMBDA_NETWORK_LOGS`. +* `status` - (Required) The status of the detector feature. Valid values: `ENABLED`, `DISABLED`. +* `additional_configuration` - (Optional) Additional feature configuration block. See [below](#additional-configuration). + +### Additional Configuration + +The `additional_configuration` block supports the following: + +* `name` - (Required) The name of the additional configuration. Valid values: `EKS_ADDON_MANAGEMENT`, `ECS_FARGATE_AGENT_MANAGEMENT`. +* `status` - (Required) The status of the additional configuration. Valid values: `ENABLED`, `DISABLED`. + +## Attribute Reference + +This resource exports no additional attributes. From 56510b346e22166178505c999477cc03bed4c908 Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Sat, 3 Feb 2024 11:14:32 +0200 Subject: [PATCH 2/6] add release note --- .changelog/35625.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/35625.txt diff --git a/.changelog/35625.txt b/.changelog/35625.txt new file mode 100644 index 00000000000..303be785c45 --- /dev/null +++ b/.changelog/35625.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_guardduty_member_detector_feature +``` \ No newline at end of file From 842b16c263a3f4676d73ed6f809a8b54b0cb52b8 Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Mon, 5 Feb 2024 08:10:11 +0200 Subject: [PATCH 3/6] refactor to sdkv2 and plugin fw --- go.mod | 1 + go.sum | 2 + internal/conns/awsclient_gen.go | 5 + .../guardduty/member_detector_feature.go | 421 ++++++++++-------- .../guardduty/member_detector_feature_test.go | 20 +- .../guardduty/service_endpoints_gen_test.go | 67 ++- .../service/guardduty/service_package_gen.go | 25 +- names/data/names_data.csv | 2 +- 8 files changed, 329 insertions(+), 214 deletions(-) diff --git a/go.mod b/go.mod index 06025b5a6b6..f6581b2a5df 100644 --- a/go.mod +++ b/go.mod @@ -57,6 +57,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/fis v1.21.6 github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6 github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6 + github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2 github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6 github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0 diff --git a/go.sum b/go.sum index 0871043f946..fe7477cff0d 100644 --- a/go.sum +++ b/go.sum @@ -136,6 +136,8 @@ github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6 h1:BzVx19YEwGRxXQaUYfRettlY github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6/go.mod h1:YsWnGIsj8i88/LLD4MXfKtebLTQOq3gfKzacGw9FQ5M= github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6 h1:I7iZxQRCMp8ObmMc4ahXjFa36wDgjUw8gsaksA3NWQc= github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6/go.mod h1:1TzSLA29YLrM9NlUXBmoE2GWCzuEsearbtiOW2zfW0g= +github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2 h1:k4l7fTMNB4FVlqC5ca3VWxTT0bg7AEXqj83qWycxEH8= +github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2/go.mod h1:31DEI66V3IcUtmD4vo1JdOU16YZj/Oy231YGM3fdNFc= github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6 h1:PEdeYJzkwmVLZpTKb5ewEuJGcVYC8kYknzCL0LysKFM= github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6/go.mod h1:WlZEyCR/eaZwl61jp0Dzs++HZgx2HSjXx+GwwFKcYsg= github.com/aws/aws-sdk-go-v2/service/iam v1.28.6 h1:P5oJkH50fc9mKjrzEMtYYCdMBhrbVPQsvlsD3L56Itg= diff --git a/internal/conns/awsclient_gen.go b/internal/conns/awsclient_gen.go index a091ff814b7..e2a518de576 100644 --- a/internal/conns/awsclient_gen.go +++ b/internal/conns/awsclient_gen.go @@ -51,6 +51,7 @@ import ( fis_sdkv2 "github.com/aws/aws-sdk-go-v2/service/fis" glacier_sdkv2 "github.com/aws/aws-sdk-go-v2/service/glacier" groundstation_sdkv2 "github.com/aws/aws-sdk-go-v2/service/groundstation" + guardduty_sdkv2 "github.com/aws/aws-sdk-go-v2/service/guardduty" healthlake_sdkv2 "github.com/aws/aws-sdk-go-v2/service/healthlake" identitystore_sdkv2 "github.com/aws/aws-sdk-go-v2/service/identitystore" inspector2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/inspector2" @@ -677,6 +678,10 @@ func (c *AWSClient) GuardDutyConn(ctx context.Context) *guardduty_sdkv1.GuardDut return errs.Must(conn[*guardduty_sdkv1.GuardDuty](ctx, c, names.GuardDuty, make(map[string]any))) } +func (c *AWSClient) GuardDutyClient(ctx context.Context) *guardduty_sdkv2.Client { + return errs.Must(client[*guardduty_sdkv2.Client](ctx, c, names.GuardDuty, make(map[string]any))) +} + func (c *AWSClient) HealthLakeClient(ctx context.Context) *healthlake_sdkv2.Client { return errs.Must(client[*healthlake_sdkv2.Client](ctx, c, names.HealthLake, make(map[string]any))) } diff --git a/internal/service/guardduty/member_detector_feature.go b/internal/service/guardduty/member_detector_feature.go index a6cde782d1b..105874dd79a 100644 --- a/internal/service/guardduty/member_detector_feature.go +++ b/internal/service/guardduty/member_detector_feature.go @@ -5,271 +5,294 @@ package guardduty import ( "context" + "errors" "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/guardduty" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/guardduty" + awstypes "github.com/aws/aws-sdk-go-v2/service/guardduty/types" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/errs" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + fwtypes "github.com/hashicorp/terraform-provider-aws/internal/framework/types" + fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// @FrameworkResource(name="Member Detector Feature") +func newResourceMemberDetectorFeature(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &resourceMemberDetectorFeature{} + return r, nil +} + +const ( + memberDetectorFeatureResourceIDPartCount = 3 + memberDetectorFeatureResourceName = "Member Detector Feature" + memberDetectorFeatureResourceTypeName = "aws_guardduty_member_detector_feature" ) -// @SDKResource("aws_guardduty_member_detector_feature", name="Member Detector Feature") -func ResourceMemberDetectorFeature() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceMemberDetectorFeaturePut, - ReadWithoutTimeout: resourceMemberDetectorFeatureRead, - UpdateWithoutTimeout: resourceMemberDetectorFeaturePut, - DeleteWithoutTimeout: schema.NoopContext, - - Schema: map[string]*schema.Schema{ - "account_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, +type resourceMemberDetectorFeature struct { + framework.ResourceWithConfigure +} + +func (r *resourceMemberDetectorFeature) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = memberDetectorFeatureResourceTypeName +} + +func (r *resourceMemberDetectorFeature) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "account_id": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + fwvalidators.AWSAccountID(), + }, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, }, - "additional_configuration": { - Optional: true, - ForceNew: true, - Type: schema.TypeList, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice(guardduty.FeatureAdditionalConfiguration_Values(), false), - }, - "status": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice(guardduty.FeatureStatus_Values(), false), - }, - }, + "detector_id": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), }, }, - "detector_id": { - Type: schema.TypeString, + names.AttrID: framework.IDAttribute(), + "name": schema.StringAttribute{ Required: true, - ForceNew: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + Validators: []validator.String{ + enum.FrameworkValidate[awstypes.DetectorFeature](), + }, }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice(guardduty.DetectorFeature_Values(), false), + "status": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + enum.FrameworkValidate[awstypes.FeatureStatus](), + }, }, - "status": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice(guardduty.FeatureStatus_Values(), false), + }, + Blocks: map[string]schema.Block{ + "additional_configuration": schema.ListNestedBlock{ + CustomType: fwtypes.NewListNestedObjectTypeOf[additionalConfigurationModel](ctx), + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + enum.FrameworkValidate[awstypes.OrgFeatureAdditionalConfiguration](), + }, + }, + "status": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + enum.FrameworkValidate[awstypes.FeatureStatus](), + }, + }, + }, + }, }, }, } } -func resourceMemberDetectorFeaturePut(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).GuardDutyConn(ctx) - - detectorID, accountID, name := d.Get("detector_id").(string), d.Get("account_id").(string), d.Get("name").(string) +func (r *resourceMemberDetectorFeature) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + conn := r.Meta().GuardDutyClient(ctx) - // Use a mutex to ensure that multiple features being updated concurrently don't trample on each other. - conns.GlobalMutexKV.Lock(detectorID) - defer conns.GlobalMutexKV.Unlock(detectorID) + var plan resourceMemberDetectorFeatureModel - feature := &guardduty.MemberFeaturesConfiguration{ - Name: aws.String(name), - Status: aws.String(d.Get("status").(string)), + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return } - if v, ok := d.GetOk("additional_configuration"); ok && len(v.([]interface{})) > 0 { - feature.AdditionalConfiguration = expandMemberDetectorAdditionalConfigurations(v.([]interface{})) - } + in := createUpdateMemberDetectorsInput(plan) - input := &guardduty.UpdateMemberDetectorsInput{ - DetectorId: aws.String(detectorID), - AccountIds: []*string{aws.String(accountID)}, - Features: []*guardduty.MemberFeaturesConfiguration{feature}, + if !plan.AdditionalConfiguration.IsNull() { + resp.Diagnostics.Append(fwflex.Expand(ctx, &plan.AdditionalConfiguration, &in.Features[0].AdditionalConfiguration)...) + if resp.Diagnostics.HasError() { + return + } } - output, err := conn.UpdateMemberDetectorsWithContext(ctx, input) + _, err := updateMemberDetectorFeature(ctx, conn, in) if err != nil { - return sdkdiag.AppendErrorf(diags, "updating GuardDuty Member Detector (%s) Feature (%s): %s", detectorID, name, err) + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.GuardDuty, create.ErrActionCreating, memberDetectorFeatureResourceName, plan.Name.ValueString(), err), + err.Error(), + ) + return } - // {"unprocessedAccounts":[{"result":"The request is rejected because the given account ID is not an associated member of account the current account.","accountId":"123456789012"}]} - if len(output.UnprocessedAccounts) > 0 { - return sdkdiag.AppendErrorf(diags, "updating GuardDuty Member Detector (%s) Feature (%s): %s", detectorID, name, aws.StringValue(output.UnprocessedAccounts[0].Result)) - } + // Set the ID and save the state + plan.setID() - if d.IsNewResource() { - d.SetId(memberDetectorFeatureCreateResourceID(detectorID, accountID, name)) - } - - return append(diags, resourceMemberDetectorFeatureRead(ctx, d, meta)...) + resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) } -func resourceMemberDetectorFeatureRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).GuardDutyConn(ctx) +func (r *resourceMemberDetectorFeature) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var data resourceMemberDetectorFeatureModel - detectorID, accountID, name, err := memberDetectorFeatureParseResourceID(d.Id()) - if err != nil { - return sdkdiag.AppendFromErr(diags, err) - } + resp.Diagnostics.Append(req.State.Get(ctx, &data)...) - feature, err := FindMemberDetectorFeatureByThreePartKey(ctx, conn, detectorID, accountID, name) - - if !d.IsNewResource() && tfresource.NotFound(err) { - log.Printf("[WARN] GuardDuty Member Detector Feature (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags + if resp.Diagnostics.HasError() { + return } - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading GuardDuty Member Detector Feature (%s): %s", d.Id(), err) - } + if err := data.InitFromID(); err != nil { + resp.Diagnostics.AddError("parsing resource ID", err.Error()) - if err := d.Set("additional_configuration", flattenMemberDetectorAdditionalConfigurationResults(feature.AdditionalConfiguration)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting additional_configuration: %s", err) + return } - d.Set("detector_id", detectorID) - d.Set("account_id", accountID) - d.Set("name", feature.Name) - d.Set("status", feature.Status) - - return diags -} - -const memberDetectorFeatureResourceIDSeparator = "/" - -func memberDetectorFeatureCreateResourceID(detectorID, accountID, name string) string { - parts := []string{detectorID, accountID, name} - id := strings.Join(parts, memberDetectorFeatureResourceIDSeparator) + conn := r.Meta().GuardDutyClient(ctx) - return id -} + output, err := FindMemberDetectorFeatureByThreePartKey(ctx, conn, data.DetectorID.ValueString(), data.AccountID.ValueString(), data.Name.ValueString()) -func memberDetectorFeatureParseResourceID(id string) (string, string, string, error) { - parts := strings.Split(id, memberDetectorFeatureResourceIDSeparator) + if tfresource.NotFound(err) { + resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + resp.State.RemoveResource(ctx) - if len(parts) == 3 && parts[0] != "" && parts[1] != "" && parts[2] != "" { - return parts[0], parts[1], parts[2], nil + return } - return "", "", "", fmt.Errorf("unexpected format for ID (%[1]s), expected DETECTORID%[2]sACCOUNTID%[2]sFEATURENAME", id, memberDetectorFeatureResourceIDSeparator) -} + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.GuardDuty, create.ErrActionReading, memberDetectorFeatureResourceName, data.ID.ValueString(), err), + err.Error(), + ) -func FindMemberDetectorFeatureByThreePartKey(ctx context.Context, conn *guardduty.GuardDuty, detectorID, accountID, name string) (*guardduty.MemberFeaturesConfigurationResult, error) { - output, err := findMemberConfigurationByDetectorAndAccountID(ctx, conn, detectorID, accountID) + return + } - if err != nil { - return nil, err + resp.Diagnostics.Append(fwflex.Flatten(ctx, output.AdditionalConfiguration, &data.AdditionalConfiguration)...) + if resp.Diagnostics.HasError() { + return } - return tfresource.AssertSinglePtrResult(tfslices.Filter(output.Features, func(v *guardduty.MemberFeaturesConfigurationResult) bool { - return aws.StringValue(v.Name) == name - })) + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } -func expandMemberDetectorAdditionalConfiguration(tfMap map[string]interface{}) *guardduty.MemberAdditionalConfiguration { - if tfMap == nil { - return nil - } +func (r *resourceMemberDetectorFeature) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var old, new resourceMemberDetectorFeatureModel - apiObject := &guardduty.MemberAdditionalConfiguration{} + resp.Diagnostics.Append(req.State.Get(ctx, &old)...) - if v, ok := tfMap["name"].(string); ok && v != "" { - apiObject.Name = aws.String(v) + if resp.Diagnostics.HasError() { + return } - if v, ok := tfMap["status"].(string); ok && v != "" { - apiObject.Status = aws.String(v) - } + resp.Diagnostics.Append(req.Plan.Get(ctx, &new)...) - return apiObject -} - -func expandMemberDetectorAdditionalConfigurations(tfList []interface{}) []*guardduty.MemberAdditionalConfiguration { - if len(tfList) == 0 { - return nil + if resp.Diagnostics.HasError() { + return } - var apiObjects []*guardduty.MemberAdditionalConfiguration + conn := r.Meta().GuardDutyClient(ctx) - for _, tfMapRaw := range tfList { - tfMap, ok := tfMapRaw.(map[string]interface{}) + in := createUpdateMemberDetectorsInput(new) - if !ok { - continue + if !new.AdditionalConfiguration.IsNull() { + resp.Diagnostics.Append(fwflex.Expand(ctx, new.AdditionalConfiguration, &in.Features[0].AdditionalConfiguration)...) + if resp.Diagnostics.HasError() { + return } + } - apiObject := expandMemberDetectorAdditionalConfiguration(tfMap) - - if apiObject == nil { - continue - } + _, err := updateMemberDetectorFeature(ctx, conn, in) - apiObjects = append(apiObjects, apiObject) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.GuardDuty, create.ErrActionUpdating, memberDetectorFeatureResourceName, new.ID.ValueString(), err), + err.Error(), + ) + return } - return apiObjects + resp.Diagnostics.Append(resp.State.Set(ctx, &new)...) +} + +func (r *resourceMemberDetectorFeature) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + // No-op } -func flattenMemberDetectorAdditionalConfigurationResult(apiObject *guardduty.MemberAdditionalConfigurationResult) map[string]interface{} { - if apiObject == nil { - return nil +// ==== HELPERS ==== +func createUpdateMemberDetectorsInput(plan resourceMemberDetectorFeatureModel) *guardduty.UpdateMemberDetectorsInput { + in := &guardduty.UpdateMemberDetectorsInput{ + AccountIds: []string{plan.AccountID.ValueString()}, + DetectorId: aws.String(plan.DetectorID.ValueString()), + Features: []awstypes.MemberFeaturesConfiguration{ + { + Name: awstypes.OrgFeature(plan.Name.ValueString()), + Status: awstypes.FeatureStatus(plan.Status.ValueString()), + }, + }, } + return in +} - tfMap := map[string]interface{}{} +func updateMemberDetectorFeature(ctx context.Context, conn *guardduty.Client, in *guardduty.UpdateMemberDetectorsInput) (*guardduty.UpdateMemberDetectorsOutput, error) { + conns.GlobalMutexKV.Lock(*in.DetectorId) + defer conns.GlobalMutexKV.Unlock(*in.DetectorId) + + out, err := conn.UpdateMemberDetectors(ctx, in) + if err != nil { + return out, err + } - if v := apiObject.Name; v != nil { - tfMap["name"] = aws.StringValue(v) + if out == nil { + return nil, errors.New("empty output") } - if v := apiObject.Status; v != nil { - tfMap["status"] = aws.StringValue(v) + // For example: + // {"unprocessedAccounts":[{"result":"The request is rejected because the given account ID is not an associated member of account the current account.","accountId":"123456789012"}]} + if len(out.UnprocessedAccounts) > 0 { + return out, errors.New(*(out.UnprocessedAccounts[0].Result)) } - return tfMap + return out, err } -func flattenMemberDetectorAdditionalConfigurationResults(apiObjects []*guardduty.MemberAdditionalConfigurationResult) []interface{} { - if len(apiObjects) == 0 { - return nil - } +// ==== FINDERS ==== +func FindMemberDetectorFeatureByThreePartKey(ctx context.Context, client *guardduty.Client, detectorID, accountID, name string) (*awstypes.MemberFeaturesConfigurationResult, error) { + output, err := findMemberConfigurationByDetectorAndAccountID(ctx, client, detectorID, accountID) - var tfList []interface{} + if err != nil { + return nil, err + } - for _, apiObject := range apiObjects { - if apiObject == nil { - continue + for _, feature := range output.Features { + if string(feature.Name) == name { + return &feature, nil } - - tfList = append(tfList, flattenMemberDetectorAdditionalConfigurationResult(apiObject)) } - return tfList + return nil, fmt.Errorf("no MemberFeaturesConfigurationResult found with name %s", name) + } -func findMemberConfigurationByDetectorAndAccountID(ctx context.Context, conn *guardduty.GuardDuty, detectorID string, accountID string) (*guardduty.MemberDataSourceConfiguration, error) { +func findMemberConfigurationByDetectorAndAccountID(ctx context.Context, client *guardduty.Client, detectorID string, accountID string) (*awstypes.MemberDataSourceConfiguration, error) { input := &guardduty.GetMemberDetectorsInput{ DetectorId: aws.String(detectorID), - AccountIds: []*string{aws.String(accountID)}, + AccountIds: []string{accountID}, } - output, err := conn.GetMemberDetectorsWithContext(ctx, input) + output, err := client.GetMemberDetectors(ctx, input) if err != nil { return nil, err @@ -283,5 +306,39 @@ func findMemberConfigurationByDetectorAndAccountID(ctx context.Context, conn *gu return nil, tfresource.NewEmptyResultError(input) } - return output.MemberDataSourceConfigurations[0], nil + return &output.MemberDataSourceConfigurations[0], nil +} + +// ==== MODEL ==== +type resourceMemberDetectorFeatureModel struct { + AccountID types.String `tfsdk:"account_id"` + AdditionalConfiguration fwtypes.ListNestedObjectValueOf[additionalConfigurationModel] `tfsdk:"additional_configuration"` + DetectorID types.String `tfsdk:"detector_id"` + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Status types.String `tfsdk:"status"` +} + +type additionalConfigurationModel struct { + Name types.String `tfsdk:"name"` + Status types.String `tfsdk:"status"` +} + +func (data *resourceMemberDetectorFeatureModel) InitFromID() error { + id := data.ID.ValueString() + parts, err := flex.ExpandResourceId(id, memberDetectorFeatureResourceIDPartCount, false) + + if err != nil { + return err + } + + data.DetectorID = types.StringValue(parts[0]) + data.AccountID = types.StringValue(parts[1]) + data.Name = types.StringValue(parts[2]) + + return nil +} + +func (data *resourceMemberDetectorFeatureModel) setID() { + data.ID = types.StringValue(errs.Must(flex.FlattenResourceId([]string{data.DetectorID.ValueString(), data.AccountID.ValueString(), data.Name.ValueString()}, memberDetectorFeatureResourceIDPartCount, false))) } diff --git a/internal/service/guardduty/member_detector_feature_test.go b/internal/service/guardduty/member_detector_feature_test.go index a59a5fae43f..4e34b9080d6 100644 --- a/internal/service/guardduty/member_detector_feature_test.go +++ b/internal/service/guardduty/member_detector_feature_test.go @@ -61,16 +61,15 @@ func testAccMemberDetectorFeature_additionalConfiguration(t *testing.T) { CheckDestroy: acctest.CheckDestroyNoop, Steps: []resource.TestStep{ { - Config: testAccMemberDetectorFeatureConfig_additionalConfiguration(accountID, "ENABLED", "DISABLED"), + Config: testAccMemberDetectorFeatureConfig_additionalConfiguration(accountID, "DISABLED", "ENABLED"), Check: resource.ComposeTestCheckFunc( testAccMemberDetectorFeatureExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), resource.TestCheckResourceAttr(resourceName, "additional_configuration.#", "2"), - // TODO: member_detector_feature_test.go:53: Step 1/1 error: After applying this test step, the plan was not empty. - //resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.status", "ENABLED"), - //resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.name", "ECS_FARGATE_AGENT_MANAGEMENT"), - //resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.status", "DISABLED"), - //resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.name", "EKS_ADDON_MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.status", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.0.name", "EKS_ADDON_MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.status", "ENABLED"), + resource.TestCheckResourceAttr(resourceName, "additional_configuration.1.name", "ECS_FARGATE_AGENT_MANAGEMENT"), resource.TestCheckResourceAttr(resourceName, "name", "RUNTIME_MONITORING"), resource.TestCheckResourceAttr(resourceName, "account_id", accountID), ), @@ -129,7 +128,7 @@ func testAccMemberDetectorFeatureExists(ctx context.Context, n string) resource. return fmt.Errorf("Not found: %s", n) } - conn := acctest.Provider.Meta().(*conns.AWSClient).GuardDutyConn(ctx) + conn := acctest.Provider.Meta().(*conns.AWSClient).GuardDutyClient(ctx) _, err := tfguardduty.FindMemberDetectorFeatureByThreePartKey(ctx, conn, rs.Primary.Attributes["detector_id"], rs.Primary.Attributes["account_id"], rs.Primary.Attributes["name"]) @@ -158,14 +157,15 @@ resource "aws_guardduty_member_detector_feature" "test" { additional_configuration { name = "EKS_ADDON_MANAGEMENT" - status = "%[3]s" + status = "%[2]s" } + additional_configuration { name = "ECS_FARGATE_AGENT_MANAGEMENT" - status = "%[2]s" + status = "%[3]s" } } -`, accountID, ecsStatus, eksStatus)) +`, accountID, eksStatus, ecsStatus)) } func testAccMemberDetectorFeatureConfig_multiple(accountID, status1, status2, status3 string) string { diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 6edf7a4808c..89da4d25233 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -4,15 +4,16 @@ package guardduty_test import ( "context" + "errors" "fmt" - "net/url" "os" "path/filepath" "reflect" "strings" "testing" - "github.com/aws/aws-sdk-go/aws/endpoints" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + guardduty_sdkv2 "github.com/aws/aws-sdk-go-v2/service/guardduty" guardduty_sdkv1 "github.com/aws/aws-sdk-go/service/guardduty" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -202,33 +203,69 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S }, } - for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv - testcase := testcase + t.Run("v1", func(t *testing.T) { + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + testcase := testcase - t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) - }) - } + t.Run(name, func(t *testing.T) { + testEndpointCase(t, region, testcase, callServiceV1) + }) + } + }) + + t.Run("v2", func(t *testing.T) { + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + testcase := testcase + + t.Run(name, func(t *testing.T) { + testEndpointCase(t, region, testcase, callServiceV2) + }) + } + }) } func defaultEndpoint(region string) string { - r := endpoints.DefaultResolver() + r := guardduty_sdkv2.NewDefaultEndpointResolverV2() - ep, err := r.EndpointFor(guardduty_sdkv1.EndpointsID, region) + ep, err := r.ResolveEndpoint(context.Background(), guardduty_sdkv2.EndpointParameters{ + Region: aws_sdkv2.String(region), + }) if err != nil { return err.Error() } - url, _ := url.Parse(ep.URL) + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI.String() +} + +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { + t.Helper() + + var endpoint string - if url.Path == "" { - url.Path = "/" + client := meta.GuardDutyClient(ctx) + + _, err := client.ListDetectors(ctx, &guardduty_sdkv2.ListDetectorsInput{}, + func(opts *guardduty_sdkv2.Options) { + opts.APIOptions = append(opts.APIOptions, + addRetrieveEndpointURLMiddleware(t, &endpoint), + addCancelRequestMiddleware(), + ) + }, + ) + if err == nil { + t.Fatal("Expected an error, got none") + } else if !errors.Is(err, errCancelOperation) { + t.Fatalf("Unexpected error: %s", err) } - return url.String() + return endpoint } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { t.Helper() client := meta.GuardDutyConn(ctx) diff --git a/internal/service/guardduty/service_package_gen.go b/internal/service/guardduty/service_package_gen.go index 7575b17316d..0d7d1bc8c1f 100644 --- a/internal/service/guardduty/service_package_gen.go +++ b/internal/service/guardduty/service_package_gen.go @@ -5,6 +5,8 @@ package guardduty import ( "context" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + guardduty_sdkv2 "github.com/aws/aws-sdk-go-v2/service/guardduty" aws_sdkv1 "github.com/aws/aws-sdk-go/aws" session_sdkv1 "github.com/aws/aws-sdk-go/aws/session" guardduty_sdkv1 "github.com/aws/aws-sdk-go/service/guardduty" @@ -25,7 +27,12 @@ func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.Serv } func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { - return []*types.ServicePackageFrameworkResource{} + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceMemberDetectorFeature, + Name: "Member Detector Feature", + }, + } } func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { @@ -76,11 +83,6 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka Factory: ResourceMember, TypeName: "aws_guardduty_member", }, - { - Factory: ResourceMemberDetectorFeature, - TypeName: "aws_guardduty_member_detector_feature", - Name: "Member Detector Feature", - }, { Factory: ResourceOrganizationAdminAccount, TypeName: "aws_guardduty_organization_admin_account", @@ -121,6 +123,17 @@ func (p *servicePackage) NewConn(ctx context.Context, config map[string]any) (*g return guardduty_sdkv1.New(sess.Copy(&aws_sdkv1.Config{Endpoint: aws_sdkv1.String(config["endpoint"].(string))})), nil } +// NewClient returns a new AWS SDK for Go v2 client for this service package's AWS API. +func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (*guardduty_sdkv2.Client, error) { + cfg := *(config["aws_sdkv2_config"].(*aws_sdkv2.Config)) + + return guardduty_sdkv2.NewFromConfig(cfg, func(o *guardduty_sdkv2.Options) { + if endpoint := config["endpoint"].(string); endpoint != "" { + o.BaseEndpoint = aws_sdkv2.String(endpoint) + } + }), nil +} + func ServicePackage(ctx context.Context) conns.ServicePackage { return &servicePackage{} } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index d5145f5fc52..8bf30501174 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -170,7 +170,7 @@ globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globala glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,, databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,, groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,, -guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,, +guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,2,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,, health,health,health,health,,health,,,Health,Health,,1,,,aws_health_,,health_,Health,AWS,,x,,,,,Health,,, healthlake,healthlake,healthlake,healthlake,,healthlake,,,HealthLake,HealthLake,,,2,,aws_healthlake_,,healthlake_,HealthLake,Amazon,,,,,,,HealthLake,ListFHIRDatastores,, honeycode,honeycode,honeycode,honeycode,,honeycode,,,Honeycode,Honeycode,,1,,,aws_honeycode_,,honeycode_,Honeycode,Amazon,,x,,,,,Honeycode,,, From 04067e109ab092d7a43f5737dd1f44185131f263 Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Mon, 5 Feb 2024 08:28:31 +0200 Subject: [PATCH 4/6] reset go.mod and go.sum --- go.mod | 39 ++++++++++++++-------------- go.sum | 80 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 61 insertions(+), 58 deletions(-) diff --git a/go.mod b/go.mod index f6581b2a5df..ad28b281097 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c github.com/YakDriver/regexache v0.23.0 - github.com/aws/aws-sdk-go v1.50.4 + github.com/aws/aws-sdk-go v1.50.9 github.com/aws/aws-sdk-go-v2 v1.24.1 github.com/aws/aws-sdk-go-v2/config v1.26.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 @@ -37,18 +37,18 @@ require ( github.com/aws/aws-sdk-go-v2/service/codepipeline v1.22.6 github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1 github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6 - github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6 + github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6 github.com/aws/aws-sdk-go-v2/service/connectcases v1.13.0 github.com/aws/aws-sdk-go-v2/service/controltower v1.10.7 github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.34.6 github.com/aws/aws-sdk-go-v2/service/directoryservice v1.22.8 github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0 github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7 github.com/aws/aws-sdk-go-v2/service/eks v1.37.1 github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0 github.com/aws/aws-sdk-go-v2/service/emr v1.36.1 github.com/aws/aws-sdk-go-v2/service/emrserverless v1.15.0 github.com/aws/aws-sdk-go-v2/service/evidently v1.17.0 @@ -57,10 +57,9 @@ require ( github.com/aws/aws-sdk-go-v2/service/fis v1.21.6 github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6 github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6 - github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2 github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6 github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8 - github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0 + github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0 github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.10.7 github.com/aws/aws-sdk-go-v2/service/ivschat v1.10.6 github.com/aws/aws-sdk-go-v2/service/kafka v1.28.6 @@ -72,8 +71,9 @@ require ( github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.38.6 github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0 github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6 - github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7 + github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8 github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1 + github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0 github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1 github.com/aws/aws-sdk-go-v2/service/mediapackage v1.28.7 github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.7.7 @@ -88,7 +88,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/qbusiness v1.1.7 github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6 github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5 - github.com/aws/aws-sdk-go-v2/service/rds v1.68.0 + github.com/aws/aws-sdk-go-v2/service/rds v1.69.0 github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6 github.com/aws/aws-sdk-go-v2/service/rekognition v1.36.0 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.8.6 @@ -108,7 +108,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/signer v1.19.7 github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 - github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 + github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.6 github.com/aws/aws-sdk-go-v2/service/ssmsap v1.10.6 @@ -116,6 +116,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.23.7 github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 github.com/aws/aws-sdk-go-v2/service/swf v1.20.7 + github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7 github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7 github.com/aws/aws-sdk-go-v2/service/transcribe v1.34.6 github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.8.4 @@ -144,10 +145,10 @@ require ( github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.20.0 + github.com/hashicorp/terraform-plugin-go v0.21.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-mux v0.13.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 + github.com/hashicorp/terraform-plugin-mux v0.14.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 github.com/hashicorp/terraform-plugin-testing v1.6.0 github.com/jmespath/go-jmespath v0.4.0 github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 @@ -197,14 +198,14 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-test/deep v1.1.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.1 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/hc-install v0.6.2 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.19.0 // indirect - github.com/hashicorp/terraform-json v0.18.0 // indirect + github.com/hashicorp/terraform-exec v0.20.0 // indirect + github.com/hashicorp/terraform-json v0.21.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect @@ -225,7 +226,7 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/zclconf/go-cty v1.14.1 // indirect + github.com/zclconf/go-cty v1.14.2 // indirect go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect @@ -235,9 +236,9 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/grpc v1.60.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index fe7477cff0d..16d676a07a4 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.50.4 h1:jJNhxunBgfjmCSjMZ3INwQ19ZN3RoGEZfgSCUYF/NZw= -github.com/aws/aws-sdk-go v1.50.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.9 h1:yX66aKnEtRc/uNV/1EH8CudRT5aLwVwcSwTBphuVPt8= +github.com/aws/aws-sdk-go v1.50.9/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs= @@ -94,8 +94,8 @@ github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1 h1:BDHWW50nyoLy github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1/go.mod h1:OZ4SGB6RMu1jyxHM9yX+yAIywcWw9OZwsCC6EG5PSA4= github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6 h1:Tzr3nuVNTKguEPMEu9cdDGjAASoR+XoMOHDrhmG2atc= github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6/go.mod h1:5qbc4CGj/ENoDMH+gTgE/H/hJvV9Xg0tDdWY9HoJ5hs= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6 h1:xlOSMWiXfusvyG9IOH6fOFOySDzYIMw2yIOfln8vmBc= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6/go.mod h1:03K5d5S3ly9rZrTQHQoEnWXLmtzzY5Xx4HG5uKyp9Lo= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7 h1:arB3tNyrdWjv5pbJsb5vGljtWe7EutIU3Y+UXVlC1ks= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7/go.mod h1:03K5d5S3ly9rZrTQHQoEnWXLmtzzY5Xx4HG5uKyp9Lo= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6 h1:MfFyaae+SE1nGKULywO3KiVVUuuFjxRwRVbQ1tlSJms= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6/go.mod h1:KoFh/C/H9h84YVrojYuj6zkaBry/4KtlmOEgv3JDd0Y= github.com/aws/aws-sdk-go-v2/service/connectcases v1.13.0 h1:7838pX/KZ+E1/ljmaye4ObX6Wdg58of9S5W4ATd0xn0= @@ -110,16 +110,16 @@ github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6 h1:wpppmhMV77eFBdjIdNAs github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6/go.mod h1:dv4zBaX4a448iBgvVeXw+UHfE1paAyTLo9Joh4EnHAU= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.7 h1:X60rMbnylU1xmmhv4+/N78t+lKOCC4ELst5eR25dyqg= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.7/go.mod h1:o7TD9sjdgrl8l/g2a2IkYjuhxjPy9DMP2sWo7piaRBQ= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0 h1:SkSW6wtJmXqJJlBxSc+0mykDdv5nhl9xifMB7JuzNVo= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0/go.mod h1:hIsHE0PaWAQakLCshKS7VKWMGXaqrAFp4m95s2W9E6c= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0 h1:d6pYx/CKADORpxqBINY7DuD4V1fjcj3IoeTPQilCw4Q= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0/go.mod h1:hIsHE0PaWAQakLCshKS7VKWMGXaqrAFp4m95s2W9E6c= github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7 h1:3iaT/LnGV6jNtbBkvHZDlzz7Ky3wMHDJAyFtGd5GUJI= github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7/go.mod h1:mtzCLxk6M+KZbkJdq3cUH9GCrudw8qCy5C3EHO+5vLc= github.com/aws/aws-sdk-go-v2/service/eks v1.37.1 h1:5eFw5vlZI2KOChY0DOWxsnuC6N01WC3ZUo5+lco9mN8= github.com/aws/aws-sdk-go-v2/service/eks v1.37.1/go.mod h1:0R62cZb66e+iaJU7jG3GQbenxD8B7kh4UFNZ19pauTA= github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7 h1:hwtXl8SdL8pjEeFLc4Ix2cds8VePvjHgdZsLhycmMnI= github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7/go.mod h1:UbF8L+B9IP3R2ZMZE0CB/zEIas1Ikz6R3l4aKQKTK7M= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7 h1:ystNRv96lPnlDFU/K3O4/erHR+kPaiDbDGi/192uXQ4= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7/go.mod h1:7iQ5nRkEdgQWWOmaA+BBbe1pKX8/sceSO6NSNqVx/vk= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0 h1:r9eCNAMs0C4gjkod/p4dsb+ZMOQAkdjPuin9QUUcjmY= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0/go.mod h1:7iQ5nRkEdgQWWOmaA+BBbe1pKX8/sceSO6NSNqVx/vk= github.com/aws/aws-sdk-go-v2/service/emr v1.36.1 h1:BY0OVsImWvwBKA2hAXF0RIty3PJTVkf2MwNlRgW+/og= github.com/aws/aws-sdk-go-v2/service/emr v1.36.1/go.mod h1:8kM2oNVgOxSUEAY8YjHErdSE3wZE/ImVDKgimJjayMY= github.com/aws/aws-sdk-go-v2/service/emrserverless v1.15.0 h1:/98KUYlSIVnGu/zeBL59uOPgY7gtso3lQI6CdkHIQSM= @@ -136,16 +136,14 @@ github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6 h1:BzVx19YEwGRxXQaUYfRettlY github.com/aws/aws-sdk-go-v2/service/glacier v1.19.6/go.mod h1:YsWnGIsj8i88/LLD4MXfKtebLTQOq3gfKzacGw9FQ5M= github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6 h1:I7iZxQRCMp8ObmMc4ahXjFa36wDgjUw8gsaksA3NWQc= github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6/go.mod h1:1TzSLA29YLrM9NlUXBmoE2GWCzuEsearbtiOW2zfW0g= -github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2 h1:k4l7fTMNB4FVlqC5ca3VWxTT0bg7AEXqj83qWycxEH8= -github.com/aws/aws-sdk-go-v2/service/guardduty v1.36.2/go.mod h1:31DEI66V3IcUtmD4vo1JdOU16YZj/Oy231YGM3fdNFc= github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6 h1:PEdeYJzkwmVLZpTKb5ewEuJGcVYC8kYknzCL0LysKFM= github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6/go.mod h1:WlZEyCR/eaZwl61jp0Dzs++HZgx2HSjXx+GwwFKcYsg= github.com/aws/aws-sdk-go-v2/service/iam v1.28.6 h1:P5oJkH50fc9mKjrzEMtYYCdMBhrbVPQsvlsD3L56Itg= github.com/aws/aws-sdk-go-v2/service/iam v1.28.6/go.mod h1:kKI0gdVsf+Ev9knh/3lBJbchtX5LLNH25lAzx3KDj3Q= github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8 h1:nUPGQCmsMAtmigP2SxTDrPdI0oh/IJ0EJzzA0LOEZ54= github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8/go.mod h1:Ri8aeUocD6fxHviqgxzYvqrQREtD++dXJPAPMBJVESw= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0 h1:pLsFCR509WlYbopPSTYIJ23jeicBbHkV2ic2Nyo0Ghw= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0/go.mod h1:qOx//dGenntPy9C1ISg/Ucp3B8a2A+smcUus+UibYgE= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0 h1:hMb748fEt5OFspPqIe4octMJax2lo6n9lTbwrDLducU= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0/go.mod h1:qOx//dGenntPy9C1ISg/Ucp3B8a2A+smcUus+UibYgE= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8= @@ -178,10 +176,12 @@ github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0 h1:LvWkxBi/bsWHqj3bFTUuDL github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0/go.mod h1:35MKNS46RX7Lb9EIFP2bPy3WrJu+bxU6QgLis8K1aa4= github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6 h1:dVIu7ZKZbSXFlkpFQmAe6fAU1mr2/LxyZwCS4kroQE4= github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6/go.mod h1:KY+JqgxylpGfD8BHH6bhOFrZb2g8M1F6aPifNEurwh8= -github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7 h1:5etXqoLGqO/63wcrEJHhZ42+pA/sTHHT3hsgRGfDfvo= -github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7/go.mod h1:RwwoIKmTLC0noLzjd3V+Tm/zPriuaBXd1/uXmGKIAko= +github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8 h1:9kmgrwc/n0Li722NYY/LBI654hHQFoB7ATYuNrrNQHE= +github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8/go.mod h1:RwwoIKmTLC0noLzjd3V+Tm/zPriuaBXd1/uXmGKIAko= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1 h1:GnROse8mFPn5tiUrcLrSlCl64N3HZoLKVJlnM+1Txzo= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1/go.mod h1:YtYScucFEyg+/50YWZlIt8XjYMTIQbjw6dgz9/UYZXA= +github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0 h1:YrSxGv0Jr3zB1+4Sby9FU7jCGSG/hRZ8ADqGhF7eis0= +github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0/go.mod h1:aCUF5+yUBBaesG5FH67HY4pIYOMJK3UzajdnXSCOFGg= github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1 h1:5iU4di93LKUIUAvcHY9TXR8MvrHKhrOjpL/CINGuV04= github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1/go.mod h1:SITOSt2FpMrkZzTD/8ykcnK0zpbBLcjk/1LUhcU/gzE= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.28.7 h1:vdaaK74RcQKM7Db8GAEqM+J76AR9mhJztLPb+6wYpfQ= @@ -210,8 +210,8 @@ github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6 h1:Fu8Q8SpMvHyBJ1pXxfZK+TRKvut github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6/go.mod h1:ALrxPiMr4joJHef8qO5VMRAfCd9tl51d5/e6oo3V6VU= github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5 h1:oEBvOBtjfFFjkzX71GP4bbuS1FvcKZE/nayh2I9ILCQ= github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5/go.mod h1:Kl5wjv18sTyr0SK+3mGfTFQ1DOJTBlcQnhRg2h7+Xyw= -github.com/aws/aws-sdk-go-v2/service/rds v1.68.0 h1:qvpl0PIyXHVxz53Aw7kdeObSUQ2gpSuqIburDyh0N8w= -github.com/aws/aws-sdk-go-v2/service/rds v1.68.0/go.mod h1:N/ijzTwR4cOG2P8Kvos/QOCetpDTtconhvDOheqnrTw= +github.com/aws/aws-sdk-go-v2/service/rds v1.69.0 h1:vnB7v2ZiKOYOXcu1xamRx9OyPJW9daWXUbysKrY3V/A= +github.com/aws/aws-sdk-go-v2/service/rds v1.69.0/go.mod h1:N/ijzTwR4cOG2P8Kvos/QOCetpDTtconhvDOheqnrTw= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6 h1:8+JMPb5tQaR3a8M4rmyKWOyeb+An4w1qBqNtmrYN3oU= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6/go.mod h1:QjdFj5wqWJFwihR+mv0mUDwz0g477qgDCBCeilHm5V8= github.com/aws/aws-sdk-go-v2/service/rekognition v1.36.0 h1:f6yBPx3emFoTcV1HSuZMYlknA9CpCrm/LU7dUpRZVhY= @@ -250,8 +250,8 @@ github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 h1:DylmW2c1Z7qGxN3Y02k+voPbtM1m github.com/aws/aws-sdk-go-v2/service/sns v1.26.7/go.mod h1:mLFiISZfiZAqZEfPWUsZBK8gD4dYCKuKAfapV+KrIVQ= github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 h1:tRNrFDGRm81e6nTX5Q4CFblea99eAfm0dxXazGpLceU= github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7/go.mod h1:8GWUDux5Z2h6z2efAtr54RdHXtLm8sq7Rg85ZNY/CZM= -github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 h1:a8HvP/+ew3tKwSXqL3BCSjiuicr+XTU2eFYeogV9GJE= -github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM= +github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0 h1:IOdss+igJDFdic9w3WKwxGCmHqUxydvIhJOm9LJ32Dk= +github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6 h1:fdJMvGYluIJlX52nPoB7on8AD6cN+jLzqyRV53zTABg= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6/go.mod h1:5KTIrjpJ6y4BknMvHuHx8nYoyXSQrEMlJ4LZLKfiWis= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.6 h1:hktXRWX0E8hbbJOjju6YcvuPNv/YM3tvjyzptlU0fIA= @@ -268,6 +268,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGz github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U= github.com/aws/aws-sdk-go-v2/service/swf v1.20.7 h1:Tq3SyI52JByer7RDjBV/D2sJ0Wl1FXK5Fu2atTlHl9g= github.com/aws/aws-sdk-go-v2/service/swf v1.20.7/go.mod h1:RaUPSwU6VmfmhBX33lTvcwmlPZXEX5KOjyj1rgmuP1Q= +github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7 h1:YhRDOSThHu2MwhYfByxY1q9iIRW7LR49U4zaJrkh3WQ= +github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7/go.mod h1:IiywQMsyhXIQhzYHoFG0YnF78ZN6OuSWRCzc4vYCZyc= github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7 h1:5aeaLIUYE0PJKajl9E4ZMEx8+IKWIR5znEscda7t9kc= github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7/go.mod h1:v1cLeowZxJZe0yv6lEqj3nUZ8FVoBu2sLLhb8gcdcQ0= github.com/aws/aws-sdk-go-v2/service/transcribe v1.34.6 h1:2i4Fk0oOHFZYuzE1edTySCj/iPpV1TUvBsMQlcBjXRc= @@ -336,8 +338,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0 h1:IUypt/TbXiJBkBbE3926CgnjD8IltAitdn7Yive61DY= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0/go.mod h1:cdTE6F2pCKQobug+RqRaQp7Kz9hIEqiSvpPmb6E5G1w= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.46 h1:4HEbsW1qG5LQubjhlEwyCq4bEyvG+XvwYGYQ/PAtIP8= @@ -376,10 +378,10 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= -github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= -github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= -github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 h1:b8vZYB/SkXJT4YPbT3trzE6oJ7dPyMy68+9dEDKsJjE= @@ -388,12 +390,12 @@ github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaK github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= -github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= -github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= -github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 h1:Bl3e2ei2j/Z3Hc2HIS15Gal2KMKyLAZ2om1HCEvK6es= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0/go.mod h1:i2C41tszDjiWfziPQDL5R/f3Zp0gahXe5No/MIO9rCE= +github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= +github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= +github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= +github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= github.com/hashicorp/terraform-plugin-testing v1.6.0 h1:Wsnfh+7XSVRfwcr2jZYHsnLOnZl7UeaOBvsx6dl/608= github.com/hashicorp/terraform-plugin-testing v1.6.0/go.mod h1:cJGG0/8j9XhHaJZRC+0sXFI4uzqQZ9Az4vh6C4GJpFE= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= @@ -497,8 +499,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= -github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= +github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1 h1:PGmSzEMllKQwBQHe9SERAsCytvgLhsb8OrRLeW+40xw= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1/go.mod h1:h0dNRrQsnnlMonPE/+FXrXtDYZEyZSTaIOfs+n8P/RQ= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= @@ -533,7 +535,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -578,14 +580,14 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From c5d77cfbf16629730f208fe2ba346258d2c7b3df Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Mon, 5 Feb 2024 09:12:53 +0200 Subject: [PATCH 5/6] revert go.mod and go.sum --- go.mod | 38 ++++++++++++++-------------- go.sum | 78 ++++++++++++++++++++++++++++------------------------------ 2 files changed, 55 insertions(+), 61 deletions(-) diff --git a/go.mod b/go.mod index ad28b281097..06025b5a6b6 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c github.com/YakDriver/regexache v0.23.0 - github.com/aws/aws-sdk-go v1.50.9 + github.com/aws/aws-sdk-go v1.50.4 github.com/aws/aws-sdk-go-v2 v1.24.1 github.com/aws/aws-sdk-go-v2/config v1.26.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 @@ -37,18 +37,18 @@ require ( github.com/aws/aws-sdk-go-v2/service/codepipeline v1.22.6 github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1 github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6 - github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7 + github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6 github.com/aws/aws-sdk-go-v2/service/connectcases v1.13.0 github.com/aws/aws-sdk-go-v2/service/controltower v1.10.7 github.com/aws/aws-sdk-go-v2/service/customerprofiles v1.34.6 github.com/aws/aws-sdk-go-v2/service/directoryservice v1.22.8 github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0 github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7 github.com/aws/aws-sdk-go-v2/service/eks v1.37.1 github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7 github.com/aws/aws-sdk-go-v2/service/emr v1.36.1 github.com/aws/aws-sdk-go-v2/service/emrserverless v1.15.0 github.com/aws/aws-sdk-go-v2/service/evidently v1.17.0 @@ -59,7 +59,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/groundstation v1.23.6 github.com/aws/aws-sdk-go-v2/service/healthlake v1.20.6 github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8 - github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0 + github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0 github.com/aws/aws-sdk-go-v2/service/internetmonitor v1.10.7 github.com/aws/aws-sdk-go-v2/service/ivschat v1.10.6 github.com/aws/aws-sdk-go-v2/service/kafka v1.28.6 @@ -71,9 +71,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/lexmodelsv2 v1.38.6 github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0 github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6 - github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8 + github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7 github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1 - github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0 github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1 github.com/aws/aws-sdk-go-v2/service/mediapackage v1.28.7 github.com/aws/aws-sdk-go-v2/service/mediapackagev2 v1.7.7 @@ -88,7 +87,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/qbusiness v1.1.7 github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6 github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5 - github.com/aws/aws-sdk-go-v2/service/rds v1.69.0 + github.com/aws/aws-sdk-go-v2/service/rds v1.68.0 github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6 github.com/aws/aws-sdk-go-v2/service/rekognition v1.36.0 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.8.6 @@ -108,7 +107,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/signer v1.19.7 github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 - github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0 + github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.6 github.com/aws/aws-sdk-go-v2/service/ssmsap v1.10.6 @@ -116,7 +115,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssoadmin v1.23.7 github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 github.com/aws/aws-sdk-go-v2/service/swf v1.20.7 - github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7 github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7 github.com/aws/aws-sdk-go-v2/service/transcribe v1.34.6 github.com/aws/aws-sdk-go-v2/service/verifiedpermissions v1.8.4 @@ -145,10 +143,10 @@ require ( github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 - github.com/hashicorp/terraform-plugin-go v0.21.0 + github.com/hashicorp/terraform-plugin-go v0.20.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-mux v0.14.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 + github.com/hashicorp/terraform-plugin-mux v0.13.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 github.com/hashicorp/terraform-plugin-testing v1.6.0 github.com/jmespath/go-jmespath v0.4.0 github.com/mattbaird/jsonpatch v0.0.0-20230413205102-771768614e91 @@ -198,14 +196,14 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-test/deep v1.1.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/hc-install v0.6.2 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.20.0 // indirect - github.com/hashicorp/terraform-json v0.21.0 // indirect + github.com/hashicorp/terraform-exec v0.19.0 // indirect + github.com/hashicorp/terraform-json v0.18.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect @@ -226,7 +224,7 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/zclconf/go-cty v1.14.2 // indirect + github.com/zclconf/go-cty v1.14.1 // indirect go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect @@ -236,9 +234,9 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/grpc v1.61.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect + google.golang.org/grpc v1.60.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 16d676a07a4..0871043f946 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.50.9 h1:yX66aKnEtRc/uNV/1EH8CudRT5aLwVwcSwTBphuVPt8= -github.com/aws/aws-sdk-go v1.50.9/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.4 h1:jJNhxunBgfjmCSjMZ3INwQ19ZN3RoGEZfgSCUYF/NZw= +github.com/aws/aws-sdk-go v1.50.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs= @@ -94,8 +94,8 @@ github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1 h1:BDHWW50nyoLy github.com/aws/aws-sdk-go-v2/service/codestarconnections v1.22.1/go.mod h1:OZ4SGB6RMu1jyxHM9yX+yAIywcWw9OZwsCC6EG5PSA4= github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6 h1:Tzr3nuVNTKguEPMEu9cdDGjAASoR+XoMOHDrhmG2atc= github.com/aws/aws-sdk-go-v2/service/codestarnotifications v1.20.6/go.mod h1:5qbc4CGj/ENoDMH+gTgE/H/hJvV9Xg0tDdWY9HoJ5hs= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7 h1:arB3tNyrdWjv5pbJsb5vGljtWe7EutIU3Y+UXVlC1ks= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.7/go.mod h1:03K5d5S3ly9rZrTQHQoEnWXLmtzzY5Xx4HG5uKyp9Lo= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6 h1:xlOSMWiXfusvyG9IOH6fOFOySDzYIMw2yIOfln8vmBc= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.29.6/go.mod h1:03K5d5S3ly9rZrTQHQoEnWXLmtzzY5Xx4HG5uKyp9Lo= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6 h1:MfFyaae+SE1nGKULywO3KiVVUuuFjxRwRVbQ1tlSJms= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.31.6/go.mod h1:KoFh/C/H9h84YVrojYuj6zkaBry/4KtlmOEgv3JDd0Y= github.com/aws/aws-sdk-go-v2/service/connectcases v1.13.0 h1:7838pX/KZ+E1/ljmaye4ObX6Wdg58of9S5W4ATd0xn0= @@ -110,16 +110,16 @@ github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6 h1:wpppmhMV77eFBdjIdNAs github.com/aws/aws-sdk-go-v2/service/docdbelastic v1.6.6/go.mod h1:dv4zBaX4a448iBgvVeXw+UHfE1paAyTLo9Joh4EnHAU= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.7 h1:X60rMbnylU1xmmhv4+/N78t+lKOCC4ELst5eR25dyqg= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.26.7/go.mod h1:o7TD9sjdgrl8l/g2a2IkYjuhxjPy9DMP2sWo7piaRBQ= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0 h1:d6pYx/CKADORpxqBINY7DuD4V1fjcj3IoeTPQilCw4Q= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.146.0/go.mod h1:hIsHE0PaWAQakLCshKS7VKWMGXaqrAFp4m95s2W9E6c= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0 h1:SkSW6wtJmXqJJlBxSc+0mykDdv5nhl9xifMB7JuzNVo= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.145.0/go.mod h1:hIsHE0PaWAQakLCshKS7VKWMGXaqrAFp4m95s2W9E6c= github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7 h1:3iaT/LnGV6jNtbBkvHZDlzz7Ky3wMHDJAyFtGd5GUJI= github.com/aws/aws-sdk-go-v2/service/ecr v1.24.7/go.mod h1:mtzCLxk6M+KZbkJdq3cUH9GCrudw8qCy5C3EHO+5vLc= github.com/aws/aws-sdk-go-v2/service/eks v1.37.1 h1:5eFw5vlZI2KOChY0DOWxsnuC6N01WC3ZUo5+lco9mN8= github.com/aws/aws-sdk-go-v2/service/eks v1.37.1/go.mod h1:0R62cZb66e+iaJU7jG3GQbenxD8B7kh4UFNZ19pauTA= github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7 h1:hwtXl8SdL8pjEeFLc4Ix2cds8VePvjHgdZsLhycmMnI= github.com/aws/aws-sdk-go-v2/service/elasticache v1.34.7/go.mod h1:UbF8L+B9IP3R2ZMZE0CB/zEIas1Ikz6R3l4aKQKTK7M= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0 h1:r9eCNAMs0C4gjkod/p4dsb+ZMOQAkdjPuin9QUUcjmY= -github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.27.0/go.mod h1:7iQ5nRkEdgQWWOmaA+BBbe1pKX8/sceSO6NSNqVx/vk= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7 h1:ystNRv96lPnlDFU/K3O4/erHR+kPaiDbDGi/192uXQ4= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.26.7/go.mod h1:7iQ5nRkEdgQWWOmaA+BBbe1pKX8/sceSO6NSNqVx/vk= github.com/aws/aws-sdk-go-v2/service/emr v1.36.1 h1:BY0OVsImWvwBKA2hAXF0RIty3PJTVkf2MwNlRgW+/og= github.com/aws/aws-sdk-go-v2/service/emr v1.36.1/go.mod h1:8kM2oNVgOxSUEAY8YjHErdSE3wZE/ImVDKgimJjayMY= github.com/aws/aws-sdk-go-v2/service/emrserverless v1.15.0 h1:/98KUYlSIVnGu/zeBL59uOPgY7gtso3lQI6CdkHIQSM= @@ -142,8 +142,8 @@ github.com/aws/aws-sdk-go-v2/service/iam v1.28.6 h1:P5oJkH50fc9mKjrzEMtYYCdMBhrb github.com/aws/aws-sdk-go-v2/service/iam v1.28.6/go.mod h1:kKI0gdVsf+Ev9knh/3lBJbchtX5LLNH25lAzx3KDj3Q= github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8 h1:nUPGQCmsMAtmigP2SxTDrPdI0oh/IJ0EJzzA0LOEZ54= github.com/aws/aws-sdk-go-v2/service/identitystore v1.21.8/go.mod h1:Ri8aeUocD6fxHviqgxzYvqrQREtD++dXJPAPMBJVESw= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0 h1:hMb748fEt5OFspPqIe4octMJax2lo6n9lTbwrDLducU= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.22.0/go.mod h1:qOx//dGenntPy9C1ISg/Ucp3B8a2A+smcUus+UibYgE= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0 h1:pLsFCR509WlYbopPSTYIJ23jeicBbHkV2ic2Nyo0Ghw= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.21.0/go.mod h1:qOx//dGenntPy9C1ISg/Ucp3B8a2A+smcUus+UibYgE= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8= @@ -176,12 +176,10 @@ github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0 h1:LvWkxBi/bsWHqj3bFTUuDL github.com/aws/aws-sdk-go-v2/service/lightsail v1.34.0/go.mod h1:35MKNS46RX7Lb9EIFP2bPy3WrJu+bxU6QgLis8K1aa4= github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6 h1:dVIu7ZKZbSXFlkpFQmAe6fAU1mr2/LxyZwCS4kroQE4= github.com/aws/aws-sdk-go-v2/service/lookoutmetrics v1.25.6/go.mod h1:KY+JqgxylpGfD8BHH6bhOFrZb2g8M1F6aPifNEurwh8= -github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8 h1:9kmgrwc/n0Li722NYY/LBI654hHQFoB7ATYuNrrNQHE= -github.com/aws/aws-sdk-go-v2/service/m2 v1.10.8/go.mod h1:RwwoIKmTLC0noLzjd3V+Tm/zPriuaBXd1/uXmGKIAko= +github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7 h1:5etXqoLGqO/63wcrEJHhZ42+pA/sTHHT3hsgRGfDfvo= +github.com/aws/aws-sdk-go-v2/service/m2 v1.10.7/go.mod h1:RwwoIKmTLC0noLzjd3V+Tm/zPriuaBXd1/uXmGKIAko= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1 h1:GnROse8mFPn5tiUrcLrSlCl64N3HZoLKVJlnM+1Txzo= github.com/aws/aws-sdk-go-v2/service/mediaconnect v1.25.1/go.mod h1:YtYScucFEyg+/50YWZlIt8XjYMTIQbjw6dgz9/UYZXA= -github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0 h1:YrSxGv0Jr3zB1+4Sby9FU7jCGSG/hRZ8ADqGhF7eis0= -github.com/aws/aws-sdk-go-v2/service/mediaconvert v1.50.0/go.mod h1:aCUF5+yUBBaesG5FH67HY4pIYOMJK3UzajdnXSCOFGg= github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1 h1:5iU4di93LKUIUAvcHY9TXR8MvrHKhrOjpL/CINGuV04= github.com/aws/aws-sdk-go-v2/service/medialive v1.44.1/go.mod h1:SITOSt2FpMrkZzTD/8ykcnK0zpbBLcjk/1LUhcU/gzE= github.com/aws/aws-sdk-go-v2/service/mediapackage v1.28.7 h1:vdaaK74RcQKM7Db8GAEqM+J76AR9mhJztLPb+6wYpfQ= @@ -210,8 +208,8 @@ github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6 h1:Fu8Q8SpMvHyBJ1pXxfZK+TRKvut github.com/aws/aws-sdk-go-v2/service/qldb v1.19.6/go.mod h1:ALrxPiMr4joJHef8qO5VMRAfCd9tl51d5/e6oo3V6VU= github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5 h1:oEBvOBtjfFFjkzX71GP4bbuS1FvcKZE/nayh2I9ILCQ= github.com/aws/aws-sdk-go-v2/service/rbin v1.14.5/go.mod h1:Kl5wjv18sTyr0SK+3mGfTFQ1DOJTBlcQnhRg2h7+Xyw= -github.com/aws/aws-sdk-go-v2/service/rds v1.69.0 h1:vnB7v2ZiKOYOXcu1xamRx9OyPJW9daWXUbysKrY3V/A= -github.com/aws/aws-sdk-go-v2/service/rds v1.69.0/go.mod h1:N/ijzTwR4cOG2P8Kvos/QOCetpDTtconhvDOheqnrTw= +github.com/aws/aws-sdk-go-v2/service/rds v1.68.0 h1:qvpl0PIyXHVxz53Aw7kdeObSUQ2gpSuqIburDyh0N8w= +github.com/aws/aws-sdk-go-v2/service/rds v1.68.0/go.mod h1:N/ijzTwR4cOG2P8Kvos/QOCetpDTtconhvDOheqnrTw= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6 h1:8+JMPb5tQaR3a8M4rmyKWOyeb+An4w1qBqNtmrYN3oU= github.com/aws/aws-sdk-go-v2/service/redshiftdata v1.23.6/go.mod h1:QjdFj5wqWJFwihR+mv0mUDwz0g477qgDCBCeilHm5V8= github.com/aws/aws-sdk-go-v2/service/rekognition v1.36.0 h1:f6yBPx3emFoTcV1HSuZMYlknA9CpCrm/LU7dUpRZVhY= @@ -250,8 +248,8 @@ github.com/aws/aws-sdk-go-v2/service/sns v1.26.7 h1:DylmW2c1Z7qGxN3Y02k+voPbtM1m github.com/aws/aws-sdk-go-v2/service/sns v1.26.7/go.mod h1:mLFiISZfiZAqZEfPWUsZBK8gD4dYCKuKAfapV+KrIVQ= github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7 h1:tRNrFDGRm81e6nTX5Q4CFblea99eAfm0dxXazGpLceU= github.com/aws/aws-sdk-go-v2/service/sqs v1.29.7/go.mod h1:8GWUDux5Z2h6z2efAtr54RdHXtLm8sq7Rg85ZNY/CZM= -github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0 h1:IOdss+igJDFdic9w3WKwxGCmHqUxydvIhJOm9LJ32Dk= -github.com/aws/aws-sdk-go-v2/service/ssm v1.45.0/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM= +github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 h1:a8HvP/+ew3tKwSXqL3BCSjiuicr+XTU2eFYeogV9GJE= +github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6 h1:fdJMvGYluIJlX52nPoB7on8AD6cN+jLzqyRV53zTABg= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.20.6/go.mod h1:5KTIrjpJ6y4BknMvHuHx8nYoyXSQrEMlJ4LZLKfiWis= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.27.6 h1:hktXRWX0E8hbbJOjju6YcvuPNv/YM3tvjyzptlU0fIA= @@ -268,8 +266,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGz github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U= github.com/aws/aws-sdk-go-v2/service/swf v1.20.7 h1:Tq3SyI52JByer7RDjBV/D2sJ0Wl1FXK5Fu2atTlHl9g= github.com/aws/aws-sdk-go-v2/service/swf v1.20.7/go.mod h1:RaUPSwU6VmfmhBX33lTvcwmlPZXEX5KOjyj1rgmuP1Q= -github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7 h1:YhRDOSThHu2MwhYfByxY1q9iIRW7LR49U4zaJrkh3WQ= -github.com/aws/aws-sdk-go-v2/service/synthetics v1.22.7/go.mod h1:IiywQMsyhXIQhzYHoFG0YnF78ZN6OuSWRCzc4vYCZyc= github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7 h1:5aeaLIUYE0PJKajl9E4ZMEx8+IKWIR5znEscda7t9kc= github.com/aws/aws-sdk-go-v2/service/timestreamwrite v1.23.7/go.mod h1:v1cLeowZxJZe0yv6lEqj3nUZ8FVoBu2sLLhb8gcdcQ0= github.com/aws/aws-sdk-go-v2/service/transcribe v1.34.6 h1:2i4Fk0oOHFZYuzE1edTySCj/iPpV1TUvBsMQlcBjXRc= @@ -338,8 +334,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0 h1:IUypt/TbXiJBkBbE3926CgnjD8IltAitdn7Yive61DY= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.21.0/go.mod h1:cdTE6F2pCKQobug+RqRaQp7Kz9hIEqiSvpPmb6E5G1w= github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.46 h1:4HEbsW1qG5LQubjhlEwyCq4bEyvG+XvwYGYQ/PAtIP8= @@ -378,10 +374,10 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= -github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= -github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= -github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM= +github.com/hashicorp/terraform-exec v0.19.0/go.mod h1:tbxUpe3JKruE9Cuf65mycSIT8KiNPZ0FkuTE3H4urQg= +github.com/hashicorp/terraform-json v0.18.0 h1:pCjgJEqqDESv4y0Tzdqfxr/edOIGkjs8keY42xfNBwU= +github.com/hashicorp/terraform-json v0.18.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= github.com/hashicorp/terraform-plugin-framework-jsontypes v0.1.0 h1:b8vZYB/SkXJT4YPbT3trzE6oJ7dPyMy68+9dEDKsJjE= @@ -390,12 +386,12 @@ github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaK github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= -github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= -github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= -github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= -github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= +github.com/hashicorp/terraform-plugin-go v0.20.0 h1:oqvoUlL+2EUbKNsJbIt3zqqZ7wi6lzn4ufkn/UA51xQ= +github.com/hashicorp/terraform-plugin-go v0.20.0/go.mod h1:Rr8LBdMlY53a3Z/HpP+ZU3/xCDqtKNCkeI9qOyT10QE= +github.com/hashicorp/terraform-plugin-mux v0.13.0 h1:79U401/3nd8CWwDGtTHc8F3miSCAS9XGtVarxSTDgwA= +github.com/hashicorp/terraform-plugin-mux v0.13.0/go.mod h1:Ndv0FtwDG2ogzH59y64f2NYimFJ6I0smRgFUKfm6dyQ= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 h1:Bl3e2ei2j/Z3Hc2HIS15Gal2KMKyLAZ2om1HCEvK6es= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0/go.mod h1:i2C41tszDjiWfziPQDL5R/f3Zp0gahXe5No/MIO9rCE= github.com/hashicorp/terraform-plugin-testing v1.6.0 h1:Wsnfh+7XSVRfwcr2jZYHsnLOnZl7UeaOBvsx6dl/608= github.com/hashicorp/terraform-plugin-testing v1.6.0/go.mod h1:cJGG0/8j9XhHaJZRC+0sXFI4uzqQZ9Az4vh6C4GJpFE= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= @@ -499,8 +495,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1: github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= -github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1 h1:PGmSzEMllKQwBQHe9SERAsCytvgLhsb8OrRLeW+40xw= go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.46.1/go.mod h1:h0dNRrQsnnlMonPE/+FXrXtDYZEyZSTaIOfs+n8P/RQ= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= @@ -535,7 +531,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -580,14 +576,14 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= +google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From c17dc62314e3b04b15a0dc8b7f1dbd28b723477b Mon Sep 17 00:00:00 2001 From: Petri Autero Date: Fri, 7 Jun 2024 23:10:07 +0300 Subject: [PATCH 6/6] re-gen clients --- .../guardduty/service_endpoints_gen_test.go | 170 +++++++++++++++--- .../service/guardduty/service_package_gen.go | 10 +- names/data/names_data.csv | 2 +- 3 files changed, 157 insertions(+), 25 deletions(-) diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 8dfd48daf27..7c50f087414 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -4,17 +4,22 @@ package guardduty_test import ( "context" + "errors" "fmt" "maps" - "net/url" "os" "path/filepath" + "reflect" "strings" "testing" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + guardduty_sdkv2 "github.com/aws/aws-sdk-go-v2/service/guardduty" aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" guardduty_sdkv1 "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -229,52 +234,88 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S }, } - for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv - testcase := testcase + t.Run("v1", func(t *testing.T) { + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + testcase := testcase - t.Run(name, func(t *testing.T) { - testEndpointCase(t, providerRegion, testcase, callService) - }) - } + t.Run(name, func(t *testing.T) { + testEndpointCase(t, providerRegion, testcase, callServiceV1) + }) + } + }) + + t.Run("v2", func(t *testing.T) { + for name, testcase := range testcases { //nolint:paralleltest // uses t.Setenv + testcase := testcase + + t.Run(name, func(t *testing.T) { + testEndpointCase(t, providerRegion, testcase, callServiceV2) + }) + } + }) } func defaultEndpoint(region string) string { - r := endpoints.DefaultResolver() + r := guardduty_sdkv2.NewDefaultEndpointResolverV2() - ep, err := r.EndpointFor(guardduty_sdkv1.EndpointsID, region) + ep, err := r.ResolveEndpoint(context.Background(), guardduty_sdkv2.EndpointParameters{ + Region: aws_sdkv2.String(region), + }) if err != nil { return err.Error() } - url, _ := url.Parse(ep.URL) - - if url.Path == "" { - url.Path = "/" + if ep.URI.Path == "" { + ep.URI.Path = "/" } - return url.String() + return ep.URI.String() } func defaultFIPSEndpoint(region string) string { - r := endpoints.DefaultResolver() + r := guardduty_sdkv2.NewDefaultEndpointResolverV2() - ep, err := r.EndpointFor(guardduty_sdkv1.EndpointsID, region, func(opt *endpoints.Options) { - opt.UseFIPSEndpoint = endpoints.FIPSEndpointStateEnabled + ep, err := r.ResolveEndpoint(context.Background(), guardduty_sdkv2.EndpointParameters{ + Region: aws_sdkv2.String(region), + UseFIPS: aws_sdkv2.Bool(true), }) if err != nil { return err.Error() } - url, _ := url.Parse(ep.URL) + if ep.URI.Path == "" { + ep.URI.Path = "/" + } + + return ep.URI.String() +} - if url.Path == "" { - url.Path = "/" +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { + t.Helper() + + client := meta.GuardDutyClient(ctx) + + var result apiCallParams + + _, err := client.ListDetectors(ctx, &guardduty_sdkv2.ListDetectorsInput{}, + func(opts *guardduty_sdkv2.Options) { + opts.APIOptions = append(opts.APIOptions, + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), + addCancelRequestMiddleware(), + ) + }, + ) + if err == nil { + t.Fatal("Expected an error, got none") + } else if !errors.Is(err, errCancelOperation) { + t.Fatalf("Unexpected error: %s", err) } - return url.String() + return result } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GuardDutyConn(ctx) @@ -443,6 +484,89 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca } } +func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + retrieveEndpointURLMiddleware(t, endpoint), + middleware.After, + ) + } +} + +func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Retrieve Endpoint", + func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + t.Helper() + + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) + } + + url := request.URL + url.RawQuery = "" + url.Path = "/" + + *endpoint = url.String() + + return next.HandleFinalize(ctx, in) + }) +} + +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + +var errCancelOperation = fmt.Errorf("Test: Canceling request") + +func addCancelRequestMiddleware() func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Finalize.Add( + cancelRequestMiddleware(), + middleware.After, + ) + } +} + +// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it +func cancelRequestMiddleware() middleware.FinalizeMiddleware { + return middleware.FinalizeMiddlewareFunc( + "Test: Cancel Requests", + func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { + return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation + }) +} + +func fullTypeName(i interface{}) string { + return fullValueTypeName(reflect.ValueOf(i)) +} + +func fullValueTypeName(v reflect.Value) string { + if v.Kind() == reflect.Ptr { + return "*" + fullValueTypeName(reflect.Indirect(v)) + } + + requestType := v.Type() + return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) +} + func generateSharedConfigFile(config configFile) string { var buf strings.Builder diff --git a/internal/service/guardduty/service_package_gen.go b/internal/service/guardduty/service_package_gen.go index e1aa408876d..ff5f3811217 100644 --- a/internal/service/guardduty/service_package_gen.go +++ b/internal/service/guardduty/service_package_gen.go @@ -144,8 +144,16 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws_sdkv2.Config)) return guardduty_sdkv2.NewFromConfig(cfg, func(o *guardduty_sdkv2.Options) { - if endpoint := config["endpoint"].(string); endpoint != "" { + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { + tflog.Debug(ctx, "setting endpoint", map[string]any{ + "tf_aws.endpoint": endpoint, + }) o.BaseEndpoint = aws_sdkv2.String(endpoint) + + if o.EndpointOptions.UseFIPSEndpoint == aws_sdkv2.FIPSEndpointStateEnabled { + tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") + o.EndpointOptions.UseFIPSEndpoint = aws_sdkv2.FIPSEndpointStateDisabled + } } }), nil } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index da7ff7f9837..92f32462a8c 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -175,7 +175,7 @@ globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globala glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,,, databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,,, groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,,, -guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,,, +guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,2,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,,, health,health,health,health,,health,,,Health,Health,,1,,,aws_health_,,health_,Health,AWS,,x,,,,,Health,,,, healthlake,healthlake,healthlake,healthlake,,healthlake,,,HealthLake,HealthLake,,,2,,aws_healthlake_,,healthlake_,HealthLake,Amazon,,,,,,,HealthLake,ListFHIRDatastores,,, honeycode,honeycode,honeycode,honeycode,,honeycode,,,Honeycode,Honeycode,,1,,,aws_honeycode_,,honeycode_,Honeycode,Amazon,,x,,,,,Honeycode,,,,