From 5dab06e2f763ed081f1f01730890309c22d7171c Mon Sep 17 00:00:00 2001 From: atsushi-ishibashi Date: Wed, 8 Jun 2022 12:29:54 +0900 Subject: [PATCH 001/304] remove default value from propagate_tags --- internal/service/events/target.go | 5 ++- internal/service/events/target_test.go | 50 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/internal/service/events/target.go b/internal/service/events/target.go index edeabbd2063f..29a9c95cba29 100644 --- a/internal/service/events/target.go +++ b/internal/service/events/target.go @@ -232,8 +232,7 @@ func ResourceTarget() *schema.Resource { "propagate_tags": { Type: schema.TypeString, Optional: true, - Default: eventbridge.PropagateTagsTaskDefinition, - ValidateFunc: validation.StringInSlice(eventbridge.PropagateTags_Values(), false), + ValidateFunc: validation.StringInSlice(append(eventbridge.PropagateTags_Values(), ""), false), }, "tags": tftags.TagsSchema(), "task_count": { @@ -718,7 +717,7 @@ func expandTargetECSParameters(config []interface{}) *eventbridge.EcsParameters ecsParameters.PlacementConstraints = expandTargetPlacementConstraints(v.List()) } - if v, ok := param["propagate_tags"].(string); ok { + if v, ok := param["propagate_tags"].(string); ok && v != "" { ecsParameters.PropagateTags = aws.String(v) } diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index 9dba5f7105c3..0c7a5f33151c 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -674,6 +674,37 @@ func TestAccEventsTarget_ecsFull(t *testing.T) { }) } +func TestAccEventsTarget_ecs_noPropagateTags(t *testing.T) { + resourceName := "aws_cloudwatch_event_target.test" + var v eventbridge.Target + rName := sdkacctest.RandomWithPrefix("tf_ecs_target") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), + ProviderFactories: acctest.ProviderFactories, + CheckDestroy: testAccCheckTargetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccTargetECSWithNoPropagateTagsConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckTargetExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "ecs_target.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ecs_target.0.task_count", "1"), + resource.TestCheckResourceAttr(resourceName, "ecs_target.0.launch_type", "FARGATE"), + resource.TestCheckResourceAttr(resourceName, "ecs_target.0.propagate_tags", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccTargetImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + func TestAccEventsTarget_batch(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" batchJobDefinitionResourceName := "aws_batch_job_definition.test" @@ -1668,6 +1699,25 @@ resource "aws_cloudwatch_event_target" "test" { ` } +func testAccTargetECSWithNoPropagateTagsConfig(rName string) string { + return testAccTargetECSBaseConfig(rName) + ` +resource "aws_cloudwatch_event_target" "test" { + arn = aws_ecs_cluster.test.id + rule = aws_cloudwatch_event_rule.test.id + role_arn = aws_iam_role.test.arn + + ecs_target { + task_definition_arn = aws_ecs_task_definition.task.arn + launch_type = "FARGATE" + + network_configuration { + subnets = [aws_subnet.subnet.id] + } + } +} +` +} + func testAccTargetBatchConfig(rName string) string { return fmt.Sprintf(` resource "aws_cloudwatch_event_rule" "test" { From de164b4767b70f01021973c573bd72a735aa6562 Mon Sep 17 00:00:00 2001 From: atsushi-ishibashi Date: Wed, 8 Jun 2022 12:39:52 +0900 Subject: [PATCH 002/304] acctest fmt --- internal/service/events/target_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index 0c7a5f33151c..7ebdd145d68b 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -1707,8 +1707,8 @@ resource "aws_cloudwatch_event_target" "test" { role_arn = aws_iam_role.test.arn ecs_target { - task_definition_arn = aws_ecs_task_definition.task.arn - launch_type = "FARGATE" + task_definition_arn = aws_ecs_task_definition.task.arn + launch_type = "FARGATE" network_configuration { subnets = [aws_subnet.subnet.id] From b0fb9789c339054cac7ef2752d1f5b2b8c731cfb Mon Sep 17 00:00:00 2001 From: atsushi-ishibashi Date: Wed, 22 Jun 2022 23:13:51 +0900 Subject: [PATCH 003/304] follow name rule --- internal/service/events/target_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index b54d07c5b1f6..b2699039146f 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -674,7 +674,7 @@ func TestAccEventsTarget_ecsFull(t *testing.T) { }) } -func TestAccEventsTarget_ecs_noPropagateTags(t *testing.T) { +func TestAccEventsTarget_ecsNoPropagateTags(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" var v eventbridge.Target rName := sdkacctest.RandomWithPrefix("tf_ecs_target") @@ -686,7 +686,7 @@ func TestAccEventsTarget_ecs_noPropagateTags(t *testing.T) { CheckDestroy: testAccCheckTargetDestroy, Steps: []resource.TestStep{ { - Config: testAccTargetECSWithNoPropagateTagsConfig(rName), + Config: testAccTargetConfig_ecsNoPropagateTags(rName), Check: resource.ComposeTestCheckFunc( testAccCheckTargetExists(resourceName, &v), resource.TestCheckResourceAttr(resourceName, "ecs_target.#", "1"), @@ -1699,7 +1699,7 @@ resource "aws_cloudwatch_event_target" "test" { ` } -func testAccTargetECSWithNoPropagateTagsConfig(rName string) string { +func testAccTargetConfig_ecsNoPropagateTags(rName string) string { return testAccTargetECSBaseConfig(rName) + ` resource "aws_cloudwatch_event_target" "test" { arn = aws_ecs_cluster.test.id From 0fd9738cf64ffc75f1c116d17b9a03c3080346c0 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Thu, 22 Dec 2022 14:35:24 -0700 Subject: [PATCH 004/304] Omit Sid in aws_iam_policy_document data source when empty Because it isn't necessary, and including it when empty just makes the policies bigger. I think this fixes #28537 --- .../service/iam/policy_document_data_source_test.go | 11 ----------- internal/service/iam/policy_model.go | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index 643bde2f0f51..66f79a2c881c 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -524,7 +524,6 @@ func testAccPolicyDocumentExpectedJSON() string { "Resource": "arn:%[1]s:s3:::*" }, { - "Sid": "", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:%[1]s:s3:::foo", @@ -542,7 +541,6 @@ func testAccPolicyDocumentExpectedJSON() string { } }, { - "Sid": "", "Effect": "Allow", "Action": "s3:*", "Resource": [ @@ -554,13 +552,11 @@ func testAccPolicyDocumentExpectedJSON() string { } }, { - "Sid": "", "Effect": "Deny", "NotAction": "s3:*", "NotResource": "arn:%[1]s:s3:::*" }, { - "Sid": "", "Effect": "Allow", "Action": "kinesis:*", "Principal": { @@ -568,7 +564,6 @@ func testAccPolicyDocumentExpectedJSON() string { } }, { - "Sid": "", "Effect": "Allow", "Action": "firehose:*", "Principal": "*" @@ -604,7 +599,6 @@ const testAccPolicyDocumentConfig_SingleConditionValue_ExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Deny", "Action": "elasticfilesystem:*", "Resource": "*", @@ -735,7 +729,6 @@ func testAccPolicyDocumentSourceExpectedJSON() string { "Resource": "arn:%[1]s:s3:::*" }, { - "Sid": "", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:%[1]s:s3:::foo", @@ -752,7 +745,6 @@ func testAccPolicyDocumentSourceExpectedJSON() string { } }, { - "Sid": "", "Effect": "Allow", "Action": "s3:*", "Resource": [ @@ -767,13 +759,11 @@ func testAccPolicyDocumentSourceExpectedJSON() string { } }, { - "Sid": "", "Effect": "Deny", "NotAction": "s3:*", "NotResource": "arn:%[1]s:s3:::*" }, { - "Sid": "", "Effect": "Allow", "Action": "kinesis:*", "Principal": { @@ -781,7 +771,6 @@ func testAccPolicyDocumentSourceExpectedJSON() string { } }, { - "Sid": "", "Effect": "Allow", "Action": "firehose:*", "Principal": "*" diff --git a/internal/service/iam/policy_model.go b/internal/service/iam/policy_model.go index 91844188fd26..3119924ef939 100644 --- a/internal/service/iam/policy_model.go +++ b/internal/service/iam/policy_model.go @@ -18,7 +18,7 @@ type IAMPolicyDoc struct { } type IAMPolicyStatement struct { - Sid string + Sid string `json:",omitempty"` Effect string `json:",omitempty"` Actions interface{} `json:"Action,omitempty"` NotActions interface{} `json:"NotAction,omitempty"` From 1fa471631507e54511161c97bd93ff02b8927a7b Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Tue, 21 Feb 2023 21:47:13 +0000 Subject: [PATCH 005/304] r/eks_addon: Deprecate `resolve_conflicts` attribute --- internal/service/eks/addon.go | 35 +++++++++++- internal/service/eks/addon_test.go | 79 ++++++++++++++++++++++---- website/docs/r/eks_addon.html.markdown | 43 ++++++++------ 3 files changed, 129 insertions(+), 28 deletions(-) diff --git a/internal/service/eks/addon.go b/internal/service/eks/addon.go index 8249063e9736..bfa8f738df38 100644 --- a/internal/service/eks/addon.go +++ b/internal/service/eks/addon.go @@ -86,6 +86,22 @@ func ResourceAddon() *schema.Resource { Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice(eks.ResolveConflicts_Values(), false), + Deprecated: "The \"resolve_conflicts\" attribute can't be set to \"PRESERVE\" on initial resource creation. Use \"resolve_conflicts_on_create\" and \"resolve_conflicts_on_update\" instead", + }, + "resolve_conflicts_on_create": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + eks.ResolveConflictsNone, + eks.ResolveConflictsOverwrite, + }, false), + ConflictsWith: []string{"resolve_conflicts"}, + }, + "resolve_conflicts_on_update": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice(eks.ResolveConflicts_Values(), false), + ConflictsWith: []string{"resolve_conflicts"}, }, "service_account_role_arn": { Type: schema.TypeString, @@ -117,6 +133,10 @@ func resourceAddonCreate(ctx context.Context, d *schema.ResourceData, meta inter input.AddonVersion = aws.String(v.(string)) } + if v, ok := d.GetOk("resolve_conflicts_on_create"); ok { + input.ResolveConflicts = aws.String(v.(string)) + } + if v, ok := d.GetOk("resolve_conflicts"); ok { input.ResolveConflicts = aws.String(v.(string)) } @@ -250,7 +270,18 @@ func resourceAddonUpdate(ctx context.Context, d *schema.ResourceData, meta inter input.ConfigurationValues = aws.String(d.Get("configuration_values").(string)) } + conflictResolutionAttr := "" + conflictResolution := "" + if v, ok := d.GetOk("resolve_conflicts"); ok { + conflictResolutionAttr = "resolve_conflicts" + conflictResolution = v.(string) + input.ResolveConflicts = aws.String(v.(string)) + } + + if v, ok := d.GetOk("resolve_conflicts_on_update"); ok { + conflictResolutionAttr = "resolve_conflicts_on_update" + conflictResolution = v.(string) input.ResolveConflicts = aws.String(v.(string)) } @@ -271,12 +302,12 @@ func resourceAddonUpdate(ctx context.Context, d *schema.ResourceData, meta inter _, err = waitAddonUpdateSuccessful(ctx, conn, clusterName, addonName, updateID, d.Timeout(schema.TimeoutUpdate)) if err != nil { - if d.Get("resolve_conflicts") != eks.ResolveConflictsOverwrite { + if conflictResolution != eks.ResolveConflictsOverwrite { // Changing addon version w/o setting resolve_conflicts to "OVERWRITE" // might result in a failed update if there are conflicts: // ConfigurationConflict Apply failed with 1 conflict: conflict with "kubectl"... return diag.FromErr(fmt.Errorf("error waiting for EKS Add-On (%s) update (%s): %w, consider setting attribute %q to %q", - d.Id(), updateID, err, "resolve_conflicts", eks.ResolveConflictsOverwrite)) + d.Id(), updateID, err, conflictResolutionAttr, eks.ResolveConflictsOverwrite)) } return diag.FromErr(fmt.Errorf("error waiting for EKS Add-On (%s) update (%s): %w", d.Id(), updateID, err)) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 27937c4c6373..38b243499fdc 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -130,7 +130,7 @@ func TestAccEKSAddon_addonVersion(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"resolve_conflicts"}, + ImportStateVerifyIgnore: []string{"resolve_conflicts_on_create", "resolve_conflicts_on_update"}, }, { Config: testAccAddonConfig_version(rName, addonName, addonVersion2), @@ -173,7 +173,7 @@ func TestAccEKSAddon_preserve(t *testing.T) { }) } -func TestAccEKSAddon_resolveConflicts(t *testing.T) { +func TestAccEKSAddon_deprecated(t *testing.T) { ctx := acctest.Context(t) var addon1, addon2, addon3 eks.Addon rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -187,7 +187,7 @@ func TestAccEKSAddon_resolveConflicts(t *testing.T) { CheckDestroy: testAccCheckAddonDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsNone), + Config: testAccAddonConfig_deprecated(rName, addonName, eks.ResolveConflictsNone), Check: resource.ComposeTestCheckFunc( testAccCheckAddonExists(ctx, resourceName, &addon1), resource.TestCheckResourceAttr(resourceName, "resolve_conflicts", eks.ResolveConflictsNone), @@ -200,14 +200,14 @@ func TestAccEKSAddon_resolveConflicts(t *testing.T) { ImportStateVerifyIgnore: []string{"resolve_conflicts"}, }, { - Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsOverwrite), + Config: testAccAddonConfig_deprecated(rName, addonName, eks.ResolveConflictsOverwrite), Check: resource.ComposeTestCheckFunc( testAccCheckAddonExists(ctx, resourceName, &addon2), resource.TestCheckResourceAttr(resourceName, "resolve_conflicts", eks.ResolveConflictsOverwrite), ), }, { - Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsPreserve), + Config: testAccAddonConfig_deprecated(rName, addonName, eks.ResolveConflictsPreserve), Check: resource.ComposeTestCheckFunc( testAccCheckAddonExists(ctx, resourceName, &addon3), resource.TestCheckResourceAttr(resourceName, "resolve_conflicts", eks.ResolveConflictsPreserve), @@ -217,6 +217,53 @@ func TestAccEKSAddon_resolveConflicts(t *testing.T) { }) } +func TestAccEKSAddon_resolveConflicts(t *testing.T) { + ctx := acctest.Context(t) + var addon1, addon2, addon3 eks.Addon + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_eks_addon.test" + addonName := "vpc-cni" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckAddon(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckAddonDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsNone, eks.ResolveConflictsNone), + Check: resource.ComposeTestCheckFunc( + testAccCheckAddonExists(ctx, resourceName, &addon1), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_create", eks.ResolveConflictsNone), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_update", eks.ResolveConflictsNone), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"resolve_conflicts_on_create", "resolve_conflicts_on_update"}, + }, + { + Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsOverwrite, eks.ResolveConflictsOverwrite), + Check: resource.ComposeTestCheckFunc( + testAccCheckAddonExists(ctx, resourceName, &addon2), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_create", eks.ResolveConflictsOverwrite), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_update", eks.ResolveConflictsOverwrite), + ), + }, + { + Config: testAccAddonConfig_resolveConflicts(rName, addonName, eks.ResolveConflictsOverwrite, eks.ResolveConflictsPreserve), + Check: resource.ComposeTestCheckFunc( + testAccCheckAddonExists(ctx, resourceName, &addon3), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_create", eks.ResolveConflictsOverwrite), + resource.TestCheckResourceAttr(resourceName, "resolve_conflicts_on_update", eks.ResolveConflictsPreserve), + ), + }, + }, + }) +} + func TestAccEKSAddon_serviceAccountRoleARN(t *testing.T) { ctx := acctest.Context(t) var addon eks.Addon @@ -884,10 +931,11 @@ resource "aws_eks_addon" "test" { func testAccAddonConfig_version(rName, addonName, addonVersion string) string { return acctest.ConfigCompose(testAccAddonConfig_base(rName), fmt.Sprintf(` resource "aws_eks_addon" "test" { - cluster_name = aws_eks_cluster.test.name - addon_name = %[2]q - addon_version = %[3]q - resolve_conflicts = "OVERWRITE" + cluster_name = aws_eks_cluster.test.name + addon_name = %[2]q + addon_version = %[3]q + resolve_conflicts_on_create = "OVERWRITE" + resolve_conflicts_on_update = "OVERWRITE" } `, rName, addonName, addonVersion)) } @@ -902,7 +950,7 @@ resource "aws_eks_addon" "test" { `, rName, addonName)) } -func testAccAddonConfig_resolveConflicts(rName, addonName, resolveConflicts string) string { +func testAccAddonConfig_deprecated(rName, addonName, resolveConflicts string) string { return acctest.ConfigCompose(testAccAddonConfig_base(rName), fmt.Sprintf(` resource "aws_eks_addon" "test" { cluster_name = aws_eks_cluster.test.name @@ -912,6 +960,17 @@ resource "aws_eks_addon" "test" { `, rName, addonName, resolveConflicts)) } +func testAccAddonConfig_resolveConflicts(rName, addonName, resolveConflictsOnCreate, resolveConflictsOnUpdate string) string { + return acctest.ConfigCompose(testAccAddonConfig_base(rName), fmt.Sprintf(` +resource "aws_eks_addon" "test" { + cluster_name = aws_eks_cluster.test.name + addon_name = %[2]q + resolve_conflicts_on_create = %[3]q + resolve_conflicts_on_update = %[4]q +} +`, rName, addonName, resolveConflictsOnCreate, resolveConflictsOnUpdate)) +} + func testAccAddonConfig_serviceAccountRoleARN(rName, addonName string) string { return acctest.ConfigCompose(testAccAddonConfig_base(rName), fmt.Sprintf(` resource "aws_iam_role" "test-service-role" { diff --git a/website/docs/r/eks_addon.html.markdown b/website/docs/r/eks_addon.html.markdown index 4f2ef3b01871..5eb0020359a1 100644 --- a/website/docs/r/eks_addon.html.markdown +++ b/website/docs/r/eks_addon.html.markdown @@ -24,17 +24,15 @@ resource "aws_eks_addon" "example" { } ``` -## Example Update add-on usage with resolve_conflicts and PRESERVE -`resolve_conflicts` with `PRESERVE` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. - -~> **Note:** `resolve_conflicts` with `PRESERVE` can only be used for upgrading the add-ons but not during the creation of add-on. +## Example Update add-on usage with resolve_conflicts_on_update and PRESERVE +`resolve_conflicts_on_update` with `PRESERVE` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. ```terraform resource "aws_eks_addon" "example" { - cluster_name = aws_eks_cluster.example.name - addon_name = "coredns" - addon_version = "v1.8.7-eksbuild.3" #e.g., previous version v1.8.7-eksbuild.2 and the new version is v1.8.7-eksbuild.3 - resolve_conflicts = "PRESERVE" + cluster_name = aws_eks_cluster.example.name + addon_name = "coredns" + addon_version = "v1.8.7-eksbuild.3" #e.g., previous version v1.8.7-eksbuild.2 and the new version is v1.8.7-eksbuild.3 + resolve_conflicts_on_update = "PRESERVE" } ``` @@ -56,11 +54,24 @@ Example to create a `coredns` managed addon with custom `configuration_values`. ```terraform resource "aws_eks_addon" "example" { - cluster_name = "mycluster" - addon_name = "coredns" - addon_version = "v1.8.7-eksbuild.3" - resolve_conflicts = "OVERWRITE" - configuration_values = "{\"replicaCount\":4,\"resources\":{\"limits\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"150Mi\"}}}" + cluster_name = "mycluster" + addon_name = "coredns" + addon_version = "v1.8.7-eksbuild.3" + resolve_conflicts_on_create = "OVERWRITE" + + configuration_values = jsonencode({ + replicaCount = 4 + resources = { + limits = { + cpu = "100m" + memory = "150Mi" + } + requests = { + cpu = "100m" + memory = "150Mi" + } + } + }) } ``` @@ -123,9 +134,9 @@ The following arguments are optional: * `addon_version` – (Optional) The version of the EKS add-on. The version must match one of the versions returned by [describe-addon-versions](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-versions.html). * `configuration_values` - (Optional) custom configuration values for addons with single JSON string. This JSON string value must match the JSON schema derived from [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html). -* `resolve_conflicts` - (Optional) Define how to resolve parameter value conflicts - when migrating an existing add-on to an Amazon EKS add-on or when applying - version updates to the add-on. Valid values are `NONE`, `OVERWRITE` and `PRESERVE`. For more details check [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `resolve_conflicts_on_create` - (Optional) How to resolve field value conflicts when migrating a self-managed add-on to an Amazon EKS add-on. Valid values are `NONE` and `OVERWRITE`. For more details see the [CreateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateAddon.html) API Docs. +* `resolve_conflicts_on_update` - (Optional) How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Valid values are `NONE` and `OVERWRITE`. For more details see the [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `resolve_conflicts` - (**Deprecated** use the `resolve_conflicts_on_create` and `resolve_conflicts_on_update` attributes instead) Define how to resolve parameter value conflicts when migrating an existing add-on to an Amazon EKS add-on or when applying version updates to the add-on. Valid values are `NONE`, `OVERWRITE` and `PRESERVE`. Note that `PRESERVE` is only valid on addon update, not for initial addon creation. If you need to set this to `PRESERVE`, use the `resolve_conflicts_on_create` and `resolve_conflicts_on_update` attributes instead. For more details check [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `preserve` - (Optional) Indicates if you want to preserve the created resources when deleting the EKS add-on. * `service_account_role_arn` - (Optional) The Amazon Resource Name (ARN) of an From 666f57d9f0bc52c45103d2d46efec05cade827f0 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Tue, 21 Feb 2023 21:52:57 +0000 Subject: [PATCH 006/304] Add Changelog --- .changelog/29555.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/29555.txt diff --git a/.changelog/29555.txt b/.changelog/29555.txt new file mode 100644 index 000000000000..8b20e915d784 --- /dev/null +++ b/.changelog/29555.txt @@ -0,0 +1,2 @@ +```release-note:note +resource/aws_eks_addon: The resolve_conflicts attribute is being deprecated in favour of separate resolve_conflicts_on_create and resolve_conflicts_on_update attributes From e763f1051d34b0899b61e15bb15b8df076bdf76a Mon Sep 17 00:00:00 2001 From: Marek Schwarz Date: Fri, 31 Mar 2023 16:31:04 +0200 Subject: [PATCH 007/304] Removed deprecated field threshold from resource aws_ce_anomaly_subscription --- internal/service/ce/anomaly_subscription.go | 16 ----- .../service/ce/anomaly_subscription_test.go | 67 ------------------- 2 files changed, 83 deletions(-) diff --git a/internal/service/ce/anomaly_subscription.go b/internal/service/ce/anomaly_subscription.go index f2a747ddd3f9..fb6d2253296a 100644 --- a/internal/service/ce/anomaly_subscription.go +++ b/internal/service/ce/anomaly_subscription.go @@ -77,13 +77,6 @@ func ResourceAnomalySubscription() *schema.Resource { }, }, }, - "threshold": { - Type: schema.TypeFloat, - Optional: true, - Computed: true, - ValidateFunc: validation.FloatAtLeast(0.0), - Deprecated: "use threshold_expression instead", - }, "threshold_expression": { Type: schema.TypeList, MaxItems: 1, @@ -117,10 +110,6 @@ func resourceAnomalySubscriptionCreate(ctx context.Context, d *schema.ResourceDa input.AnomalySubscription.AccountId = aws.String(v.(string)) } - if v, ok := d.GetOk("threshold"); ok { - input.AnomalySubscription.Threshold = aws.Float64(v.(float64)) - } - if v, ok := d.GetOk("threshold_expression"); ok { input.AnomalySubscription.ThresholdExpression = expandCostExpression(v.([]interface{})[0].(map[string]interface{})) } @@ -166,7 +155,6 @@ func resourceAnomalySubscriptionRead(ctx context.Context, d *schema.ResourceData d.Set("frequency", subscription.Frequency) d.Set("monitor_arn_list", subscription.MonitorArnList) d.Set("subscriber", flattenAnomalySubscriptionSubscribers(subscription.Subscribers)) - d.Set("threshold", subscription.Threshold) d.Set("name", subscription.SubscriptionName) if err = d.Set("threshold_expression", []interface{}{flattenCostCategoryRuleExpression(subscription.ThresholdExpression)}); err != nil { @@ -212,10 +200,6 @@ func resourceAnomalySubscriptionUpdate(ctx context.Context, d *schema.ResourceDa input.Subscribers = expandAnomalySubscriptionSubscribers(d.Get("subscriber").(*schema.Set).List()) } - if d.HasChange("threshold") { - input.Threshold = aws.Float64(d.Get("threshold").(float64)) - } - if d.HasChange("threshold_expression") { input.ThresholdExpression = expandCostExpression(d.Get("threshold_expression").([]interface{})[0].(map[string]interface{})) } diff --git a/internal/service/ce/anomaly_subscription_test.go b/internal/service/ce/anomaly_subscription_test.go index 32b6ef5b4fb1..5399ee9a071f 100644 --- a/internal/service/ce/anomaly_subscription_test.go +++ b/internal/service/ce/anomaly_subscription_test.go @@ -44,7 +44,6 @@ func TestAccCEAnomalySubscription_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "monitor_arn_list.#"), resource.TestCheckResourceAttr(resourceName, "subscriber.0.type", "EMAIL"), resource.TestCheckResourceAttr(resourceName, "subscriber.0.address", address), - resource.TestCheckResourceAttr(resourceName, "threshold", "100"), ), }, { @@ -75,7 +74,6 @@ func TestAccCEAnomalySubscription_thresholdExpression(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAnomalySubscriptionExists(ctx, resourceName, &subscription), resource.TestCheckResourceAttr(resourceName, "name", rName), - // resource.TestCheckResourceAttr(resourceName, "threshold", "100"), ), }, { @@ -257,43 +255,6 @@ func TestAccCEAnomalySubscription_Subscriber(t *testing.T) { }) } -func TestAccCEAnomalySubscription_Threshold(t *testing.T) { - ctx := acctest.Context(t) - var subscription costexplorer.AnomalySubscription - resourceName := "aws_ce_anomaly_subscription.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - domain := acctest.RandomDomainName() - address := acctest.RandomEmailAddress(domain) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), - ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), - Steps: []resource.TestStep{ - { - Config: testAccAnomalySubscriptionConfig_threshold(rName, 100, address), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAnomalySubscriptionExists(ctx, resourceName, &subscription), - resource.TestCheckResourceAttr(resourceName, "threshold", "100"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccAnomalySubscriptionConfig_threshold(rName, 200, address), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAnomalySubscriptionExists(ctx, resourceName, &subscription), - resource.TestCheckResourceAttr(resourceName, "threshold", "200"), - ), - }, - }, - }) -} - func TestAccCEAnomalySubscription_Tags(t *testing.T) { ctx := acctest.Context(t) var subscription costexplorer.AnomalySubscription @@ -428,7 +389,6 @@ func testAccAnomalySubscriptionConfig_basic(rName string, address string) string fmt.Sprintf(` resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = "DAILY" monitor_arn_list = [ @@ -499,7 +459,6 @@ resource "aws_ce_anomaly_monitor" "test2" { resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = "WEEKLY" monitor_arn_list = [ @@ -520,7 +479,6 @@ func testAccAnomalySubscriptionConfig_frequency(rName string, rFrequency string, fmt.Sprintf(` resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = %[2]q monitor_arn_list = [ @@ -541,7 +499,6 @@ func testAccAnomalySubscriptionConfig_subscriber2(rName string, address1 string, fmt.Sprintf(` resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = "WEEKLY" monitor_arn_list = [ @@ -637,7 +594,6 @@ resource "aws_sns_topic_policy" "test" { resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100000000 frequency = "IMMEDIATE" monitor_arn_list = [ @@ -656,34 +612,12 @@ resource "aws_ce_anomaly_subscription" "test" { `, rName)) } -func testAccAnomalySubscriptionConfig_threshold(rName string, rThreshold int, address string) string { - return acctest.ConfigCompose( - testAccAnomalySubscriptionConfigBase(rName), - fmt.Sprintf(` -resource "aws_ce_anomaly_subscription" "test" { - name = %[1]q - threshold = %[2]d - frequency = "WEEKLY" - - monitor_arn_list = [ - aws_ce_anomaly_monitor.test.arn, - ] - - subscriber { - type = "EMAIL" - address = %[3]q - } -} -`, rName, rThreshold, address)) -} - func testAccAnomalySubscriptionConfig_tags1(rName string, tagKey1, tagValue1 string, address string) string { return acctest.ConfigCompose( testAccAnomalySubscriptionConfigBase(rName), fmt.Sprintf(` resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = "DAILY" monitor_arn_list = [ @@ -708,7 +642,6 @@ func testAccAnomalySubscriptionConfig_tags2(rName, tagKey1, tagValue1, tagKey2, fmt.Sprintf(` resource "aws_ce_anomaly_subscription" "test" { name = %[1]q - threshold = 100 frequency = "DAILY" monitor_arn_list = [ From 9b3eb6fe94da05a72abba0d87382b874ec759935 Mon Sep 17 00:00:00 2001 From: Marek Schwarz Date: Mon, 3 Apr 2023 09:46:51 +0200 Subject: [PATCH 008/304] Added changelog entry --- .changelog/30374.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/30374.txt diff --git a/.changelog/30374.txt b/.changelog/30374.txt new file mode 100644 index 000000000000..116413b56c9e --- /dev/null +++ b/.changelog/30374.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_ce_anomaly_subscription: The `threshold` attribute have been removed to match the AWS Cost Explorer API documentation. +``` From f0903a060f9d49f12d14b6277dabda15cf7f1509 Mon Sep 17 00:00:00 2001 From: Marek Schwarz Date: Tue, 4 Apr 2023 17:18:15 +0200 Subject: [PATCH 009/304] Removed deprecated field ignore_headers_row from aws_dms_endpoint.s3_settings --- internal/service/dms/endpoint.go | 6 ------ website/docs/r/dms_endpoint.html.markdown | 1 - 2 files changed, 7 deletions(-) diff --git a/internal/service/dms/endpoint.go b/internal/service/dms/endpoint.go index e674a1a329bc..4c99b4f120f4 100644 --- a/internal/service/dms/endpoint.go +++ b/internal/service/dms/endpoint.go @@ -565,12 +565,6 @@ func ResourceEndpoint() *schema.Resource { Optional: true, Default: "", }, - "ignore_headers_row": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validation.IntInSlice([]int{0, 1}), - Description: "This setting has no effect, is deprecated, and will be removed in a future version", - }, "ignore_header_rows": { Type: schema.TypeInt, Optional: true, diff --git a/website/docs/r/dms_endpoint.html.markdown b/website/docs/r/dms_endpoint.html.markdown index e7e119e91930..0ec7036e87ac 100644 --- a/website/docs/r/dms_endpoint.html.markdown +++ b/website/docs/r/dms_endpoint.html.markdown @@ -179,7 +179,6 @@ The following arguments are optional: * `encryption_mode` - (Optional) Server-side encryption mode that you want to encrypt your .csv or .parquet object files copied to S3. Valid values are `SSE_S3` and `SSE_KMS`. Default is `SSE_S3`. * `external_table_definition` - (Optional) JSON document that describes how AWS DMS should interpret the data. * `ignore_header_rows` - (Optional) When this value is set to `1`, DMS ignores the first row header in a .csv file. Default is `0`. -* `ignore_headers_row` - (Optional) Deprecated. This setting has no effect. Will be removed in a future version. * `include_op_for_full_load` - (Optional) Whether to enable a full load to write INSERT operations to the .csv output files only to indicate how the rows were added to the source database. Default is `false`. * `max_file_size` - (Optional) Maximum size (in KB) of any .csv file to be created while migrating to an S3 target during full load. Valid values are from `1` to `1048576`. Default is `1048576` (1 GB). * `parquet_timestamp_in_millisecond` - (Optional) - Specifies the precision of any TIMESTAMP column values written to an S3 object file in .parquet format. Default is `false`. From 5fe01fd2aa021ede74e825fcdbb0dc8d2a4ce347 Mon Sep 17 00:00:00 2001 From: Marek Schwarz Date: Tue, 4 Apr 2023 17:23:54 +0200 Subject: [PATCH 010/304] Added changelog entry --- .changelog/30452.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/30452.txt diff --git a/.changelog/30452.txt b/.changelog/30452.txt new file mode 100644 index 000000000000..e475fe4f7c20 --- /dev/null +++ b/.changelog/30452.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed +``` \ No newline at end of file From b927244913e3c3ac4747496d6334ac9d827e6be9 Mon Sep 17 00:00:00 2001 From: Rob Kulbin <6707630+roberth-k@users.noreply.github.com> Date: Fri, 14 Apr 2023 12:57:59 +0100 Subject: [PATCH 011/304] r/aws_guardduty_organization_configuration: fix race condition in acceptance tests Attempting to delete a detector fails when the organization admin account is still enabled. --- .../service/guardduty/organization_configuration_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/guardduty/organization_configuration_test.go b/internal/service/guardduty/organization_configuration_test.go index a3824b9ef52e..e242b113397c 100644 --- a/internal/service/guardduty/organization_configuration_test.go +++ b/internal/service/guardduty/organization_configuration_test.go @@ -197,7 +197,7 @@ resource "aws_organizations_organization" "test" { resource "aws_guardduty_detector" "test" {} resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test] + depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] admin_account_id = data.aws_caller_identity.current.account_id } @@ -225,7 +225,7 @@ resource "aws_organizations_organization" "test" { resource "aws_guardduty_detector" "test" {} resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test] + depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] admin_account_id = data.aws_caller_identity.current.account_id } @@ -259,7 +259,7 @@ resource "aws_organizations_organization" "test" { resource "aws_guardduty_detector" "test" {} resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test] + depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] admin_account_id = data.aws_caller_identity.current.account_id } @@ -295,7 +295,7 @@ resource "aws_organizations_organization" "test" { resource "aws_guardduty_detector" "test" {} resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test] + depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] admin_account_id = data.aws_caller_identity.current.account_id } From a82b3f526a5df8faa77c4156c44b00efc6c068c8 Mon Sep 17 00:00:00 2001 From: Rob Kulbin <6707630+roberth-k@users.noreply.github.com> Date: Fri, 14 Apr 2023 13:15:01 +0100 Subject: [PATCH 012/304] r/aws_guardduty_organization_configuration: consolidate acceptance test base configuration --- .../organization_configuration_test.go | 94 +++++++------------ 1 file changed, 35 insertions(+), 59 deletions(-) diff --git a/internal/service/guardduty/organization_configuration_test.go b/internal/service/guardduty/organization_configuration_test.go index e242b113397c..8dc0d4a50096 100644 --- a/internal/service/guardduty/organization_configuration_test.go +++ b/internal/service/guardduty/organization_configuration_test.go @@ -183,15 +183,18 @@ func testAccOrganizationConfiguration_malwareprotection(t *testing.T) { }) } -func testAccOrganizationConfigurationConfig_autoEnable(autoEnable bool) string { - return fmt.Sprintf(` +const testAccOrganizationConfigurationConfigBase = ` data "aws_caller_identity" "current" {} data "aws_partition" "current" {} resource "aws_organizations_organization" "test" { - aws_service_access_principals = ["guardduty.${data.aws_partition.current.dns_suffix}"] - feature_set = "ALL" + aws_service_access_principals = [ + "guardduty.${data.aws_partition.current.dns_suffix}", + "malware-protection.guardduty.${data.aws_partition.current.dns_suffix}", + ] + + feature_set = "ALL" } resource "aws_guardduty_detector" "test" {} @@ -201,35 +204,38 @@ resource "aws_guardduty_organization_admin_account" "test" { admin_account_id = data.aws_caller_identity.current.account_id } +` +func testAccOrganizationConfigurationConfig_autoEnable(autoEnable bool) string { + return acctest.ConfigCompose( + testAccOrganizationConfigurationConfigBase, + fmt.Sprintf(` resource "aws_guardduty_organization_configuration" "test" { depends_on = [aws_guardduty_organization_admin_account.test] auto_enable = %[1]t detector_id = aws_guardduty_detector.test.id } -`, autoEnable) +`, autoEnable)) } -func testAccOrganizationConfigurationConfig_s3Logs(autoEnable bool) string { - return fmt.Sprintf(` -data "aws_caller_identity" "current" {} - -data "aws_partition" "current" {} +func testAccOrganizationConfigurationConfig_autoEnableOrganizationMembers(value string) string { + return acctest.ConfigCompose( + testAccOrganizationConfigurationConfigBase, + fmt.Sprintf(` +resource "aws_guardduty_organization_configuration" "test" { + depends_on = [aws_guardduty_organization_admin_account.test] -resource "aws_organizations_organization" "test" { - aws_service_access_principals = ["guardduty.${data.aws_partition.current.dns_suffix}"] - feature_set = "ALL" + auto_enable_organization_members = %[1]q + detector_id = aws_guardduty_detector.test.id } - -resource "aws_guardduty_detector" "test" {} - -resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] - - admin_account_id = data.aws_caller_identity.current.account_id +`, value)) } +func testAccOrganizationConfigurationConfig_s3Logs(autoEnable bool) string { + return acctest.ConfigCompose( + testAccOrganizationConfigurationConfigBase, + fmt.Sprintf(` resource "aws_guardduty_organization_configuration" "test" { depends_on = [aws_guardduty_organization_admin_account.test] @@ -242,28 +248,13 @@ resource "aws_guardduty_organization_configuration" "test" { } } } -`, autoEnable) +`, autoEnable)) } func testAccOrganizationConfigurationConfig_kubernetes(autoEnable bool) string { - return fmt.Sprintf(` -data "aws_caller_identity" "current" {} - -data "aws_partition" "current" {} - -resource "aws_organizations_organization" "test" { - aws_service_access_principals = ["guardduty.${data.aws_partition.current.dns_suffix}"] - feature_set = "ALL" -} - -resource "aws_guardduty_detector" "test" {} - -resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] - - admin_account_id = data.aws_caller_identity.current.account_id -} - + return acctest.ConfigCompose( + testAccOrganizationConfigurationConfigBase, + fmt.Sprintf(` resource "aws_guardduty_organization_configuration" "test" { depends_on = [aws_guardduty_organization_admin_account.test] @@ -278,28 +269,13 @@ resource "aws_guardduty_organization_configuration" "test" { } } } -`, autoEnable) +`, autoEnable)) } func testAccOrganizationConfigurationConfig_malwareprotection(autoEnable bool) string { - return fmt.Sprintf(` -data "aws_caller_identity" "current" {} - -data "aws_partition" "current" {} - -resource "aws_organizations_organization" "test" { - aws_service_access_principals = ["guardduty.${data.aws_partition.current.dns_suffix}", "malware-protection.guardduty.${data.aws_partition.current.dns_suffix}"] - feature_set = "ALL" -} - -resource "aws_guardduty_detector" "test" {} - -resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] - - admin_account_id = data.aws_caller_identity.current.account_id -} - + return acctest.ConfigCompose( + testAccOrganizationConfigurationConfigBase, + fmt.Sprintf(` resource "aws_guardduty_organization_configuration" "test" { depends_on = [aws_guardduty_organization_admin_account.test] @@ -316,5 +292,5 @@ resource "aws_guardduty_organization_configuration" "test" { } } } -`, autoEnable) +`, autoEnable)) } From 15d111f5437a808aaf4afe7b7190eb7523e194d3 Mon Sep 17 00:00:00 2001 From: Rob Kulbin <6707630+roberth-k@users.noreply.github.com> Date: Fri, 14 Apr 2023 13:59:44 +0100 Subject: [PATCH 013/304] r/aws_guardduty_organization_configuration: add auto_enable_organization_members attribute --- internal/service/guardduty/guardduty_test.go | 9 +- .../guardduty/organization_configuration.go | 50 ++++++++- .../organization_configuration_test.go | 100 ++++++++++++++++++ ...y_organization_configuration.html.markdown | 8 +- 4 files changed, 157 insertions(+), 10 deletions(-) diff --git a/internal/service/guardduty/guardduty_test.go b/internal/service/guardduty/guardduty_test.go index 5a1f89106171..d9b8e2c90696 100644 --- a/internal/service/guardduty/guardduty_test.go +++ b/internal/service/guardduty/guardduty_test.go @@ -38,10 +38,11 @@ func TestAccGuardDuty_serial(t *testing.T) { "basic": testAccOrganizationAdminAccount_basic, }, "OrganizationConfiguration": { - "basic": testAccOrganizationConfiguration_basic, - "s3Logs": testAccOrganizationConfiguration_s3logs, - "kubernetes": testAccOrganizationConfiguration_kubernetes, - "malwareProtection": testAccOrganizationConfiguration_malwareprotection, + "basic": testAccOrganizationConfiguration_basic, + "autoEnableOrganizationMembers": testAccOrganizationConfiguration_autoEnableOrganizationMembers, + "s3Logs": testAccOrganizationConfiguration_s3logs, + "kubernetes": testAccOrganizationConfiguration_kubernetes, + "malwareProtection": testAccOrganizationConfiguration_malwareprotection, }, "ThreatIntelSet": { "basic": testAccThreatIntelSet_basic, diff --git a/internal/service/guardduty/organization_configuration.go b/internal/service/guardduty/organization_configuration.go index b1c5f071a962..a42284093b32 100644 --- a/internal/service/guardduty/organization_configuration.go +++ b/internal/service/guardduty/organization_configuration.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "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" @@ -28,8 +29,19 @@ func ResourceOrganizationConfiguration() *schema.Resource { Schema: map[string]*schema.Schema{ "auto_enable": { - Type: schema.TypeBool, - Required: true, + Type: schema.TypeBool, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"auto_enable", "auto_enable_organization_members"}, + Deprecated: "Use auto_enable_organization_members instead", + }, + + "auto_enable_organization_members": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"auto_enable", "auto_enable_organization_members"}, + ValidateFunc: validation.StringInSlice(guardduty.AutoEnableMembers_Values(), false), }, "datasources": { @@ -119,6 +131,35 @@ func ResourceOrganizationConfiguration() *schema.Resource { ValidateFunc: validation.NoZeroValues, }, }, + + CustomizeDiff: customdiff.Sequence( + func(_ context.Context, d *schema.ResourceDiff, _ interface{}) error { + // When creating an organization configuration with AutoEnable=true, + // AWS will automatically set AutoEnableOrganizationMembers=NEW. + // + // When configuring AutoEnableOrganizationMembers=ALL or NEW, + // AWS will automatically set AutoEnable=true. + // + // This diff customization keeps things consistent when configuring + // the resource against deprecation advice from AutoEnableOrganizationMembers=ALL + // to AutoEnable=true, and it also removes the need to use + // AutoEnable in the resource update function. + + if attr := d.GetRawConfig().GetAttr("auto_enable_organization_members"); attr.IsKnown() && !attr.IsNull() { + return d.SetNew("auto_enable", attr.AsString() != guardduty.AutoEnableMembersNone) + } + + if attr := d.GetRawConfig().GetAttr("auto_enable"); attr.IsKnown() && !attr.IsNull() { + if attr.True() { + return d.SetNew("auto_enable_organization_members", guardduty.AutoEnableMembersNew) + } else { + return d.SetNew("auto_enable_organization_members", guardduty.AutoEnableMembersNone) + } + } + + return nil + }, + ), } } @@ -129,8 +170,8 @@ func resourceOrganizationConfigurationUpdate(ctx context.Context, d *schema.Reso detectorID := d.Get("detector_id").(string) input := &guardduty.UpdateOrganizationConfigurationInput{ - AutoEnable: aws.Bool(d.Get("auto_enable").(bool)), - DetectorId: aws.String(detectorID), + AutoEnableOrganizationMembers: aws.String(d.Get("auto_enable_organization_members").(string)), + DetectorId: aws.String(detectorID), } if v, ok := d.GetOk("datasources"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { @@ -173,6 +214,7 @@ func resourceOrganizationConfigurationRead(ctx context.Context, d *schema.Resour } d.Set("auto_enable", output.AutoEnable) + d.Set("auto_enable_organization_members", output.AutoEnableOrganizationMembers) if output.DataSources != nil { if err := d.Set("datasources", []interface{}{flattenOrganizationDataSourceConfigurationsResult(output.DataSources)}); err != nil { diff --git a/internal/service/guardduty/organization_configuration_test.go b/internal/service/guardduty/organization_configuration_test.go index 8dc0d4a50096..ba887d1f7b40 100644 --- a/internal/service/guardduty/organization_configuration_test.go +++ b/internal/service/guardduty/organization_configuration_test.go @@ -29,6 +29,7 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { Config: testAccOrganizationConfigurationConfig_autoEnable(true), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "auto_enable", "true"), + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NEW"), resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), ), }, @@ -41,6 +42,7 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { Config: testAccOrganizationConfigurationConfig_autoEnable(false), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "auto_enable", "false"), + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NONE"), resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), ), }, @@ -48,6 +50,104 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { }) } +func testAccOrganizationConfiguration_autoEnableOrganizationMembers(t *testing.T) { + ctx := acctest.Context(t) + detectorResourceName := "aws_guardduty_detector.test" + resourceName := "aws_guardduty_organization_configuration.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckOrganizationsAccount(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + // GuardDuty Organization Configuration cannot be deleted separately. + // Ensure parent resource is destroyed instead. + CheckDestroy: testAccCheckDetectorDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccOrganizationConfigurationConfig_autoEnableOrganizationMembers("ALL"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "ALL"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "true"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccOrganizationConfigurationConfig_autoEnableOrganizationMembers("NONE"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NONE"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "false"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccOrganizationConfigurationConfig_autoEnableOrganizationMembers("ALL"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "ALL"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "true"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccOrganizationConfigurationConfig_autoEnable(true), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NEW"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "true"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccOrganizationConfigurationConfig_autoEnableOrganizationMembers("NONE"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NONE"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "false"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccOrganizationConfigurationConfig_autoEnable(false), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "auto_enable_organization_members", "NONE"), + resource.TestCheckResourceAttr(resourceName, "auto_enable", "false"), + resource.TestCheckResourceAttrPair(resourceName, "detector_id", detectorResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccOrganizationConfiguration_s3logs(t *testing.T) { ctx := acctest.Context(t) detectorResourceName := "aws_guardduty_detector.test" diff --git a/website/docs/r/guardduty_organization_configuration.html.markdown b/website/docs/r/guardduty_organization_configuration.html.markdown index 4c2685addaac..594df48c628e 100644 --- a/website/docs/r/guardduty_organization_configuration.html.markdown +++ b/website/docs/r/guardduty_organization_configuration.html.markdown @@ -20,7 +20,8 @@ resource "aws_guardduty_detector" "example" { } resource "aws_guardduty_organization_configuration" "example" { - auto_enable = true + auto_enable_organization_members = "ALL" + detector_id = aws_guardduty_detector.example.id datasources { @@ -45,9 +46,12 @@ resource "aws_guardduty_organization_configuration" "example" { ## Argument Reference +~> **NOTE:** One of `auto_enable` or `auto_enable_organization_members` must be specified. + The following arguments are supported: -* `auto_enable` - (Required) When this setting is enabled, all new accounts that are created in, or added to, the organization are added as a member accounts of the organization’s GuardDuty delegated administrator and GuardDuty is enabled in that AWS Region. +* `auto_enable` - (Optional) *Deprecated:* Use `auto_enable_organization_members` instead. When this setting is enabled, all new accounts that are created in, or added to, the organization are added as a member accounts of the organization’s GuardDuty delegated administrator and GuardDuty is enabled in that AWS Region. +* `auto_enable_organization_members` - (Optional) Indicates the auto-enablement configuration of GuardDuty for the member accounts in the organization. Valid values are `ALL`, `NEW`, `NONE`. * `detector_id` - (Required) The detector ID of the GuardDuty account. * `datasources` - (Optional) Configuration for the collected datasources. From ebfbd8b86b5ab97c8c06c16acc5c2e638e5affce Mon Sep 17 00:00:00 2001 From: Rob Kulbin <6707630+roberth-k@users.noreply.github.com> Date: Fri, 14 Apr 2023 14:10:22 +0100 Subject: [PATCH 014/304] r/aws_guardduty_organization_admin_account: ensure that the admin account is disabled before the detector is destroyed --- internal/service/guardduty/organization_admin_account_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/guardduty/organization_admin_account_test.go b/internal/service/guardduty/organization_admin_account_test.go index e0b223bf8097..4f3142b7278d 100644 --- a/internal/service/guardduty/organization_admin_account_test.go +++ b/internal/service/guardduty/organization_admin_account_test.go @@ -110,7 +110,7 @@ resource "aws_organizations_organization" "test" { resource "aws_guardduty_detector" "test" {} resource "aws_guardduty_organization_admin_account" "test" { - depends_on = [aws_organizations_organization.test] + depends_on = [aws_organizations_organization.test, aws_guardduty_detector.test] admin_account_id = data.aws_caller_identity.current.account_id } From 679e1e1fb558437d99180aaac1578e2f473e339d Mon Sep 17 00:00:00 2001 From: Rob Kulbin <6707630+roberth-k@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:18:25 +0100 Subject: [PATCH 015/304] add changelog entry for #30736 --- .changelog/30736.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/30736.txt diff --git a/.changelog/30736.txt b/.changelog/30736.txt new file mode 100644 index 000000000000..97d082582476 --- /dev/null +++ b/.changelog/30736.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_guardduty_organization_configuration: Add `auto_enable_organization_members` attribute +``` + +```release-note:note +resource/aws_guardduty_organization_configuration: The `auto_enable` argument has been deprecated. Use the `auto_enable_organization_members` argument instead. + ``` From 3c87674f37a7715456d70b95c2611abfd70386a4 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 19 Apr 2023 20:54:15 -0400 Subject: [PATCH 016/304] r/aws_autoscaling_group(test): fix invalid count argument error --- internal/service/autoscaling/group_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index c932a260b17e..60724908e7df 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -1256,6 +1256,7 @@ func TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity(t *testing.T) { var group autoscaling.Group resourceName := "aws_autoscaling_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + subnetCount := 2 var tg elbv2.TargetGroup resource.ParallelTest(t, resource.TestCase{ @@ -1265,7 +1266,7 @@ func TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGroupConfig_targetELBCapacity(rName), + Config: testAccGroupConfig_targetELBCapacity(rName, subnetCount), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &group), testAccCheckLBTargetGroupExists(ctx, "aws_lb_target_group.test", &tg), @@ -4622,10 +4623,10 @@ resource "aws_autoscaling_group" "test" { `, rName, targetGroupCount)) } -func testAccGroupConfig_targetELBCapacity(rName string) string { +func testAccGroupConfig_targetELBCapacity(rName string, subnetCount int) string { return acctest.ConfigCompose( acctest.ConfigLatestAmazonLinuxHVMEBSAMI(), - acctest.ConfigVPCWithSubnets(rName, 2), + acctest.ConfigVPCWithSubnets(rName, subnetCount), fmt.Sprintf(` resource "aws_internet_gateway" "test" { vpc_id = aws_vpc.test.id @@ -4686,7 +4687,7 @@ resource "aws_route_table" "test" { } resource "aws_route_table_association" "test" { - count = length(aws_subnet.test[*]) + count = %[2]d subnet_id = aws_subnet.test[count.index].id route_table_id = aws_route_table.test.id @@ -4737,7 +4738,7 @@ resource "aws_autoscaling_group" "test" { propagate_at_launch = true } } -`, rName)) +`, rName, subnetCount)) } func testAccGroupConfig_warmPoolEmpty(rName string) string { From 4cd145a401e2ae8fad3319db5e6737ccc17ffa6c Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 19 Apr 2023 21:38:28 -0400 Subject: [PATCH 017/304] r/aws_autoscaling_group: remove deprecated tags attribute --- internal/service/autoscaling/group.go | 96 +------------------ internal/service/autoscaling/group_test.go | 52 +--------- .../docs/r/autoscaling_group.html.markdown | 53 +--------- 3 files changed, 10 insertions(+), 191 deletions(-) diff --git a/internal/service/autoscaling/group.go b/internal/service/autoscaling/group.go index c925157e3e7c..f9569f071293 100644 --- a/internal/service/autoscaling/group.go +++ b/internal/service/autoscaling/group.go @@ -744,52 +744,6 @@ func ResourceGroup() *schema.Resource { return create.StringHashcode(buf.String()) }, - ConflictsWith: []string{"tags"}, - }, - "tags": { - Deprecated: "Use tag instead", - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeMap, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - // Terraform 0.11 and earlier can provide incorrect type - // information during difference handling, in which boolean - // values are represented as "0" and "1". This Set function - // normalizes these hashing variations, while the Terraform - // Plugin SDK automatically suppresses the boolean/string - // difference in the value itself. - Set: func(v interface{}) int { - var buf bytes.Buffer - - m, ok := v.(map[string]interface{}) - - if !ok { - return 0 - } - - if v, ok := m["key"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - - if v, ok := m["value"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - - if v, ok := m["propagate_at_launch"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", v)) - } else if v, ok := m["propagate_at_launch"].(string); ok { - if b, err := strconv.ParseBool(v); err == nil { - buf.WriteString(fmt.Sprintf("%t-", b)) - } else { - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - return create.StringHashcode(buf.String()) - }, - ConflictsWith: []string{"tag"}, }, "target_group_arns": { Type: schema.TypeSet, @@ -977,10 +931,6 @@ func resourceGroupCreate(ctx context.Context, d *schema.ResourceData, meta inter createInput.Tags = Tags(KeyValueTags(ctx, v, asgName, TagResourceTypeGroup).IgnoreAWS()) } - if v, ok := d.GetOk("tags"); ok { - createInput.Tags = Tags(KeyValueTags(ctx, v, asgName, TagResourceTypeGroup).IgnoreAWS()) - } - if v, ok := d.GetOk("target_group_arns"); ok && len(v.(*schema.Set).List()) > 0 { createInput.TargetGroupARNs = flex.ExpandStringSet(v.(*schema.Set)) } @@ -1177,31 +1127,8 @@ func resourceGroupRead(ctx context.Context, d *schema.ResourceData, meta interfa d.Set("warm_pool", nil) } - var tagOk, tagsOk bool - var v interface{} - - // Deprecated: In a future major version, this should always set all tags except those ignored. - // Remove d.GetOk() and Only() handling. - if v, tagOk = d.GetOk("tag"); tagOk { - proposedStateTags := KeyValueTags(ctx, v, d.Id(), TagResourceTypeGroup) - - if err := d.Set("tag", ListOfMap(KeyValueTags(ctx, g.Tags, d.Id(), TagResourceTypeGroup).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Only(proposedStateTags))); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tag: %s", err) - } - } - - if v, tagsOk = d.GetOk("tags"); tagsOk { - proposedStateTags := KeyValueTags(ctx, v, d.Id(), TagResourceTypeGroup) - - if err := d.Set("tags", ListOfStringMap(KeyValueTags(ctx, g.Tags, d.Id(), TagResourceTypeGroup).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Only(proposedStateTags))); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) - } - } - - if !tagOk && !tagsOk { - if err := d.Set("tag", ListOfMap(KeyValueTags(ctx, g.Tags, d.Id(), TagResourceTypeGroup).IgnoreAWS().IgnoreConfig(ignoreTagsConfig))); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tag: %s", err) - } + if err := d.Set("tag", ListOfMap(KeyValueTags(ctx, g.Tags, d.Id(), TagResourceTypeGroup).IgnoreAWS().IgnoreConfig(ignoreTagsConfig))); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tag: %s", err) } return diags @@ -1219,7 +1146,6 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta inter "load_balancers", "suspended_processes", "tag", - "tags", "target_group_arns", "warm_pool", ) { @@ -1339,17 +1265,11 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta inter } } - if d.HasChanges("tag", "tags") { + if d.HasChanges("tag") { oTagRaw, nTagRaw := d.GetChange("tag") - oTagsRaw, nTagsRaw := d.GetChange("tags") - - oTag := KeyValueTags(ctx, oTagRaw, d.Id(), TagResourceTypeGroup) - oTags := KeyValueTags(ctx, oTagsRaw, d.Id(), TagResourceTypeGroup) - oldTags := Tags(oTag.Merge(oTags)) - nTag := KeyValueTags(ctx, nTagRaw, d.Id(), TagResourceTypeGroup) - nTags := KeyValueTags(ctx, nTagsRaw, d.Id(), TagResourceTypeGroup) - newTags := Tags(nTag.Merge(nTags)) + oldTags := Tags(KeyValueTags(ctx, oTagRaw, d.Id(), TagResourceTypeGroup)) + newTags := Tags(KeyValueTags(ctx, nTagRaw, d.Id(), TagResourceTypeGroup)) if err := UpdateTags(ctx, conn, d.Id(), TagResourceTypeGroup, oldTags, newTags); err != nil { return sdkdiag.AppendErrorf(diags, "updating tags for Auto Scaling Group (%s): %s", d.Id(), err) @@ -1501,12 +1421,6 @@ func resourceGroupUpdate(ctx context.Context, d *schema.ResourceData, meta inter } } - if v.Contains("tag") && !v.Contains("tags") { - triggers = append(triggers, "tags") // nozero - } else if !v.Contains("tag") && v.Contains("tags") { - triggers = append(triggers, "tag") // nozero - } - shouldRefreshInstances = d.HasChanges(triggers...) } } diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index 60724908e7df..78f4557ba1de 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -274,36 +274,6 @@ func TestAccAutoScalingGroup_tags(t *testing.T) { }) } -func TestAccAutoScalingGroup_deprecatedTags(t *testing.T) { - ctx := acctest.Context(t) - var group autoscaling.Group - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_autoscaling_group.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupConfig_deprecatedTags1(rName, "key1", "value1", true), - Check: resource.ComposeTestCheckFunc( - testAccCheckGroupExists(ctx, resourceName, &group), - resource.TestCheckResourceAttr(resourceName, "tag.#", "0"), - resource.TestCheckResourceAttr(resourceName, "tags.#", "1"), - resource.TestCheckTypeSetElemNestedAttrs(resourceName, "tags.*", map[string]string{ - "key": "key1", - "value": "value1", - "propagate_at_launch": "true", - }), - ), - }, - testAccGroupImportStep(resourceName), - }, - }) -} - func TestAccAutoScalingGroup_simple(t *testing.T) { ctx := acctest.Context(t) var group autoscaling.Group @@ -1165,7 +1135,7 @@ func TestAccAutoScalingGroup_InstanceRefresh_triggers(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "instance_refresh.0.preferences.#", "0"), resource.TestCheckResourceAttr(resourceName, "instance_refresh.0.strategy", "Rolling"), resource.TestCheckResourceAttr(resourceName, "instance_refresh.0.triggers.#", "1"), - resource.TestCheckTypeSetElemAttr(resourceName, "instance_refresh.0.triggers.*", "tags"), + resource.TestCheckTypeSetElemAttr(resourceName, "instance_refresh.0.triggers.*", "tag"), testAccCheckInstanceRefreshCount(ctx, &group, 1), testAccCheckInstanceRefreshStatus(ctx, &group, 0, autoscaling.InstanceRefreshStatusPending, autoscaling.InstanceRefreshStatusInProgress), ), @@ -3739,24 +3709,6 @@ resource "aws_autoscaling_group" "test" { `, rName, tagKey1, tagValue1, tagPropagateAtLaunch1, tagKey2, tagValue2, tagPropagateAtLaunch2)) } -func testAccGroupConfig_deprecatedTags1(rName, tagKey1, tagValue1 string, tagPropagateAtLaunch1 bool) string { - return acctest.ConfigCompose(testAccGroupConfig_launchConfigurationBase(rName, "t2.micro"), fmt.Sprintf(` -resource "aws_autoscaling_group" "test" { - availability_zones = [data.aws_availability_zones.available.names[0]] - max_size = 0 - min_size = 0 - name = %[1]q - launch_configuration = aws_launch_configuration.test.name - - tags = [{ - "key" = %[2]q - "value" = %[3]q - "propagate_at_launch" = %[4]t - }] -} -`, rName, tagKey1, tagValue1, tagPropagateAtLaunch1)) -} - func testAccGroupConfig_simple(rName string) string { return acctest.ConfigCompose(testAccGroupConfig_launchConfigurationBase(rName, "t2.micro"), fmt.Sprintf(` resource "aws_autoscaling_group" "test" { @@ -4520,7 +4472,7 @@ resource "aws_autoscaling_group" "test" { instance_refresh { strategy = "Rolling" - triggers = ["tags"] + triggers = ["tag"] } tag { diff --git a/website/docs/r/autoscaling_group.html.markdown b/website/docs/r/autoscaling_group.html.markdown index 7291e77a0954..359f070cd17b 100644 --- a/website/docs/r/autoscaling_group.html.markdown +++ b/website/docs/r/autoscaling_group.html.markdown @@ -258,49 +258,6 @@ resource "aws_autoscaling_group" "example" { } ``` -### Interpolated tags - -```terraform -variable "extra_tags" { - default = [ - { - key = "Foo" - value = "Bar" - propagate_at_launch = true - }, - { - key = "Baz" - value = "Bam" - propagate_at_launch = true - }, - ] -} - -resource "aws_autoscaling_group" "bar" { - name = "foobar3-terraform-test" - max_size = 5 - min_size = 2 - launch_configuration = aws_launch_configuration.foobar.name - vpc_zone_identifier = [aws_subnet.example1.id, aws_subnet.example2.id] - - tags = concat( - [ - { - "key" = "interpolation1" - "value" = "value3" - "propagate_at_launch" = true - }, - { - "key" = "interpolation2" - "value" = "value4" - "propagate_at_launch" = true - }, - ], - var.extra_tags, - ) -} -``` - ### Automatically refresh all instances after the group is updated ```terraform @@ -416,8 +373,7 @@ The following arguments are supported: * `termination_policies` (Optional) List of policies to decide how the instances in the Auto Scaling Group should be terminated. The allowed values are `OldestInstance`, `NewestInstance`, `OldestLaunchConfiguration`, `ClosestToNextInstanceHour`, `OldestLaunchTemplate`, `AllocationStrategy`, `Default`. Additionally, the ARN of a Lambda function can be specified for custom termination policies. * `suspended_processes` - (Optional) List of processes to suspend for the Auto Scaling Group. The allowed values are `Launch`, `Terminate`, `HealthCheck`, `ReplaceUnhealthy`, `AZRebalance`, `AlarmNotification`, `ScheduledActions`, `AddToLoadBalancer`, `InstanceRefresh`. Note that if you suspend either the `Launch` or `Terminate` process types, it can prevent your Auto Scaling Group from functioning properly. -* `tag` (Optional) Configuration block(s) containing resource tags. Conflicts with `tags`. See [Tag](#tag-and-tags) below for more details. -* `tags` (Optional, **Deprecated** use `tag` instead) Set of maps containing resource tags. Conflicts with `tag`. See [Tags](#tag-and-tags) below for more details. +* `tag` (Optional) Configuration block(s) containing resource tags. See [Tag](#tag) below for more details. * `placement_group` (Optional) Name of the placement group into which you'll launch your instances, if any. * `metrics_granularity` - (Optional) Granularity to associate with the metrics to collect. The only valid value is `1Minute`. Default is `1Minute`. * `enabled_metrics` - (Optional) List of metrics to collect. The allowed values are defined by the [underlying AWS API](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_EnableMetricsCollection.html). @@ -611,7 +567,7 @@ This configuration block supports the following: * `min` - (Required) Minimum. * `max` - (Optional) Maximum. -### tag and tags +### tag The `tag` attribute accepts exactly one tag declaration with the following fields: @@ -620,10 +576,7 @@ The `tag` attribute accepts exactly one tag declaration with the following field * `propagate_at_launch` - (Required) Enables propagation of the tag to Amazon EC2 instances launched via this ASG -To declare multiple tags additional `tag` blocks can be specified. -Alternatively the `tags` attributes can be used, which accepts a list of maps containing the above field names as keys and their respective values. -This allows the construction of dynamic lists of tags which is not possible using the single `tag` attribute. -`tag` and `tags` are mutually exclusive, only one of them can be specified. +To declare multiple tags, additional `tag` blocks can be specified. ~> **NOTE:** Other AWS APIs may automatically add special tags to their associated Auto Scaling Group for management purposes, such as ECS Capacity Providers adding the `AmazonECSManaged` tag. These generally should be included in the configuration so Terraform does not attempt to remove them and so if the `min_size` was greater than zero on creation, that these tag(s) are applied to any initial EC2 Instances in the Auto Scaling Group. If these tag(s) were missing in the Auto Scaling Group configuration on creation, affected EC2 Instances missing the tags may require manual intervention of adding the tags to ensure they work properly with the other AWS service. From d6ace524e6f6b25855e1a940b168325b483cf86d Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 20 Apr 2023 11:18:54 -0400 Subject: [PATCH 018/304] r/aws_autoscaling_group: add dynamic tagging example --- .../docs/r/autoscaling_group.html.markdown | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/website/docs/r/autoscaling_group.html.markdown b/website/docs/r/autoscaling_group.html.markdown index 359f070cd17b..886f0b4980e3 100644 --- a/website/docs/r/autoscaling_group.html.markdown +++ b/website/docs/r/autoscaling_group.html.markdown @@ -258,6 +258,53 @@ resource "aws_autoscaling_group" "example" { } ``` +### Dynamic tagging + +```terraform +variable "extra_tags" { + default = [ + { + key = "Foo" + value = "Bar" + propagate_at_launch = true + }, + { + key = "Baz" + value = "Bam" + propagate_at_launch = true + }, + ] +} + +resource "aws_autoscaling_group" "test" { + name = "foobar3-terraform-test" + max_size = 5 + min_size = 2 + launch_configuration = aws_launch_configuration.foobar.name + vpc_zone_identifier = [aws_subnet.example1.id, aws_subnet.example2.id] + + tag { + key = "explicit1" + value = "value1" + propagate_at_launch = true + } + tag { + key = "explicit2" + value = "value2" + propagate_at_launch = true + } + + dynamic "tag" { + for_each = var.extra_tags + content { + key = tag.value.key + propagate_at_launch = tag.value.propagate_at_launch + value = tag.value.value + } + } +} +``` + ### Automatically refresh all instances after the group is updated ```terraform From f35dfa41376be1c6282d8400a5d9640e873542db Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Thu, 20 Apr 2023 13:30:34 -0400 Subject: [PATCH 019/304] chore: changelog --- .changelog/30842.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/30842.txt diff --git a/.changelog/30842.txt b/.changelog/30842.txt new file mode 100644 index 000000000000..14205ff8610a --- /dev/null +++ b/.changelog/30842.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_autoscaling_group: Remove deprecated `tags` attribute +``` From e69f1471cd35fe69039f47fedc636ccf5768d093 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 18:51:53 -0400 Subject: [PATCH 020/304] iam_policy_document: Remove source_json, override_json --- .../iam/policy_document_data_source.go | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/internal/service/iam/policy_document_data_source.go b/internal/service/iam/policy_document_data_source.go index 248308826854..3c79e46422bb 100644 --- a/internal/service/iam/policy_document_data_source.go +++ b/internal/service/iam/policy_document_data_source.go @@ -36,12 +36,6 @@ func DataSourcePolicyDocument() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "override_json": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringIsJSON, - Deprecated: "Use the attribute \"override_policy_documents\" instead.", - }, "override_policy_documents": { Type: schema.TypeList, Optional: true, @@ -54,12 +48,6 @@ func DataSourcePolicyDocument() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "source_json": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringIsJSON, - Deprecated: "Use the attribute \"source_policy_documents\" instead.", - }, "source_policy_documents": { Type: schema.TypeList, Optional: true, @@ -132,12 +120,6 @@ func dataSourcePolicyDocumentRead(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics mergedDoc := &IAMPolicyDoc{} - if v, ok := d.GetOk("source_json"); ok { - if err := json.Unmarshal([]byte(v.(string)), mergedDoc); err != nil { - return sdkdiag.AppendErrorf(diags, "writing IAM Policy Document: %s", err) - } - } - if v, ok := d.GetOk("source_policy_documents"); ok && len(v.([]interface{})) > 0 { // generate sid map to assure there are no duplicates in source jsons sidMap := make(map[string]struct{}) @@ -276,16 +258,6 @@ func dataSourcePolicyDocumentRead(ctx context.Context, d *schema.ResourceData, m } } - // merge in override_json - if v, ok := d.GetOk("override_json"); ok { - overrideDoc := &IAMPolicyDoc{} - if err := json.Unmarshal([]byte(v.(string)), overrideDoc); err != nil { - return sdkdiag.AppendErrorf(diags, "writing IAM Policy Document: merging override JSON: %s", err) - } - - mergedDoc.Merge(overrideDoc) - } - jsonDoc, err := json.MarshalIndent(mergedDoc, "", " ") if err != nil { // should never happen if the above code is correct From d2eaecf5686af477731e96bf4af260891f605d95 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 19:04:15 -0400 Subject: [PATCH 021/304] Update tests --- .changelog/30829.txt | 0 .../iam/policy_document_data_source_test.go | 86 ++----------------- 2 files changed, 8 insertions(+), 78 deletions(-) create mode 100644 .changelog/30829.txt diff --git a/.changelog/30829.txt b/.changelog/30829.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index 73883c1d387d..f41cd251c287 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -299,52 +299,6 @@ func TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON(t *testi }) } -func TestAccIAMPolicyDocumentDataSource_overrideJSONValidJSON(t *testing.T) { - ctx := acctest.Context(t) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccPolicyDocumentDataSourceConfig_overrideJSON_invalidJSON, - ExpectError: regexp.MustCompile(`"override_json" contains an invalid JSON: unexpected end of JSON input`), - }, - { - Config: testAccPolicyDocumentDataSourceConfig_overrideJSON_emptyString, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_iam_policy_document.test", "json", - testAccPolicyDocumentExpectedJSONNoStatement, - ), - ), - }, - }, - }) -} - -func TestAccIAMPolicyDocumentDataSource_sourceJSONValidJSON(t *testing.T) { - ctx := acctest.Context(t) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccPolicyDocumentDataSourceConfig_sourceJSON_invalidJSON, - ExpectError: regexp.MustCompile(`"source_json" contains an invalid JSON: unexpected end of JSON input`), - }, - { - Config: testAccPolicyDocumentDataSourceConfig_sourceJSON_emptyString, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_iam_policy_document.test", "json", - testAccPolicyDocumentExpectedJSONNoStatement, - ), - ), - }, - }, - }) -} - // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/10777 func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice(t *testing.T) { ctx := acctest.Context(t) @@ -730,7 +684,7 @@ data "aws_iam_policy_document" "test" { } data "aws_iam_policy_document" "test_source" { - source_json = data.aws_iam_policy_document.test.json + source_policy_documents = [data.aws_iam_policy_document.test.json] statement { sid = "SourceJSONTest1" @@ -885,7 +839,7 @@ var testAccPolicyDocumentSourceListExpectedJSON = `{ var testAccPolicyDocumentDataSourceConfig_blankDeprecated = ` data "aws_iam_policy_document" "test_source_blank" { - source_json = "" + source_policy_documents = [""] statement { sid = "SourceJSONTest2" @@ -917,7 +871,7 @@ data "aws_iam_policy_document" "test_source" { } data "aws_iam_policy_document" "test_source_conflicting" { - source_json = data.aws_iam_policy_document.test_source.json + source_policy_documents = [data.aws_iam_policy_document.test_source.json] statement { sid = "SourceJSONTestConflicting" @@ -994,7 +948,7 @@ data "aws_iam_policy_document" "override" { } data "aws_iam_policy_document" "test_override" { - override_json = data.aws_iam_policy_document.override.json + override_policy_documents = [data.aws_iam_policy_document.override.json] statement { actions = ["ec2:*"] @@ -1113,8 +1067,8 @@ data "aws_iam_policy_document" "override" { } data "aws_iam_policy_document" "yak_politik" { - source_json = data.aws_iam_policy_document.source.json - override_json = data.aws_iam_policy_document.override.json + source_policy_documents = [data.aws_iam_policy_document.source.json] + override_policy_documents = [data.aws_iam_policy_document.override.json] } ` @@ -1154,8 +1108,8 @@ data "aws_iam_policy_document" "override" { } data "aws_iam_policy_document" "yak_politik" { - source_json = data.aws_iam_policy_document.source.json - override_json = data.aws_iam_policy_document.override.json + source_policy_documents = [data.aws_iam_policy_document.source.json] + override_policy_documents = [data.aws_iam_policy_document.override.json] } ` @@ -1539,27 +1493,3 @@ data "aws_iam_policy_document" "test" { override_policy_documents = ["{"] } ` - -var testAccPolicyDocumentDataSourceConfig_overrideJSON_emptyString = ` -data "aws_iam_policy_document" "test" { - override_json = "" -} -` - -var testAccPolicyDocumentDataSourceConfig_overrideJSON_invalidJSON = ` -data "aws_iam_policy_document" "test" { - override_json = "{" -} -` - -var testAccPolicyDocumentDataSourceConfig_sourceJSON_emptyString = ` -data "aws_iam_policy_document" "test" { - source_json = "" -} -` - -var testAccPolicyDocumentDataSourceConfig_sourceJSON_invalidJSON = ` -data "aws_iam_policy_document" "test" { - source_json = "{" -} -` From 700a72bb7060338724900ef587eea5fc39ad249e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 19:08:09 -0400 Subject: [PATCH 022/304] Add changelog --- .changelog/30829.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.changelog/30829.txt b/.changelog/30829.txt index e69de29bb2d1..85c5d500421f 100644 --- a/.changelog/30829.txt +++ b/.changelog/30829.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change + data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead + ``` + + ```release-note:note + data-source/aws_iam_policy_document: Update configurations to use `source_policy_documents` and `override_policy_documents` instead of `source_json` and `override_json`, respectively, which have been removed + ``` \ No newline at end of file From 444d45c28f635b379ee94d2d20def64712b4b4ad Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 19:17:10 -0400 Subject: [PATCH 023/304] Update docs --- website/docs/d/iam_policy_document.html.markdown | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/website/docs/d/iam_policy_document.html.markdown b/website/docs/d/iam_policy_document.html.markdown index 6e6dc2263de0..913e54f14eb6 100644 --- a/website/docs/d/iam_policy_document.html.markdown +++ b/website/docs/d/iam_policy_document.html.markdown @@ -486,14 +486,11 @@ data "aws_iam_policy_document" "combined" { The following arguments are optional: -* `override_json` (Optional, **Deprecated** use the `override_policy_documents` attribute instead) - IAM policy document whose statements with non-blank `sid`s will override statements with the same `sid` from documents assigned to the `source_json`, `source_policy_documents`, and `override_policy_documents` arguments. Non-overriding statements will be added to the exported document. +~> **NOTE:** Statements without a `sid` cannot be overridden. In other words, a statement without a `sid` from `source_policy_documents` cannot be overridden by statements from `override_policy_documents`. -~> **NOTE:** Statements without a `sid` cannot be overridden. In other words, a statement without a `sid` from documents assigned to the `source_json` or `source_policy_documents` arguments cannot be overridden by statements from documents assigned to the `override_json` or `override_policy_documents` arguments. - -* `override_policy_documents` (Optional) - List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid` from earlier documents in the list. Statements with non-blank `sid`s will also override statements with the same `sid` from documents provided in the `source_json` and `source_policy_documents` arguments. Non-overriding statements will be added to the exported document. +* `override_policy_documents` (Optional) - List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid` from earlier documents in the list. Statements with non-blank `sid`s will also override statements with the same `sid` from `source_policy_documents`. Non-overriding statements will be added to the exported document. * `policy_id` (Optional) - ID for the policy document. -* `source_json` (Optional, **Deprecated** use the `source_policy_documents` attribute instead) - IAM policy document used as a base for the exported policy document. Statements with the same `sid` from documents assigned to the `override_json` and `override_policy_documents` arguments will override source statements. -* `source_policy_documents` (Optional) - List of IAM policy documents that are merged together into the exported document. Statements defined in `source_policy_documents` or `source_json` must have unique `sid`s. Statements with the same `sid` from documents assigned to the `override_json` and `override_policy_documents` arguments will override source statements. +* `source_policy_documents` (Optional) - List of IAM policy documents that are merged together into the exported document. Statements defined in `source_policy_documents` must have unique `sid`s. Statements with the same `sid` from `override_policy_documents` will override source statements. * `statement` (Optional) - Configuration block for a policy statement. Detailed below. * `version` (Optional) - IAM policy document version. Valid values are `2008-10-17` and `2012-10-17`. Defaults to `2012-10-17`. For more information, see the [AWS IAM User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_version.html). From 5d9a252aae93b4895248c0453b46ada87ed35275 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 18:33:56 -0400 Subject: [PATCH 024/304] autoscaling/attachment: Remove alb_target_group_arn --- internal/service/autoscaling/attachment.go | 44 ++++--------------- .../service/autoscaling/attachment_test.go | 15 ++----- .../r/autoscaling_attachment.html.markdown | 1 - 3 files changed, 12 insertions(+), 48 deletions(-) diff --git a/internal/service/autoscaling/attachment.go b/internal/service/autoscaling/attachment.go index 0658e438ad19..66ef21e11720 100644 --- a/internal/service/autoscaling/attachment.go +++ b/internal/service/autoscaling/attachment.go @@ -24,13 +24,6 @@ func ResourceAttachment() *schema.Resource { DeleteWithoutTimeout: resourceAttachmentDelete, Schema: map[string]*schema.Schema{ - "alb_target_group_arn": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - Deprecated: "Use lb_target_group_arn instead", - ExactlyOneOf: []string{"alb_target_group_arn", "elb", "lb_target_group_arn"}, - }, "autoscaling_group_name": { Type: schema.TypeString, ForceNew: true, @@ -40,13 +33,13 @@ func ResourceAttachment() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, - ExactlyOneOf: []string{"alb_target_group_arn", "elb", "lb_target_group_arn"}, + ExactlyOneOf: []string{"elb", "lb_target_group_arn"}, }, "lb_target_group_arn": { Type: schema.TypeString, ForceNew: true, Optional: true, - ExactlyOneOf: []string{"alb_target_group_arn", "elb", "lb_target_group_arn"}, + ExactlyOneOf: []string{"elb", "lb_target_group_arn"}, }, }, } @@ -75,16 +68,9 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta return sdkdiag.AppendErrorf(diags, "attaching Auto Scaling Group (%s) load balancer (%s): %s", asgName, lbName, err) } } else { - var targetGroupARN string - if v, ok := d.GetOk("alb_target_group_arn"); ok { - targetGroupARN = v.(string) - } else if v, ok := d.GetOk("lb_target_group_arn"); ok { - targetGroupARN = v.(string) - } - input := &autoscaling.AttachLoadBalancerTargetGroupsInput{ AutoScalingGroupName: aws.String(asgName), - TargetGroupARNs: aws.StringSlice([]string{targetGroupARN}), + TargetGroupARNs: aws.StringSlice([]string{d.Get("lb_target_group_arn").(string)}), } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), @@ -94,7 +80,7 @@ func resourceAttachmentCreate(ctx context.Context, d *schema.ResourceData, meta ErrCodeValidationError, "update too many") if err != nil { - return sdkdiag.AppendErrorf(diags, "attaching Auto Scaling Group (%s) target group (%s): %s", asgName, targetGroupARN, err) + return sdkdiag.AppendErrorf(diags, "attaching Auto Scaling Group (%s) target group (%s): %s", asgName, d.Get("lb_target_group_arn").(string), err) } } @@ -112,16 +98,9 @@ func resourceAttachmentRead(ctx context.Context, d *schema.ResourceData, meta in var err error if v, ok := d.GetOk("elb"); ok { - lbName := v.(string) - err = FindAttachmentByLoadBalancerName(ctx, conn, asgName, lbName) + err = FindAttachmentByLoadBalancerName(ctx, conn, asgName, v.(string)) } else { - var targetGroupARN string - if v, ok := d.GetOk("alb_target_group_arn"); ok { - targetGroupARN = v.(string) - } else if v, ok := d.GetOk("lb_target_group_arn"); ok { - targetGroupARN = v.(string) - } - err = FindAttachmentByTargetGroupARN(ctx, conn, asgName, targetGroupARN) + err = FindAttachmentByTargetGroupARN(ctx, conn, asgName, d.Get("lb_target_group_arn").(string)) } if !d.IsNewResource() && tfresource.NotFound(err) { @@ -159,16 +138,9 @@ func resourceAttachmentDelete(ctx context.Context, d *schema.ResourceData, meta return sdkdiag.AppendErrorf(diags, "detaching Auto Scaling Group (%s) load balancer (%s): %s", asgName, lbName, err) } } else { - var targetGroupARN string - if v, ok := d.GetOk("alb_target_group_arn"); ok { - targetGroupARN = v.(string) - } else if v, ok := d.GetOk("lb_target_group_arn"); ok { - targetGroupARN = v.(string) - } - input := &autoscaling.DetachLoadBalancerTargetGroupsInput{ AutoScalingGroupName: aws.String(asgName), - TargetGroupARNs: aws.StringSlice([]string{targetGroupARN}), + TargetGroupARNs: aws.StringSlice([]string{d.Get("lb_target_group_arn").(string)}), } _, err := tfresource.RetryWhenAWSErrMessageContains(ctx, d.Timeout(schema.TimeoutCreate), @@ -178,7 +150,7 @@ func resourceAttachmentDelete(ctx context.Context, d *schema.ResourceData, meta ErrCodeValidationError, "update too many") if err != nil { - return sdkdiag.AppendErrorf(diags, "detaching Auto Scaling Group (%s) target group (%s): %s", asgName, targetGroupARN, err) + return sdkdiag.AppendErrorf(diags, "detaching Auto Scaling Group (%s) target group (%s): %s", asgName, d.Get("lb_target_group_arn").(string), err) } } diff --git a/internal/service/autoscaling/attachment_test.go b/internal/service/autoscaling/attachment_test.go index 2f8ac4ff7d19..3c78e26fd4dc 100644 --- a/internal/service/autoscaling/attachment_test.go +++ b/internal/service/autoscaling/attachment_test.go @@ -128,12 +128,10 @@ func testAccCheckAttachmentDestroy(ctx context.Context) resource.TestCheckFunc { var err error - if targetGroupARN := rs.Primary.Attributes["lb_target_group_arn"]; targetGroupARN == "" { - targetGroupARN = rs.Primary.Attributes["alb_target_group_arn"] - - err = tfautoscaling.FindAttachmentByTargetGroupARN(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], targetGroupARN) + if lbName := rs.Primary.Attributes["elb"]; lbName != "" { + err = tfautoscaling.FindAttachmentByLoadBalancerName(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], lbName) } else { - err = tfautoscaling.FindAttachmentByLoadBalancerName(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.Attributes["elb"]) + err = tfautoscaling.FindAttachmentByTargetGroupARN(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.Attributes["lb_target_group_arn"]) } if tfresource.NotFound(err) { @@ -173,12 +171,7 @@ func testAccCheckAttachmentByTargetGroupARNExists(ctx context.Context, n string) conn := acctest.Provider.Meta().(*conns.AWSClient).AutoScalingConn() - targetGroupARN := rs.Primary.Attributes["lb_target_group_arn"] - if targetGroupARN == "" { - targetGroupARN = rs.Primary.Attributes["alb_target_group_arn"] - } - - return tfautoscaling.FindAttachmentByTargetGroupARN(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], targetGroupARN) + return tfautoscaling.FindAttachmentByTargetGroupARN(ctx, conn, rs.Primary.Attributes["autoscaling_group_name"], rs.Primary.Attributes["lb_target_group_arn"]) } } diff --git a/website/docs/r/autoscaling_attachment.html.markdown b/website/docs/r/autoscaling_attachment.html.markdown index 41e23031a1df..0fb26bc6f491 100644 --- a/website/docs/r/autoscaling_attachment.html.markdown +++ b/website/docs/r/autoscaling_attachment.html.markdown @@ -60,7 +60,6 @@ The following arguments are supported: * `autoscaling_group_name` - (Required) Name of ASG to associate with the ELB. * `elb` - (Optional) Name of the ELB. -* `alb_target_group_arn` - (Optional, **Deprecated** use `lb_target_group_arn` instead) ARN of an ALB Target Group. * `lb_target_group_arn` - (Optional) ARN of a load balancer target group. ## Attributes Reference From d64eca050f5b14d28ea955581db9a07ab3550550 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 18:39:19 -0400 Subject: [PATCH 025/304] Add changelog --- .changelog/30828.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/30828.txt diff --git a/.changelog/30828.txt b/.changelog/30828.txt new file mode 100644 index 000000000000..f31aee9c7656 --- /dev/null +++ b/.changelog/30828.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change +resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead +``` + +```release-note:note +resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed +``` \ No newline at end of file From 5e4fa996f6f4b8115288564070b71f7b24ef0cd3 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:26:32 +0000 Subject: [PATCH 026/304] Update CHANGELOG.md for #30828 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 866dc43d37b3..14f587aa9edf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ ENHANCEMENTS: ## 4.64.0 (April 20, 2023) +BREAKING CHANGES: + +* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + +NOTES: + +* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) From 0b35037e1691ee050b5b1f3944cdf9c4ce864006 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 18 Apr 2023 19:54:47 -0400 Subject: [PATCH 027/304] vpc/route/route_table: Remove instance_id --- internal/service/ec2/vpc_route.go | 16 ++------ internal/service/ec2/vpc_route_test.go | 56 ++------------------------ website/docs/r/route.html.markdown | 2 +- 3 files changed, 8 insertions(+), 66 deletions(-) diff --git a/internal/service/ec2/vpc_route.go b/internal/service/ec2/vpc_route.go index 28bbfc89d9d1..b26f93e3adb3 100644 --- a/internal/service/ec2/vpc_route.go +++ b/internal/service/ec2/vpc_route.go @@ -35,7 +35,6 @@ var routeValidTargets = []string{ "core_network_arn", "egress_only_gateway_id", "gateway_id", - "instance_id", "local_gateway_id", "nat_gateway_id", "network_interface_id", @@ -119,13 +118,6 @@ func ResourceRoute() *schema.Resource { Optional: true, ExactlyOneOf: routeValidTargets, }, - "instance_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Deprecated: "Use network_interface_id instead", - ExactlyOneOf: routeValidTargets, - }, "local_gateway_id": { Type: schema.TypeString, Optional: true, @@ -164,6 +156,10 @@ func ResourceRoute() *schema.Resource { // // Computed attributes. // + "instance_id": { + Type: schema.TypeString, + Computed: true, + }, "instance_owner_id": { Type: schema.TypeString, Computed: true, @@ -226,8 +222,6 @@ func resourceRouteCreate(ctx context.Context, d *schema.ResourceData, meta inter input.EgressOnlyInternetGatewayId = target case "gateway_id": input.GatewayId = target - case "instance_id": - input.InstanceId = target case "local_gateway_id": input.LocalGatewayId = target case "nat_gateway_id": @@ -385,8 +379,6 @@ func resourceRouteUpdate(ctx context.Context, d *schema.ResourceData, meta inter } else { input.GatewayId = target } - case "instance_id": - input.InstanceId = target case "local_gateway_id": input.LocalGatewayId = target case "nat_gateway_id": diff --git a/internal/service/ec2/vpc_route_test.go b/internal/service/ec2/vpc_route_test.go index 8d74cacbd274..78d2ddbeee56 100644 --- a/internal/service/ec2/vpc_route_test.go +++ b/internal/service/ec2/vpc_route_test.go @@ -1132,7 +1132,6 @@ func TestAccVPCRoute_IPv4Update_target(t *testing.T) { var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" - instanceResourceName := "aws_instance.test" igwResourceName := "aws_internet_gateway.test" eniResourceName := "aws_network_interface.test" pcxResourceName := "aws_vpc_peering_connection.test" @@ -1148,29 +1147,6 @@ func TestAccVPCRoute_IPv4Update_target(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), Steps: []resource.TestStep{ - { - Config: testAccVPCRouteConfig_ipv4FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), - Check: resource.ComposeTestCheckFunc( - testAccCheckRouteExists(ctx, resourceName, &route), - resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "core_network_arn", ""), - resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), - resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), - resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), - resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), - resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), - acctest.CheckResourceAttrAccountID(resourceName, "instance_owner_id"), - resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), - resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), - resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), - resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), - resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), - resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), - ), - }, { Config: testAccVPCRouteConfig_ipv4FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( @@ -1352,7 +1328,6 @@ func TestAccVPCRoute_IPv6Update_target(t *testing.T) { var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" - instanceResourceName := "aws_instance.test" igwResourceName := "aws_internet_gateway.test" eniResourceName := "aws_network_interface.test" pcxResourceName := "aws_vpc_peering_connection.test" @@ -1366,29 +1341,6 @@ func TestAccVPCRoute_IPv6Update_target(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), Steps: []resource.TestStep{ - { - Config: testAccVPCRouteConfig_ipv6FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), - Check: resource.ComposeTestCheckFunc( - testAccCheckRouteExists(ctx, resourceName, &route), - resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "core_network_arn", ""), - resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), - resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), - resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), - resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), - resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), - acctest.CheckResourceAttrAccountID(resourceName, "instance_owner_id"), - resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), - resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), - resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), - resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), - resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), - resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), - ), - }, { Config: testAccVPCRouteConfig_ipv6FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( @@ -2508,7 +2460,7 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_ipv6_cidr_block = %[2]q - instance_id = aws_instance.test.id + network_interface_id = aws_instance.test.primary_network_interface_id } `, rName, destinationCidr)) } @@ -2836,7 +2788,7 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q - instance_id = aws_instance.test.id + network_interface_id = aws_instance.test.primary_network_interface_id } `, rName, destinationCidr)) } @@ -3659,7 +3611,6 @@ resource "aws_route" "test" { egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null - instance_id = (local.target_attr == "instance_id") ? local.target_value : null local_gateway_id = (local.target_attr == "local_gateway_id") ? local.target_value : null nat_gateway_id = (local.target_attr == "nat_gateway_id") ? local.target_value : null network_interface_id = (local.target_attr == "network_interface_id") ? local.target_value : null @@ -3780,7 +3731,6 @@ resource "aws_route" "test" { egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null - instance_id = (local.target_attr == "instance_id") ? local.target_value : null local_gateway_id = (local.target_attr == "local_gateway_id") ? local.target_value : null nat_gateway_id = (local.target_attr == "nat_gateway_id") ? local.target_value : null network_interface_id = (local.target_attr == "network_interface_id") ? local.target_value : null @@ -4006,7 +3956,7 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_prefix_list_id = aws_ec2_managed_prefix_list.test.id - instance_id = aws_instance.test.id + network_interface_id = aws_instance.test.primary_network_interface_id } `, rName)) } diff --git a/website/docs/r/route.html.markdown b/website/docs/r/route.html.markdown index 7081b110a62a..7dd9326d0b69 100644 --- a/website/docs/r/route.html.markdown +++ b/website/docs/r/route.html.markdown @@ -62,7 +62,6 @@ One of the following target arguments must be supplied: * `core_network_arn` - (Optional) The Amazon Resource Name (ARN) of a core network. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. Specify `local` when updating a previously [imported](#import) local route. -* `instance_id` - (Optional, **Deprecated** use `network_interface_id` instead) Identifier of an EC2 instance. * `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `local_gateway_id` - (Optional) Identifier of a Outpost local gateway. * `network_interface_id` - (Optional) Identifier of an EC2 network interface. @@ -79,6 +78,7 @@ In addition to all arguments above, the following attributes are exported: ~> **NOTE:** Only the arguments that are configured (one of the above) will be exported as an attribute once the resource is created. * `id` - Route identifier computed from the routing table identifier and route destination. +* `instance_id` - Identifier of an EC2 instance. * `instance_owner_id` - The AWS account ID of the owner of the EC2 instance. * `origin` - How the route was created - `CreateRouteTable`, `CreateRoute` or `EnableVgwRoutePropagation`. * `state` - The state of the route - `active` or `blackhole`. From deb071c7d3317f8ddabb811d685f8c99a679855c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 11:32:26 -0400 Subject: [PATCH 028/304] Add changelog --- .changelog/30804.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/30804.txt diff --git a/.changelog/30804.txt b/.changelog/30804.txt new file mode 100644 index 000000000000..8ab1ab3779f8 --- /dev/null +++ b/.changelog/30804.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_route: Remove `instance_id` as a configurable argument (although it remains as a computed attribute) +``` + +```release-note:note +resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead, for example, set to `aws_instance.test.primary_network_interface_id` +``` + +```release-note:breaking-change +resource/aws_route: `instance_id` cannot be set in configurations +``` \ No newline at end of file From 3170380389674a33675d3d5998732a2034ec2803 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 15:01:02 -0400 Subject: [PATCH 029/304] route_table: Remove instance_id --- .changelog/30804.txt | 4 +- internal/service/ec2/vpc_route_table.go | 26 +-------- internal/service/ec2/vpc_route_table_test.go | 61 ++++++++++---------- 3 files changed, 33 insertions(+), 58 deletions(-) diff --git a/.changelog/30804.txt b/.changelog/30804.txt index 8ab1ab3779f8..ffc7920d722f 100644 --- a/.changelog/30804.txt +++ b/.changelog/30804.txt @@ -3,9 +3,9 @@ resource/aws_route: Remove `instance_id` as a configurable argument (although it ``` ```release-note:note -resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead, for example, set to `aws_instance.test.primary_network_interface_id` +resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` ```release-note:breaking-change -resource/aws_route: `instance_id` cannot be set in configurations +resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_route_table.go b/internal/service/ec2/vpc_route_table.go index 0004a6a14013..b1432e8f8bed 100644 --- a/internal/service/ec2/vpc_route_table.go +++ b/internal/service/ec2/vpc_route_table.go @@ -34,7 +34,6 @@ var routeTableValidTargets = []string{ "core_network_arn", "egress_only_gateway_id", "gateway_id", - "instance_id", "local_gateway_id", "nat_gateway_id", "network_interface_id", @@ -119,11 +118,6 @@ func ResourceRouteTable() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "instance_id": { - Type: schema.TypeString, - Optional: true, - Deprecated: "Use network_interface_id instead", - }, "local_gateway_id": { Type: schema.TypeString, Optional: true, @@ -424,12 +418,6 @@ func resourceRouteTableHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } - instanceSet := false - if v, ok := m["instance_id"]; ok { - instanceSet = v.(string) != "" - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - if v, ok := m["transit_gateway_id"]; ok { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } @@ -446,7 +434,7 @@ func resourceRouteTableHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } - if v, ok := m["network_interface_id"]; ok && !(instanceSet || natGatewaySet) { + if v, ok := m["network_interface_id"]; ok && !natGatewaySet { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } @@ -665,10 +653,6 @@ func expandCreateRouteInput(tfMap map[string]interface{}) *ec2.CreateRouteInput apiObject.GatewayId = aws.String(v) } - if v, ok := tfMap["instance_id"].(string); ok && v != "" { - apiObject.InstanceId = aws.String(v) - } - if v, ok := tfMap["local_gateway_id"].(string); ok && v != "" { apiObject.LocalGatewayId = aws.String(v) } @@ -731,10 +715,6 @@ func expandReplaceRouteInput(tfMap map[string]interface{}) *ec2.ReplaceRouteInpu apiObject.GatewayId = aws.String(v) } - if v, ok := tfMap["instance_id"].(string); ok && v != "" { - apiObject.InstanceId = aws.String(v) - } - if v, ok := tfMap["local_gateway_id"].(string); ok && v != "" { apiObject.LocalGatewayId = aws.String(v) } @@ -801,10 +781,6 @@ func flattenRoute(apiObject *ec2.Route) map[string]interface{} { } } - if v := apiObject.InstanceId; v != nil { - tfMap["instance_id"] = aws.StringValue(v) - } - if v := apiObject.LocalGatewayId; v != nil { tfMap["local_gateway_id"] = aws.StringValue(v) } diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 1841a2d4a880..13421970759c 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -178,7 +178,7 @@ func TestAccVPCRouteTable_ipv4ToInstance(t *testing.T) { acctest.CheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), - testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr, "instance_id", instanceResourceName, "id"), + testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr, "network_interface_id", instanceResourceName, "primary_network_interface_id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), ), @@ -296,7 +296,7 @@ func TestAccVPCRouteTable_requireRouteDestination(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccVPCRouteTableConfig_noDestination(rName), - ExpectError: regexp.MustCompile("error creating route: one of `cidr_block"), + ExpectError: regexp.MustCompile("creating route: one of `cidr_block"), }, }, }) @@ -963,9 +963,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccVPCRouteTableConfig_multiples(rName, - "cidr_block", destinationCidr1, "gateway_id", igwResourceName, - "cidr_block", destinationCidr2, "instance_id", instanceResourceName, - "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName), + "cidr_block", destinationCidr1, "gateway_id", igwResourceName, "id", + "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id", + "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -974,7 +974,7 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "3"), testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr1, "gateway_id", igwResourceName, "id"), - testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr2, "instance_id", instanceResourceName, "id"), + testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id"), testAccCheckRouteTableRoute(resourceName, "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), @@ -982,9 +982,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { }, { Config: testAccVPCRouteTableConfig_multiples(rName, - "cidr_block", destinationCidr1, "vpc_peering_connection_id", pcxResourceName, - "cidr_block", destinationCidr3, "instance_id", instanceResourceName, - "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName), + "cidr_block", destinationCidr1, "vpc_peering_connection_id", pcxResourceName, "id", + "cidr_block", destinationCidr3, "network_interface_id", instanceResourceName, "primary_network_interface_id", + "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -993,7 +993,7 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "3"), testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr1, "vpc_peering_connection_id", pcxResourceName, "id"), - testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr3, "instance_id", instanceResourceName, "id"), + testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr3, "network_interface_id", instanceResourceName, "primary_network_interface_id"), testAccCheckRouteTableRoute(resourceName, "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), @@ -1001,9 +1001,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { }, { Config: testAccVPCRouteTableConfig_multiples(rName, - "ipv6_cidr_block", destinationCidr4, "vpc_peering_connection_id", pcxResourceName, - "cidr_block", destinationCidr3, "gateway_id", igwResourceName, - "cidr_block", destinationCidr2, "instance_id", instanceResourceName), + "ipv6_cidr_block", destinationCidr4, "vpc_peering_connection_id", pcxResourceName, "id", + "cidr_block", destinationCidr3, "gateway_id", igwResourceName, "id", + "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id"), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -1013,7 +1013,7 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "route.#", "3"), testAccCheckRouteTableRoute(resourceName, "ipv6_cidr_block", destinationCidr4, "vpc_peering_connection_id", pcxResourceName, "id"), testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr3, "gateway_id", igwResourceName, "id"), - testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr2, "instance_id", instanceResourceName, "id"), + testAccCheckRouteTableRoute(resourceName, "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), ), @@ -1379,8 +1379,8 @@ resource "aws_route_table" "test" { vpc_id = aws_vpc.test.id route { - cidr_block = %[2]q - instance_id = aws_instance.test.id + cidr_block = %[2]q + network_interface_id = aws_instance.test.primary_network_interface_id } tags = { @@ -1523,7 +1523,7 @@ resource "aws_route_table" "test" { vpc_id = aws_vpc.test.id route { - instance_id = aws_instance.test.id + network_interface_id = aws_instance.test.primary_network_interface_id } tags = { @@ -2132,9 +2132,9 @@ resource "aws_vpc_endpoint" "test" { } func testAccVPCRouteTableConfig_multiples(rName, - destinationAttr1, destinationValue1, targetAttribute1, targetValue1, - destinationAttr2, destinationValue2, targetAttribute2, targetValue2, - destinationAttr3, destinationValue3, targetAttribute3, targetValue3 string) string { + destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, + destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, + destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3 string) string { return acctest.ConfigCompose( testAccLatestAmazonNatInstanceAMIConfig(), acctest.ConfigAvailableAZsNoOptInDefaultExclude(), @@ -2209,19 +2209,19 @@ locals { destination_attr = %[2]q destination_value = %[3]q target_attr = %[4]q - target_value = %[5]s.id + target_value = %[5]s.%[6]s }, { - destination_attr = %[6]q - destination_value = %[7]q - target_attr = %[8]q - target_value = %[9]s.id + destination_attr = %[7]q + destination_value = %[8]q + target_attr = %[9]q + target_value = %[10]s.%[11]s }, { - destination_attr = %[10]q - destination_value = %[11]q - target_attr = %[12]q - target_value = %[13]s.id + destination_attr = %[12]q + destination_value = %[13]q + target_attr = %[14]q + target_value = %[15]s.%[16]s } ] } @@ -2240,7 +2240,6 @@ resource "aws_route_table" "test" { carrier_gateway_id = (route.value["target_attr"] == "carrier_gateway_id") ? route.value["target_value"] : null egress_only_gateway_id = (route.value["target_attr"] == "egress_only_gateway_id") ? route.value["target_value"] : null gateway_id = (route.value["target_attr"] == "gateway_id") ? route.value["target_value"] : null - instance_id = (route.value["target_attr"] == "instance_id") ? route.value["target_value"] : null local_gateway_id = (route.value["target_attr"] == "local_gateway_id") ? route.value["target_value"] : null nat_gateway_id = (route.value["target_attr"] == "nat_gateway_id") ? route.value["target_value"] : null network_interface_id = (route.value["target_attr"] == "network_interface_id") ? route.value["target_value"] : null @@ -2254,7 +2253,7 @@ resource "aws_route_table" "test" { Name = %[1]q } } -`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3)) +`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3)) } // testAccLatestAmazonNatInstanceAMIConfig returns the configuration for a data source that From 17ad09d6a70113c13b35a7f98e8742914f90c538 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 15:03:39 -0400 Subject: [PATCH 030/304] Update docs, changelog --- .changelog/30804.txt | 12 ++++++++++++ website/docs/r/route_table.html.markdown | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.changelog/30804.txt b/.changelog/30804.txt index ffc7920d722f..cc9b3effa7d9 100644 --- a/.changelog/30804.txt +++ b/.changelog/30804.txt @@ -8,4 +8,16 @@ resource/aws_route: Since `instance_id` can no longer be set in configurations, ```release-note:breaking-change resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. +``` + +```release-note:enhancement +resource/aws_route_table: Remove `route.*.instance_id` as a configurable argument +``` + +```release-note:note +resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. +``` + +```release-note:breaking-change +resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` \ No newline at end of file diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index 235bf5d15039..000b6306ec4c 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -91,7 +91,6 @@ One of the following target arguments must be supplied: * `core_network_arn` - (Optional) The Amazon Resource Name (ARN) of a core network. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. -* `instance_id` - (Optional, **Deprecated** use `network_interface_id` instead) Identifier of an EC2 instance. * `local_gateway_id` - (Optional) Identifier of a Outpost local gateway. * `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `network_interface_id` - (Optional) Identifier of an EC2 network interface. From 801b911e845afe390a79c749805b095d52e60b32 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 15:51:21 -0400 Subject: [PATCH 031/304] Work on lints --- internal/service/ec2/vpc_route_table_test.go | 57 +------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 13421970759c..51f5bc33dfcb 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -314,7 +314,7 @@ func TestAccVPCRouteTable_requireRouteTarget(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccVPCRouteTableConfig_noTarget(rName), - ExpectError: regexp.MustCompile(`error creating route: one of .*\begress_only_gateway_id\b`), + ExpectError: regexp.MustCompile(`creating route: one of .*\begress_only_gateway_id\b`), }, }, }) @@ -867,40 +867,6 @@ func TestAccVPCRouteTable_vpcMultipleCIDRs(t *testing.T) { }) } -func TestAccVPCRouteTable_vpcClassicLink(t *testing.T) { - ctx := acctest.Context(t) - var routeTable ec2.RouteTable - resourceName := "aws_route_table.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckRouteDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccVPCRouteTableConfig_classicLink(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableExists(ctx, resourceName, &routeTable), - testAccCheckRouteTableNumberOfRoutes(&routeTable, 2), - acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), - acctest.CheckResourceAttrAccountID(resourceName, "owner_id"), - resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), - resource.TestCheckResourceAttr(resourceName, "route.#", "0"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccVPCRouteTable_gatewayVPCEndpoint(t *testing.T) { ctx := acctest.Context(t) var routeTable ec2.RouteTable @@ -2082,27 +2048,6 @@ resource "aws_route_table" "test" { `, rName) } -func testAccVPCRouteTableConfig_classicLink(rName string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - enable_classiclink = true - - tags = { - Name = %[1]q - } -} - -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} -`, rName) -} - func testAccVPCRouteTableConfig_gatewayEndpoint(rName string) string { return fmt.Sprintf(` resource "aws_vpc" "test" { From d58233d93feedbb866451f4a4b96291e44cce1ea Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 16:06:15 -0400 Subject: [PATCH 032/304] Work around terrafmt limits --- internal/service/ec2/vpc_route_table_test.go | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 51f5bc33dfcb..125e9cb73007 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -929,9 +929,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccVPCRouteTableConfig_multiples(rName, - "cidr_block", destinationCidr1, "gateway_id", igwResourceName, "id", - "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id", - "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), + "cidr_block", destinationCidr1, "gateway_id", fmt.Sprintf(`%s.%s`, igwResourceName, "id"), + "cidr_block", destinationCidr2, "network_interface_id", fmt.Sprintf(`%s.%s`, instanceResourceName, "primary_network_interface_id"), + "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", fmt.Sprintf(`%s.%s`, eoigwResourceName, "id")), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -948,9 +948,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { }, { Config: testAccVPCRouteTableConfig_multiples(rName, - "cidr_block", destinationCidr1, "vpc_peering_connection_id", pcxResourceName, "id", - "cidr_block", destinationCidr3, "network_interface_id", instanceResourceName, "primary_network_interface_id", - "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", eoigwResourceName, "id"), + "cidr_block", destinationCidr1, "vpc_peering_connection_id", fmt.Sprintf(`%s.%s`, pcxResourceName, "id"), + "cidr_block", destinationCidr3, "network_interface_id", fmt.Sprintf(`%s.%s`, instanceResourceName, "primary_network_interface_id"), + "ipv6_cidr_block", destinationCidr4, "egress_only_gateway_id", fmt.Sprintf(`%s.%s`, eoigwResourceName, "id")), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -967,9 +967,9 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { }, { Config: testAccVPCRouteTableConfig_multiples(rName, - "ipv6_cidr_block", destinationCidr4, "vpc_peering_connection_id", pcxResourceName, "id", - "cidr_block", destinationCidr3, "gateway_id", igwResourceName, "id", - "cidr_block", destinationCidr2, "network_interface_id", instanceResourceName, "primary_network_interface_id"), + "ipv6_cidr_block", destinationCidr4, "vpc_peering_connection_id", fmt.Sprintf(`%s.%s`, pcxResourceName, "id"), + "cidr_block", destinationCidr3, "gateway_id", fmt.Sprintf(`%s.%s`, igwResourceName, "id"), + "cidr_block", destinationCidr2, "network_interface_id", fmt.Sprintf(`%s.%s`, instanceResourceName, "primary_network_interface_id")), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(ctx, resourceName, &routeTable), testAccCheckRouteTableNumberOfRoutes(&routeTable, 5), @@ -2077,9 +2077,9 @@ resource "aws_vpc_endpoint" "test" { } func testAccVPCRouteTableConfig_multiples(rName, - destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, - destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, - destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3 string) string { + destinationAttr1, destinationValue1, targetAttribute1, targetValue1, + destinationAttr2, destinationValue2, targetAttribute2, targetValue2, + destinationAttr3, destinationValue3, targetAttribute3, targetValue3 string) string { return acctest.ConfigCompose( testAccLatestAmazonNatInstanceAMIConfig(), acctest.ConfigAvailableAZsNoOptInDefaultExclude(), @@ -2154,19 +2154,19 @@ locals { destination_attr = %[2]q destination_value = %[3]q target_attr = %[4]q - target_value = %[5]s.%[6]s + target_value = %[5]s }, { - destination_attr = %[7]q - destination_value = %[8]q - target_attr = %[9]q - target_value = %[10]s.%[11]s + destination_attr = %[6]q + destination_value = %[7]q + target_attr = %[8]q + target_value = %[9]s }, { - destination_attr = %[12]q - destination_value = %[13]q - target_attr = %[14]q - target_value = %[15]s.%[16]s + destination_attr = %[10]q + destination_value = %[11]q + target_attr = %[12]q + target_value = %[13]s } ] } @@ -2198,7 +2198,7 @@ resource "aws_route_table" "test" { Name = %[1]q } } -`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3)) +`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3)) } // testAccLatestAmazonNatInstanceAMIConfig returns the configuration for a data source that From 8e7a52206917ea5f375dcab9dbd5f086d4d90f76 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:31:34 +0000 Subject: [PATCH 033/304] Update CHANGELOG.md for #30804 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14f587aa9edf..19962f19437b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,14 @@ BREAKING CHANGES: * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) NOTES: * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) FEATURES: @@ -65,6 +69,8 @@ ENHANCEMENTS: * resource/aws_lambda_layer_version: Add support for `python3.10` `compatible_runtimes` value ([#30781](https://github.com/hashicorp/terraform-provider-aws/issues/30781)) * resource/aws_main_route_table_association: Add configurable timeouts ([#30755](https://github.com/hashicorp/terraform-provider-aws/issues/30755)) * resource/aws_route: Allow `gateway_id` value of `local` when updating a Route ([#24507](https://github.com/hashicorp/terraform-provider-aws/issues/24507)) +* resource/aws_route: Remove `instance_id` as a configurable argument (although it remains as a computed attribute) ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: Remove `route.*.instance_id` as a configurable argument ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table_association: Add configurable timeouts ([#30755](https://github.com/hashicorp/terraform-provider-aws/issues/30755)) * resource/aws_s3_bucket: Correct S3 Object Lock error handling for third-party S3-compatible API implementations ([#26317](https://github.com/hashicorp/terraform-provider-aws/issues/26317)) * resource/aws_s3_bucket_object_lock_configuration: Correct error handling for third-party S3-compatible API implementations ([#26317](https://github.com/hashicorp/terraform-provider-aws/issues/26317)) From 41b1e92d95651f98dbf44d63455d19f6b9977080 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:26:32 +0000 Subject: [PATCH 034/304] Update CHANGELOG.md for #30828 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19962f19437b..8827de51cea5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,15 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +BREAKING CHANGES: + +* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + +NOTES: + +* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) From f05479114afc0d34bf896186c29cd1ca1d978466 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 11:32:26 -0400 Subject: [PATCH 035/304] Add changelog --- .changelog/30804.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.changelog/30804.txt b/.changelog/30804.txt index cc9b3effa7d9..4b9cb8701fa6 100644 --- a/.changelog/30804.txt +++ b/.changelog/30804.txt @@ -1,6 +1,3 @@ -```release-note:enhancement -resource/aws_route: Remove `instance_id` as a configurable argument (although it remains as a computed attribute) -``` ```release-note:note resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. @@ -10,9 +7,6 @@ resource/aws_route: Since `instance_id` can no longer be set in configurations, resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` -```release-note:enhancement -resource/aws_route_table: Remove `route.*.instance_id` as a configurable argument -``` ```release-note:note resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. From 1c0e30778baff6c8fad3b72115033b6d899346e4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 15:01:02 -0400 Subject: [PATCH 036/304] route_table: Remove instance_id --- .changelog/30804.txt | 1 - internal/service/ec2/vpc_route_table_test.go | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.changelog/30804.txt b/.changelog/30804.txt index 4b9cb8701fa6..80b191cf4688 100644 --- a/.changelog/30804.txt +++ b/.changelog/30804.txt @@ -7,7 +7,6 @@ resource/aws_route: Since `instance_id` can no longer be set in configurations, resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` - ```release-note:note resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ``` diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 125e9cb73007..7c0083eec58c 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -2077,9 +2077,9 @@ resource "aws_vpc_endpoint" "test" { } func testAccVPCRouteTableConfig_multiples(rName, - destinationAttr1, destinationValue1, targetAttribute1, targetValue1, - destinationAttr2, destinationValue2, targetAttribute2, targetValue2, - destinationAttr3, destinationValue3, targetAttribute3, targetValue3 string) string { + destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, + destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, + destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3 string) string { return acctest.ConfigCompose( testAccLatestAmazonNatInstanceAMIConfig(), acctest.ConfigAvailableAZsNoOptInDefaultExclude(), @@ -2198,7 +2198,7 @@ resource "aws_route_table" "test" { Name = %[1]q } } -`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3)) +`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3)) } // testAccLatestAmazonNatInstanceAMIConfig returns the configuration for a data source that From 4a8df746e84cbffb418d7ba5b4e6c2e1e40974c6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 19 Apr 2023 16:06:15 -0400 Subject: [PATCH 037/304] Work around terrafmt limits --- internal/service/ec2/vpc_route_table_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 7c0083eec58c..125e9cb73007 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -2077,9 +2077,9 @@ resource "aws_vpc_endpoint" "test" { } func testAccVPCRouteTableConfig_multiples(rName, - destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, - destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, - destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3 string) string { + destinationAttr1, destinationValue1, targetAttribute1, targetValue1, + destinationAttr2, destinationValue2, targetAttribute2, targetValue2, + destinationAttr3, destinationValue3, targetAttribute3, targetValue3 string) string { return acctest.ConfigCompose( testAccLatestAmazonNatInstanceAMIConfig(), acctest.ConfigAvailableAZsNoOptInDefaultExclude(), @@ -2198,7 +2198,7 @@ resource "aws_route_table" "test" { Name = %[1]q } } -`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, targetID1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, targetID2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3, targetID3)) +`, rName, destinationAttr1, destinationValue1, targetAttribute1, targetValue1, destinationAttr2, destinationValue2, targetAttribute2, targetValue2, destinationAttr3, destinationValue3, targetAttribute3, targetValue3)) } // testAccLatestAmazonNatInstanceAMIConfig returns the configuration for a data source that From 71b98680c95bc4f3550ee556d364f09dc351aeb3 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:31:34 +0000 Subject: [PATCH 038/304] Update CHANGELOG.md for #30804 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8827de51cea5..b5ac9b57ed63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,10 +28,14 @@ BREAKING CHANGES: * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) NOTES: * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) FEATURES: From 0ecb3c322e116d82dcbac2446c221bace4a4f9da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 20 Apr 2023 13:35:56 -0400 Subject: [PATCH 039/304] Update changelog --- CHANGELOG.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5ac9b57ed63..25df38e0e136 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,19 +24,6 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) -BREAKING CHANGES: - -* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) -* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) -* resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) -* resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) - -NOTES: - -* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) -* resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) -* resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) - FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) @@ -82,8 +69,6 @@ ENHANCEMENTS: * resource/aws_lambda_layer_version: Add support for `python3.10` `compatible_runtimes` value ([#30781](https://github.com/hashicorp/terraform-provider-aws/issues/30781)) * resource/aws_main_route_table_association: Add configurable timeouts ([#30755](https://github.com/hashicorp/terraform-provider-aws/issues/30755)) * resource/aws_route: Allow `gateway_id` value of `local` when updating a Route ([#24507](https://github.com/hashicorp/terraform-provider-aws/issues/24507)) -* resource/aws_route: Remove `instance_id` as a configurable argument (although it remains as a computed attribute) ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) -* resource/aws_route_table: Remove `route.*.instance_id` as a configurable argument ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table_association: Add configurable timeouts ([#30755](https://github.com/hashicorp/terraform-provider-aws/issues/30755)) * resource/aws_s3_bucket: Correct S3 Object Lock error handling for third-party S3-compatible API implementations ([#26317](https://github.com/hashicorp/terraform-provider-aws/issues/26317)) * resource/aws_s3_bucket_object_lock_configuration: Correct error handling for third-party S3-compatible API implementations ([#26317](https://github.com/hashicorp/terraform-provider-aws/issues/26317)) From 547c902244a888fa568c29dfb0bc9f6cf041134a Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:26:32 +0000 Subject: [PATCH 040/304] Update CHANGELOG.md for #30828 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25df38e0e136..851a106395ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,15 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +BREAKING CHANGES: + +* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + +NOTES: + +* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) From 339cd32e5d08f7834f174d4acafc194846baea65 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 20 Apr 2023 16:26:32 +0000 Subject: [PATCH 041/304] Update CHANGELOG.md for #30828 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 851a106395ce..8dc744711650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,15 @@ NOTES: * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +BREAKING CHANGES: + +* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + +NOTES: + +* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) + FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) From cc4cc7a7bf8899cf4c78e4196f816c3348f6459a Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 13 Apr 2023 17:15:36 -0500 Subject: [PATCH 042/304] WIP --- internal/provider/intercept.go | 194 ++++++++++++++++++++++++++------ internal/tags/context.go | 4 +- internal/tags/key_value_tags.go | 22 +++- internal/verify/diff.go | 26 ++++- 4 files changed, 206 insertions(+), 40 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index c7e061b93fa8..8d97eecf2367 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -228,44 +228,46 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a break } - if d.HasChange(names.AttrTagsAll) { - if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute != "" { - var identifier string - if identifierAttribute == "id" { - identifier = d.Id() - } else { - identifier = d.Get(identifierAttribute).(string) - } - o, n := d.GetChange(names.AttrTagsAll) - - // If the service package has a generic resource update tags methods, call it. - var err error - - if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, any, any) error - }); ok { - err = v.UpdateTags(ctx, meta, identifier, o, n) - } else if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, string, any, any) error - }); ok && r.tags.ResourceType != "" { - err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, o, n) - } + if d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { + if d.HasChange(names.AttrTagsAll) { + if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute != "" { + var identifier string + if identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + o, n := d.GetChange(names.AttrTagsAll) + + // If the service package has a generic resource update tags methods, call it. + var err error + + if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, any, any) error + }); ok { + err = v.UpdateTags(ctx, meta, identifier, o, n) + } else if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, string, any, any) error + }); ok && r.tags.ResourceType != "" { + err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, o, n) + } - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ - r.tags.IdentifierAttribute: identifier, - "error": err.Error(), - }) + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ + r.tags.IdentifierAttribute: identifier, + "error": err.Error(), + }) - return ctx, diags - } + return ctx, diags + } - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } } + // TODO If the only change was to tags it would be nice to not call the resource's U handler. } - // TODO If the only change was to tags it would be nice to not call the resource's U handler. } } case After: @@ -337,6 +339,132 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a if err := d.Set(names.AttrTagsAll, tags.Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) } + + if why == Create { + break + } + } + fallthrough + case Finally: + switch why { + case Update: + // Merge the resource's configured tags with any provider configured default_tags. + tags := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, d.Get(names.AttrTags).(map[string]interface{}))) + // Remove system tags. + tags = tags.IgnoreSystem(inContext.ServicePackageName) + + tagsInContext.TagsIn = types.Some(tags) + + if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { + + configTags := make(map[string]string) + if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { + c := config.GetAttr("tags") + for k, v := range c.AsValueMap() { + configTags[k] = v.AsString() + } + } + + stateTags := make(map[string]string) + if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { + s := state.GetAttr("tags_all") + for k, v := range s.AsValueMap() { + stateTags[k] = v.AsString() + } + } + + tagsAll := stateTags + // if tags_all was computed because not wholly known + // Merge the resource's configured tags with any provider configured default_tags. + toAdd := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) + // Remove system tags. + toAdd = toAdd.IgnoreSystem(inContext.ServicePackageName) + + tflog.Debug(ctx, "all_tags", map[string]interface{}{ + "to_add": configTags, + "to_remove": tagsAll, + }) + + var identifier string + if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + // If the service package has a generic resource update tags methods, call it. + var err error + + if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, any, any) error + }); ok { + tflog.Debug(ctx, "finally_not_getting_here", map[string]interface{}{ + "to_add": configTags, + "to_remove": tagsAll, + }) + err = v.UpdateTags(ctx, meta, identifier, tagsAll, toAdd) + } else if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, string, any, any) error + }); ok && r.tags.ResourceType != "" { + err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, tagsAll, toAdd) + } + + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ + r.tags.IdentifierAttribute: identifier, + "error": err.Error(), + }) + + return ctx, diags + } + + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } + // + //if v, ok := sp.(interface { + // ListTags(context.Context, any, string) error + //}); ok { + // err = v.ListTags(ctx, meta, identifier) // Sets tags in Context + //} else if v, ok := sp.(interface { + // ListTags(context.Context, any, string, string) error + //}); ok && r.tags.ResourceType != "" { + // err = v.ListTags(ctx, meta, identifier, r.tags.ResourceType) // Sets tags in Context + //} + // + //if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // // ISO partitions may not support tagging, giving error + // tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ + // r.tags.IdentifierAttribute: d.Id(), + // "error": err.Error(), + // }) + // return ctx, diags + //} + // + //if inContext.ServicePackageName == names.DynamoDB && err != nil { + // // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. + // if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + // err = nil + // } + //} + // + //if err != nil { + // return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + //} + + //// Remove any provider configured ignore_tags and system tags from those returned from the service API. + // tags = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) + + // The resource's configured tags do not include any provider configured default_tags. + if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) + } + + // Computed tags_all do. + if err := d.Set(names.AttrTagsAll, tags.Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) + } + } } } diff --git a/internal/tags/context.go b/internal/tags/context.go index 9b1329f061bc..f0bd6cf85780 100644 --- a/internal/tags/context.go +++ b/internal/tags/context.go @@ -13,7 +13,8 @@ type InContext struct { // TagsIn holds tags specified in configuration. Typically this field includes any default tags and excludes system tags. TagsIn types.Option[KeyValueTags] // TagsOut holds tags returned from AWS, including any ignored or system tags. - TagsOut types.Option[KeyValueTags] + TagsOut types.Option[KeyValueTags] + TagsAllDiff types.Option[KeyValueTags] } // NewContext returns a Context enhanced with tagging information. @@ -23,6 +24,7 @@ func NewContext(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig IgnoreConfig: ignoreConfig, TagsIn: types.None[KeyValueTags](), TagsOut: types.None[KeyValueTags](), + TagsAllDiff: types.None[KeyValueTags](), } return context.WithValue(ctx, tagKey, &v) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 4708d5ca79cb..247c35f700ce 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -410,15 +410,29 @@ func (tags KeyValueTags) Chunks(size int) []KeyValueTags { // ContainsAll returns whether or not all the target tags are contained. func (tags KeyValueTags) ContainsAll(target KeyValueTags) bool { - for key, value := range target { - if v, ok := tags[key]; !ok || !v.Equal(value) { - return false - } + //for key, value := range target { + // if v, ok := tags[key]; !ok || !v.Equal(value) { + // return false + // } + //} + + if !reflect.DeepEqual(tags, target) { + return false } return true } +func (tags KeyValueTags) HasZeroValue() bool { + for _, v := range tags.Map() { + if v == "" { + return true + } + } + + return false +} + // Equal returns whether or two sets of key-value tags are equal. func (tags KeyValueTags) Equal(other KeyValueTags) bool { if tags == nil && other == nil { diff --git a/internal/verify/diff.go b/internal/verify/diff.go index f821cf2bb3c1..9cd532d75c22 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -38,7 +38,30 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ // or a change for "tags_all". // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18366 // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/19005 - if len(allTags) > 0 { + + //if len(allTags) > 0 { + // if err := diff.SetNew("tags_all", allTags.Map()); err != nil { + // return fmt.Errorf("error setting new tags_all diff: %w", err) + // } + //} else if allTags.HasZeroValue() { + // if err := diff.SetNewComputed("tags_all"); err != nil { + // return fmt.Errorf("error setting tags_all to computed: %w", err) + // } + //} else if len(diff.Get("tags_all").(map[string]interface{})) > 0 { + // if err := diff.SetNewComputed("tags_all"); err != nil { + // return fmt.Errorf("error setting tags_all to computed: %w", err) + // } + //} else if diff.HasChange("tags_all") { + // if err := diff.SetNewComputed("tags_all"); err != nil { + // return fmt.Errorf("error setting tags_all to computed: %w", err) + // } + //} + + if allTags.HasZeroValue() { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } + } else if len(allTags) > 0 { if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } @@ -51,7 +74,6 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ return fmt.Errorf("error setting tags_all to computed: %w", err) } } - return nil } From 6bf724958932695dee278a7433c0f7bb7758a0c6 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 14 Apr 2023 12:36:09 -0500 Subject: [PATCH 043/304] handle empty tags in default tags --- internal/provider/intercept.go | 78 +++++++++++++++------------------- internal/provider/provider.go | 2 +- internal/verify/diff.go | 42 +++++++++--------- 3 files changed, 55 insertions(+), 67 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 8d97eecf2367..e5b33edc3a46 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -344,17 +344,9 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a break } } - fallthrough case Finally: switch why { case Update: - // Merge the resource's configured tags with any provider configured default_tags. - tags := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, d.Get(names.AttrTags).(map[string]interface{}))) - // Remove system tags. - tags = tags.IgnoreSystem(inContext.ServicePackageName) - - tagsInContext.TagsIn = types.Some(tags) - if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { configTags := make(map[string]string) @@ -421,47 +413,47 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a if err != nil { return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) } - // - //if v, ok := sp.(interface { - // ListTags(context.Context, any, string) error - //}); ok { - // err = v.ListTags(ctx, meta, identifier) // Sets tags in Context - //} else if v, ok := sp.(interface { - // ListTags(context.Context, any, string, string) error - //}); ok && r.tags.ResourceType != "" { - // err = v.ListTags(ctx, meta, identifier, r.tags.ResourceType) // Sets tags in Context - //} - // - //if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // // ISO partitions may not support tagging, giving error - // tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ - // r.tags.IdentifierAttribute: d.Id(), - // "error": err.Error(), - // }) - // return ctx, diags - //} - // - //if inContext.ServicePackageName == names.DynamoDB && err != nil { - // // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. - // if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { - // err = nil - // } - //} - // - //if err != nil { - // return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) - //} - - //// Remove any provider configured ignore_tags and system tags from those returned from the service API. - // tags = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) + + if v, ok := sp.(interface { + ListTags(context.Context, any, string) error + }); ok { + err = v.ListTags(ctx, meta, identifier) // Sets tags in Context + } else if v, ok := sp.(interface { + ListTags(context.Context, any, string, string) error + }); ok && r.tags.ResourceType != "" { + err = v.ListTags(ctx, meta, identifier, r.tags.ResourceType) // Sets tags in Context + } + + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ + r.tags.IdentifierAttribute: d.Id(), + "error": err.Error(), + }) + return ctx, diags + } + + if inContext.ServicePackageName == names.DynamoDB && err != nil { + // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. + if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + err = nil + } + } + + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } + + // Remove any provider configured ignore_tags and system tags from those returned from the service API. + toAdd = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } // Computed tags_all do. - if err := d.Set(names.AttrTagsAll, tags.Map()); err != nil { + if err := d.Set(names.AttrTagsAll, toAdd.Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) } } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f78c6dd63802..490c4b4db3ef 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -362,7 +362,7 @@ func New(ctx context.Context) (*schema.Provider, error) { } interceptors = append(interceptors, interceptorItem{ - when: Before | After, + when: Before | After | Finally, why: Create | Read | Update, interceptor: tagsInterceptor{tags: v.Tags}, }) diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 9cd532d75c22..9481e0ad39a5 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -34,34 +34,30 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ // To ensure "tags_all" is correctly computed, we explicitly set the attribute diff // when the merger of resource-level tags onto provider-level tags results in n > 0 tags, - // otherwise we mark the attribute as "Computed" only when their is a known diff (excluding an empty map) + // otherwise we mark the attribute as "Computed" only when there is a known diff (excluding an empty map) // or a change for "tags_all". // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18366 // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/19005 - //if len(allTags) > 0 { - // if err := diff.SetNew("tags_all", allTags.Map()); err != nil { - // return fmt.Errorf("error setting new tags_all diff: %w", err) - // } - //} else if allTags.HasZeroValue() { - // if err := diff.SetNewComputed("tags_all"); err != nil { - // return fmt.Errorf("error setting tags_all to computed: %w", err) - // } - //} else if len(diff.Get("tags_all").(map[string]interface{})) > 0 { - // if err := diff.SetNewComputed("tags_all"); err != nil { - // return fmt.Errorf("error setting tags_all to computed: %w", err) - // } - //} else if diff.HasChange("tags_all") { - // if err := diff.SetNewComputed("tags_all"); err != nil { - // return fmt.Errorf("error setting tags_all to computed: %w", err) - // } - //} - - if allTags.HasZeroValue() { - if err := diff.SetNewComputed("tags_all"); err != nil { - return fmt.Errorf("error setting tags_all to computed: %w", err) + if diff.HasChange("tags") { + _, n := diff.GetChange("tags") + newTags := tftags.New(ctx, n.(map[string]interface{})) + + if newTags.HasZeroValue() { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } + } + } else if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { + ta := tftags.New(ctx, tagsAll) + if !ta.ContainsAll(allTags) { + if allTags.HasZeroValue() { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } + } } - } else if len(allTags) > 0 { + } else if len(allTags) > 0 && !allTags.HasZeroValue() { if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } From 931cc2bd79ecb8630b4ffbb3f87c390dadcdb8a5 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 14 Apr 2023 16:19:02 -0500 Subject: [PATCH 044/304] chore: cleanup logging --- internal/provider/intercept.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index e5b33edc3a46..e15405dc5f1b 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -372,11 +372,6 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a // Remove system tags. toAdd = toAdd.IgnoreSystem(inContext.ServicePackageName) - tflog.Debug(ctx, "all_tags", map[string]interface{}{ - "to_add": configTags, - "to_remove": tagsAll, - }) - var identifier string if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute == "id" { identifier = d.Id() @@ -389,10 +384,6 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a if v, ok := sp.(interface { UpdateTags(context.Context, any, string, any, any) error }); ok { - tflog.Debug(ctx, "finally_not_getting_here", map[string]interface{}{ - "to_add": configTags, - "to_remove": tagsAll, - }) err = v.UpdateTags(ctx, meta, identifier, tagsAll, toAdd) } else if v, ok := sp.(interface { UpdateTags(context.Context, any, string, string, any, any) error From c8427582d48b9f3bce07c3b2e0a1e24f19b8fa15 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 10:00:44 -0500 Subject: [PATCH 045/304] chore: cleanup logging --- internal/provider/intercept.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index e15405dc5f1b..91ee35885a2c 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -348,7 +348,6 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a switch why { case Update: if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { - configTags := make(map[string]string) if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { c := config.GetAttr("tags") From e6ae0cae62db9f43ed405245e84794301d61f5f6 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 10:37:55 -0500 Subject: [PATCH 046/304] chore: linter error --- internal/provider/intercept.go | 4 ---- internal/tags/context.go | 4 +--- internal/tags/key_value_tags.go | 12 +----------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 91ee35885a2c..bb900a616abb 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -339,10 +339,6 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a if err := d.Set(names.AttrTagsAll, tags.Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) } - - if why == Create { - break - } } case Finally: switch why { diff --git a/internal/tags/context.go b/internal/tags/context.go index f0bd6cf85780..9b1329f061bc 100644 --- a/internal/tags/context.go +++ b/internal/tags/context.go @@ -13,8 +13,7 @@ type InContext struct { // TagsIn holds tags specified in configuration. Typically this field includes any default tags and excludes system tags. TagsIn types.Option[KeyValueTags] // TagsOut holds tags returned from AWS, including any ignored or system tags. - TagsOut types.Option[KeyValueTags] - TagsAllDiff types.Option[KeyValueTags] + TagsOut types.Option[KeyValueTags] } // NewContext returns a Context enhanced with tagging information. @@ -24,7 +23,6 @@ func NewContext(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig IgnoreConfig: ignoreConfig, TagsIn: types.None[KeyValueTags](), TagsOut: types.None[KeyValueTags](), - TagsAllDiff: types.None[KeyValueTags](), } return context.WithValue(ctx, tagKey, &v) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 247c35f700ce..9c84092ae610 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -410,17 +410,7 @@ func (tags KeyValueTags) Chunks(size int) []KeyValueTags { // ContainsAll returns whether or not all the target tags are contained. func (tags KeyValueTags) ContainsAll(target KeyValueTags) bool { - //for key, value := range target { - // if v, ok := tags[key]; !ok || !v.Equal(value) { - // return false - // } - //} - - if !reflect.DeepEqual(tags, target) { - return false - } - - return true + return reflect.DeepEqual(tags, target) } func (tags KeyValueTags) HasZeroValue() bool { From 68fff1ee761e18e6f33919eef6f29582f75f71cb Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 12:10:01 -0500 Subject: [PATCH 047/304] allow update from empty to known value --- internal/tags/key_value_tags.go | 20 +++++++++++++++++--- internal/tags/tag_map.go | 16 ++++++++++++++++ internal/verify/diff.go | 9 ++++++--- 3 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 internal/tags/tag_map.go diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 9c84092ae610..d4e3d9e7f71b 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -410,12 +410,18 @@ func (tags KeyValueTags) Chunks(size int) []KeyValueTags { // ContainsAll returns whether or not all the target tags are contained. func (tags KeyValueTags) ContainsAll(target KeyValueTags) bool { - return reflect.DeepEqual(tags, target) + for key, value := range target { + if v, ok := tags[key]; !ok || !v.Equal(value) { + return false + } + } + + return true } func (tags KeyValueTags) HasZeroValue() bool { - for _, v := range tags.Map() { - if v == "" { + for _, v := range tags { + if v.ValueString() == "" { return true } } @@ -451,6 +457,10 @@ func (tags KeyValueTags) Equal(other KeyValueTags) bool { return true } +func (tags KeyValueTags) DeepEqual(target KeyValueTags) bool { + return reflect.DeepEqual(tags, target) +} + // Hash returns a stable hash value. // The returned value may be negative (i.e. not suitable for a 'Set' function). func (tags KeyValueTags) Hash() int { @@ -637,6 +647,10 @@ type TagData struct { Value *string } +func (td *TagData) ValueString() string { + return *td.Value +} + func (td *TagData) Equal(other *TagData) bool { if td == nil && other == nil { return true diff --git a/internal/tags/tag_map.go b/internal/tags/tag_map.go new file mode 100644 index 000000000000..ae25e6be1e8f --- /dev/null +++ b/internal/tags/tag_map.go @@ -0,0 +1,16 @@ +package tags + +type valuer interface { + ValueString() string +} + +type TagMap[V valuer] map[string]V + +func (tm TagMap[V]) Difference(in TagMap[V]) TagMap[V] { + result := make(map[string]V) + + for _, v := range tm { + v.ValueString() + } + return result +} diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 9481e0ad39a5..ba3b1876802e 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -3,6 +3,7 @@ package verify import ( "context" "fmt" + "log" "strings" "time" @@ -31,7 +32,7 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ } allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) - + log.Printf("[DEBUG] all_tags: %v", allTags) // To ensure "tags_all" is correctly computed, we explicitly set the attribute diff // when the merger of resource-level tags onto provider-level tags results in n > 0 tags, // otherwise we mark the attribute as "Computed" only when there is a known diff (excluding an empty map) @@ -50,14 +51,16 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ } } else if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { ta := tftags.New(ctx, tagsAll) - if !ta.ContainsAll(allTags) { + if !ta.DeepEqual(allTags) { if allTags.HasZeroValue() { if err := diff.SetNewComputed("tags_all"); err != nil { return fmt.Errorf("error setting tags_all to computed: %w", err) } } } - } else if len(allTags) > 0 && !allTags.HasZeroValue() { + } + + if len(allTags) > 0 && !allTags.HasZeroValue() { if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } From 85c06f6b820c38c22392e7886c815a5362270c72 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 12:51:17 -0500 Subject: [PATCH 048/304] only add/remove necessary tags --- internal/provider/intercept.go | 13 ++++++++----- internal/tags/key_value_tags.go | 12 ++++++++++++ internal/tags/tag_map.go | 16 ---------------- internal/verify/diff.go | 2 -- 4 files changed, 20 insertions(+), 23 deletions(-) delete mode 100644 internal/tags/tag_map.go diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index bb900a616abb..d914d54edd34 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -360,12 +360,15 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a } } - tagsAll := stateTags + tagsAll := tftags.New(ctx, stateTags) // if tags_all was computed because not wholly known // Merge the resource's configured tags with any provider configured default_tags. - toAdd := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) + configAll := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) // Remove system tags. - toAdd = toAdd.IgnoreSystem(inContext.ServicePackageName) + configAll = configAll.IgnoreSystem(inContext.ServicePackageName) + + toAdd := configAll.Difference(tagsAll) + toRemove := tagsAll.Difference(configAll) var identifier string if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute == "id" { @@ -379,11 +382,11 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a if v, ok := sp.(interface { UpdateTags(context.Context, any, string, any, any) error }); ok { - err = v.UpdateTags(ctx, meta, identifier, tagsAll, toAdd) + err = v.UpdateTags(ctx, meta, identifier, toRemove, toAdd) } else if v, ok := sp.(interface { UpdateTags(context.Context, any, string, string, any, any) error }); ok && r.tags.ResourceType != "" { - err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, tagsAll, toAdd) + err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, toRemove, toAdd) } if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index d4e3d9e7f71b..534b94b2288e 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -419,6 +419,18 @@ func (tags KeyValueTags) ContainsAll(target KeyValueTags) bool { return true } +func (tags KeyValueTags) Difference(target KeyValueTags) KeyValueTags { + result := make(KeyValueTags) + + for k, v := range tags { + if val, ok := target[k]; !ok || (v.ValueString() != val.ValueString()) { + result[k] = v + } + } + + return result +} + func (tags KeyValueTags) HasZeroValue() bool { for _, v := range tags { if v.ValueString() == "" { diff --git a/internal/tags/tag_map.go b/internal/tags/tag_map.go deleted file mode 100644 index ae25e6be1e8f..000000000000 --- a/internal/tags/tag_map.go +++ /dev/null @@ -1,16 +0,0 @@ -package tags - -type valuer interface { - ValueString() string -} - -type TagMap[V valuer] map[string]V - -func (tm TagMap[V]) Difference(in TagMap[V]) TagMap[V] { - result := make(map[string]V) - - for _, v := range tm { - v.ValueString() - } - return result -} diff --git a/internal/verify/diff.go b/internal/verify/diff.go index ba3b1876802e..614d7f9f587a 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -3,7 +3,6 @@ package verify import ( "context" "fmt" - "log" "strings" "time" @@ -32,7 +31,6 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ } allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) - log.Printf("[DEBUG] all_tags: %v", allTags) // To ensure "tags_all" is correctly computed, we explicitly set the attribute diff // when the merger of resource-level tags onto provider-level tags results in n > 0 tags, // otherwise we mark the attribute as "Computed" only when there is a known diff (excluding an empty map) From 97524bca20e4ac97db3064b609df31f5f25394f8 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 13:39:03 -0500 Subject: [PATCH 049/304] update default_tags without tag changes --- internal/verify/diff.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 614d7f9f587a..4d5dc484024c 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -47,6 +47,18 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ return fmt.Errorf("error setting tags_all to computed: %w", err) } } + + if len(allTags) > 0 && !allTags.HasZeroValue() { + if err := diff.SetNew("tags_all", allTags.Map()); err != nil { + return fmt.Errorf("error setting new tags_all diff: %w", err) + } + } + } else if !diff.HasChange("tags") { + if len(allTags) > 0 && !allTags.HasZeroValue() { + if err := diff.SetNew("tags_all", allTags.Map()); err != nil { + return fmt.Errorf("error setting new tags_all diff: %w", err) + } + } } else if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { ta := tftags.New(ctx, tagsAll) if !ta.DeepEqual(allTags) { @@ -56,12 +68,6 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ } } } - } - - if len(allTags) > 0 && !allTags.HasZeroValue() { - if err := diff.SetNew("tags_all", allTags.Map()); err != nil { - return fmt.Errorf("error setting new tags_all diff: %w", err) - } } else if len(diff.Get("tags_all").(map[string]interface{})) > 0 { if err := diff.SetNewComputed("tags_all"); err != nil { return fmt.Errorf("error setting tags_all to computed: %w", err) @@ -71,6 +77,7 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ return fmt.Errorf("error setting tags_all to computed: %w", err) } } + return nil } From b59661000755c4f18085f265d2e258f27cb795bd Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 13:58:02 -0500 Subject: [PATCH 050/304] set tags_all computed if tags are unknown --- internal/verify/diff.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 4d5dc484024c..5272f894b96e 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -38,6 +38,13 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18366 // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/19005 + if !diff.GetRawPlan().GetAttr("tags").IsWhollyKnown() { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } + return nil + } + if diff.HasChange("tags") { _, n := diff.GetChange("tags") newTags := tftags.New(ctx, n.(map[string]interface{})) From 43cead2b474bf97464f79c35fc20eb2eecc35927 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 22:16:45 -0500 Subject: [PATCH 051/304] WIP --- internal/provider/intercept.go | 199 +++++++++++---------- internal/provider/tags_interceptor_test.go | 153 ++++++++++++++++ internal/tags/key_value_tags.go | 4 + 3 files changed, 265 insertions(+), 91 deletions(-) create mode 100644 internal/provider/tags_interceptor_test.go diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index d914d54edd34..baf535ce610d 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -4,6 +4,7 @@ import ( "context" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -343,111 +344,127 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a case Finally: switch why { case Update: - if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { - configTags := make(map[string]string) - if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { - c := config.GetAttr("tags") - for k, v := range c.AsValueMap() { - configTags[k] = v.AsString() - } - } + ctx, diags = finalTagsUpdate(ctx, d, sp, tagsInContext, inContext, r.tags, serviceName, resourceName, meta) + } + } - stateTags := make(map[string]string) - if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { - s := state.GetAttr("tags_all") - for k, v := range s.AsValueMap() { - stateTags[k] = v.AsString() - } - } + return ctx, diags +} - tagsAll := tftags.New(ctx, stateTags) - // if tags_all was computed because not wholly known - // Merge the resource's configured tags with any provider configured default_tags. - configAll := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) - // Remove system tags. - configAll = configAll.IgnoreSystem(inContext.ServicePackageName) - - toAdd := configAll.Difference(tagsAll) - toRemove := tagsAll.Difference(configAll) - - var identifier string - if identifierAttribute := r.tags.IdentifierAttribute; identifierAttribute == "id" { - identifier = d.Id() - } else { - identifier = d.Get(identifierAttribute).(string) - } - // If the service package has a generic resource update tags methods, call it. - var err error - - if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, any, any) error - }); ok { - err = v.UpdateTags(ctx, meta, identifier, toRemove, toAdd) - } else if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, string, any, any) error - }); ok && r.tags.ResourceType != "" { - err = v.UpdateTags(ctx, meta, identifier, r.tags.ResourceType, toRemove, toAdd) - } +type resourceDiff interface { + Id() string + Get(key string) any + GetRawPlan() cty.Value + GetRawConfig() cty.Value + GetRawState() cty.Value + Set(string, any) error +} - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ - r.tags.IdentifierAttribute: identifier, - "error": err.Error(), - }) +func finalTagsUpdate(ctx context.Context, d resourceDiff, sp conns.ServicePackage, tagsInContext *tftags.InContext, inContext *conns.InContext, r *types.ServicePackageResourceTags, serviceName, resourceName string, meta any) (context.Context, diag.Diagnostics) { + var diags diag.Diagnostics - return ctx, diags - } + if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { + configTags := make(map[string]string) + if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { + c := config.GetAttr("tags") + for k, v := range c.AsValueMap() { + configTags[k] = v.AsString() + } + } - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) - } + stateTags := make(map[string]string) + if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { + s := state.GetAttr("tags_all") + for k, v := range s.AsValueMap() { + stateTags[k] = v.AsString() + } + } - if v, ok := sp.(interface { - ListTags(context.Context, any, string) error - }); ok { - err = v.ListTags(ctx, meta, identifier) // Sets tags in Context - } else if v, ok := sp.(interface { - ListTags(context.Context, any, string, string) error - }); ok && r.tags.ResourceType != "" { - err = v.ListTags(ctx, meta, identifier, r.tags.ResourceType) // Sets tags in Context - } + tagsAll := tftags.New(ctx, stateTags) + // if tags_all was computed because not wholly known + // Merge the resource's configured tags with any provider configured default_tags. + configAll := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) + // Remove system tags. + configAll = configAll.IgnoreSystem(inContext.ServicePackageName) - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ - r.tags.IdentifierAttribute: d.Id(), - "error": err.Error(), - }) - return ctx, diags - } + toAdd := configAll.Difference(tagsAll) + toRemove := tagsAll.Difference(configAll) - if inContext.ServicePackageName == names.DynamoDB && err != nil { - // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. - if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { - err = nil - } - } + var identifier string + if identifierAttribute := r.IdentifierAttribute; identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + // If the service package has a generic resource update tags methods, call it. + var err error + + if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, any, any) error + }); ok { + err = v.UpdateTags(ctx, meta, identifier, toRemove, toAdd) + } else if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, string, any, any) error + }); ok && r.ResourceType != "" { + err = v.UpdateTags(ctx, meta, identifier, r.ResourceType, toRemove, toAdd) + } - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) - } + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ + r.IdentifierAttribute: identifier, + "error": err.Error(), + }) + + return ctx, diags + } - // Remove any provider configured ignore_tags and system tags from those returned from the service API. - toAdd = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } - // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) - } + if v, ok := sp.(interface { + ListTags(context.Context, any, string) error + }); ok { + err = v.ListTags(ctx, meta, identifier) // Sets tags in Context + } else if v, ok := sp.(interface { + ListTags(context.Context, any, string, string) error + }); ok && r.ResourceType != "" { + err = v.ListTags(ctx, meta, identifier, r.ResourceType) // Sets tags in Context + } - // Computed tags_all do. - if err := d.Set(names.AttrTagsAll, toAdd.Map()); err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) - } + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ + r.IdentifierAttribute: d.Id(), + "error": err.Error(), + }) + return ctx, diags + } + + if inContext.ServicePackageName == names.DynamoDB && err != nil { + // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. + if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + err = nil } } - } + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } + + // Remove any provider configured ignore_tags and system tags from those returned from the service API. + toAdd = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) + + // The resource's configured tags do not include any provider configured default_tags. + if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) + } + + // Computed tags_all do. + if err := d.Set(names.AttrTagsAll, toAdd.Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) + } + } return ctx, diags } diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go new file mode 100644 index 000000000000..c01136d4ba78 --- /dev/null +++ b/internal/provider/tags_interceptor_test.go @@ -0,0 +1,153 @@ +package provider + +import ( + "context" + "errors" + "testing" + + "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type mockService struct{} + +func (t *mockService) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} +} + +func (t *mockService) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} +} + +func (t *mockService) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} +} + +func (t *mockService) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: nil, + TypeName: "aws_test", + Name: "Test", + Tags: &types.ServicePackageResourceTags{ + IdentifierAttribute: "arn", + }, + }, + } +} + +func (t *mockService) ServicePackageName() string { + return "TestService" +} + +func (t *mockService) ListTags(ctx context.Context, meta any, identifier string) error { + tags := tftags.New(ctx, map[string]string{ + "tag1": "value1", + }) + if inContext, ok := tftags.FromContext(ctx); ok { + inContext.TagsOut = types.Some(tags) + } + + return errors.New("test error") +} + +func (t *mockService) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return nil +} + +func TestTagsInterceptor(t *testing.T) { + t.Parallel() + + var interceptors interceptorItems + + tags := tagsInterceptor{tags: &types.ServicePackageResourceTags{ + IdentifierAttribute: "arn", + }} + + interceptors = append(interceptors, interceptorItem{ + when: Finally, + why: Update, + interceptor: tags, + }) + + var update schema.UpdateContextFunc = func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + return diags + } + bootstrapContext := func(ctx context.Context, meta any) context.Context { + return ctx + } + + conn := &conns.AWSClient{ + ServicePackages: map[string]conns.ServicePackage{ + "Test": &mockService{}, + }, + DefaultTagsConfig: expandDefaultTags(context.Background(), map[string]interface{}{ + "tag": "", + }), + IgnoreTagsConfig: expandIgnoreTags(context.Background(), map[string]interface{}{ + "tag2": "tag", + }), + } + + r := &schema.Resource{} + r.Schema = map[string]*schema.Schema{ + names.AttrTags: tftags.TagsSchema(), + names.AttrTagsAll: tftags.TagsSchemaComputed(), + } + + // diff := &schema.ResourceDiff{} + + // _ = diff.SetNew("tags_all", map[string]string{"one": "tag"}) + //r.CustomizeDiff = func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { + // t.Log(diff) + // return diff.SetNewComputed(names.AttrTagsAll) + //} + //err := r.CustomizeDiff(context.Background(), diff, conn) + //if err != nil { + // t.Fatal(err) + //} + diags := interceptedHandler(bootstrapContext, interceptors, update, Update)(context.Background(), r.TestResourceData(), conn) + if got, want := len(diags), 0; got != want { + t.Errorf("length of diags = %v, want %v", got, want) + } + outputTags := r.TestResourceData().Get("tags_all").(map[string]interface{}) + t.Log(outputTags) +} + +type differ struct{} + +func (d *differ) GetRawConfig() cty.Value { + return cty.MapVal(map[string]cty.Value{ + "tags_all": cty.StringVal(""), + }) +} + +func (d *differ) GetRawPlan() cty.Value { + return cty.MapVal(map[string]cty.Value{ + "tags_all": cty.MapVal(map[string]cty.Value{ + "tag1": cty.UnknownVal(cty.String), + }), + }) +} + +func (d *differ) GetRawState() cty.Value { + return cty.Value{} +} + +func (d *differ) Get(key string) any { + return nil +} + +func (d *differ) Id() string { + return "id" +} + +func (d *differ) Set(string, any) error { + return nil +} diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 534b94b2288e..835f70f3f40c 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -660,6 +660,10 @@ type TagData struct { } func (td *TagData) ValueString() string { + if td.Value == nil { + return "" + } + return *td.Value } From dcc9446abadc10f1e346fcd6bdb3cfeb17d2819b Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 18 Apr 2023 23:08:22 -0500 Subject: [PATCH 052/304] wip: factor out final tags update --- internal/provider/intercept.go | 6 ++-- internal/provider/tags_interceptor_test.go | 41 ++++------------------ internal/verify/diff.go | 10 ++++++ 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index baf535ce610d..58a5085f0e3f 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -367,8 +367,10 @@ func finalTagsUpdate(ctx context.Context, d resourceDiff, sp conns.ServicePackag configTags := make(map[string]string) if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { c := config.GetAttr("tags") - for k, v := range c.AsValueMap() { - configTags[k] = v.AsString() + if !c.IsNull() { + for k, v := range c.AsValueMap() { + configTags[k] = v.AsString() + } } } diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go index c01136d4ba78..89e8e1fe3524 100644 --- a/internal/provider/tags_interceptor_test.go +++ b/internal/provider/tags_interceptor_test.go @@ -6,12 +6,9 @@ import ( "testing" "github.com/hashicorp/go-cty/cty" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/types" - "github.com/hashicorp/terraform-provider-aws/names" ) type mockService struct{} @@ -65,9 +62,11 @@ func TestTagsInterceptor(t *testing.T) { var interceptors interceptorItems - tags := tagsInterceptor{tags: &types.ServicePackageResourceTags{ + sp := &types.ServicePackageResourceTags{ IdentifierAttribute: "arn", - }} + } + + tags := tagsInterceptor{tags: sp} interceptors = append(interceptors, interceptorItem{ when: Finally, @@ -75,14 +74,6 @@ func TestTagsInterceptor(t *testing.T) { interceptor: tags, }) - var update schema.UpdateContextFunc = func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - return diags - } - bootstrapContext := func(ctx context.Context, meta any) context.Context { - return ctx - } - conn := &conns.AWSClient{ ServicePackages: map[string]conns.ServicePackage{ "Test": &mockService{}, @@ -95,29 +86,9 @@ func TestTagsInterceptor(t *testing.T) { }), } - r := &schema.Resource{} - r.Schema = map[string]*schema.Schema{ - names.AttrTags: tftags.TagsSchema(), - names.AttrTagsAll: tftags.TagsSchemaComputed(), - } + d := &differ{} - // diff := &schema.ResourceDiff{} - - // _ = diff.SetNew("tags_all", map[string]string{"one": "tag"}) - //r.CustomizeDiff = func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { - // t.Log(diff) - // return diff.SetNewComputed(names.AttrTagsAll) - //} - //err := r.CustomizeDiff(context.Background(), diff, conn) - //if err != nil { - // t.Fatal(err) - //} - diags := interceptedHandler(bootstrapContext, interceptors, update, Update)(context.Background(), r.TestResourceData(), conn) - if got, want := len(diags), 0; got != want { - t.Errorf("length of diags = %v, want %v", got, want) - } - outputTags := r.TestResourceData().Get("tags_all").(map[string]interface{}) - t.Log(outputTags) + _, _ = finalTagsUpdate(context.Background(), d, &mockService{}, nil, nil, sp, "TestService", "Test", conn) } type differ struct{} diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 5272f894b96e..8c9e30fb1c9c 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -60,11 +60,21 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ return fmt.Errorf("error setting new tags_all diff: %w", err) } } + + if len(allTags) == 0 { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } + } } else if !diff.HasChange("tags") { if len(allTags) > 0 && !allTags.HasZeroValue() { if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } + } else if len(allTags) > 0 && allTags.HasZeroValue() { + if err := diff.SetNewComputed("tags_all"); err != nil { + return fmt.Errorf("error setting tags_all to computed: %w", err) + } } } else if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { ta := tftags.New(ctx, tagsAll) From 5fbd080cf61b402458e2f5f9ff3799f16fc79ab7 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 19 Apr 2023 10:37:14 -0500 Subject: [PATCH 053/304] refactor tagsReadFun and tagsListFunc --- internal/provider/intercept.go | 23 ++- internal/provider/provider.go | 10 +- internal/provider/tags_interceptor.go | 156 +++++++++++++++++++++ internal/provider/tags_interceptor_test.go | 56 ++++---- 4 files changed, 214 insertions(+), 31 deletions(-) create mode 100644 internal/provider/tags_interceptor.go diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 58a5085f0e3f..d0d56cd47699 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -179,9 +179,13 @@ func (r *wrappedResource) StateUpgrade(f schema.StateUpgradeFunc) schema.StateUp } } +type tagsCRUDFunc func(context.Context, *schema.ResourceData, conns.ServicePackage, *types.ServicePackageResourceTags, string, string, any, diag.Diagnostics) (context.Context, diag.Diagnostics) + // tagsInterceptor implements transparent tagging. type tagsInterceptor struct { - tags *types.ServicePackageResourceTags + tags *types.ServicePackageResourceTags + listFunc tagsCRUDFunc + readFunc tagsCRUDFunc } func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { @@ -344,7 +348,10 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a case Finally: switch why { case Update: - ctx, diags = finalTagsUpdate(ctx, d, sp, tagsInContext, inContext, r.tags, serviceName, resourceName, meta) + if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { + ctx, diags = r.listFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) + ctx, diags = r.readFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) + } } } @@ -360,9 +367,19 @@ type resourceDiff interface { Set(string, any) error } -func finalTagsUpdate(ctx context.Context, d resourceDiff, sp conns.ServicePackage, tagsInContext *tftags.InContext, inContext *conns.InContext, r *types.ServicePackageResourceTags, serviceName, resourceName string, meta any) (context.Context, diag.Diagnostics) { +func finalTagsUpdate(ctx context.Context, d resourceDiff, sp conns.ServicePackage, r *types.ServicePackageResourceTags, serviceName, resourceName string, meta any) (context.Context, diag.Diagnostics) { var diags diag.Diagnostics + inContext, ok := conns.FromContext(ctx) + if !ok { + return ctx, diags + } + + tagsInContext, ok := tftags.FromContext(ctx) + if !ok { + return ctx, diags + } + if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { configTags := make(map[string]string) if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 490c4b4db3ef..f9a8dbf735b6 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -362,9 +362,13 @@ func New(ctx context.Context) (*schema.Provider, error) { } interceptors = append(interceptors, interceptorItem{ - when: Before | After | Finally, - why: Create | Read | Update, - interceptor: tagsInterceptor{tags: v.Tags}, + when: Before | After | Finally, + why: Create | Read | Update, + interceptor: tagsInterceptor{ + tags: v.Tags, + listFunc: tagsListFunc, + readFunc: tagsReadFunc, + }, }) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go new file mode 100644 index 000000000000..af6a30768114 --- /dev/null +++ b/internal/provider/tags_interceptor.go @@ -0,0 +1,156 @@ +package provider + +import ( + "context" + + "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/internal/verify" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func tagsListFunc(ctx context.Context, d *schema.ResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + inContext, ok := conns.FromContext(ctx) + if !ok { + return ctx, diags + } + + tagsInContext, ok := tftags.FromContext(ctx) + if !ok { + return ctx, diags + } + + configTags := make(map[string]string) + if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { + c := config.GetAttr("tags") + if !c.IsNull() { + for k, v := range c.AsValueMap() { + configTags[k] = v.AsString() + } + } + } + + stateTags := make(map[string]string) + if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { + s := state.GetAttr("tags_all") + for k, v := range s.AsValueMap() { + stateTags[k] = v.AsString() + } + } + + tagsAll := tftags.New(ctx, stateTags) + // if tags_all was computed because not wholly known + // Merge the resource's configured tags with any provider configured default_tags. + configAll := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) + // Remove system tags. + configAll = configAll.IgnoreSystem(inContext.ServicePackageName) + + toAdd := configAll.Difference(tagsAll) + toRemove := tagsAll.Difference(configAll) + + var identifier string + if identifierAttribute := spt.IdentifierAttribute; identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + // If the service package has a generic resource update tags methods, call it. + var err error + + if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, any, any) error + }); ok { + err = v.UpdateTags(ctx, meta, identifier, toRemove, toAdd) + } else if v, ok := sp.(interface { + UpdateTags(context.Context, any, string, string, any, any) error + }); ok && spt.ResourceType != "" { + err = v.UpdateTags(ctx, meta, identifier, spt.ResourceType, toRemove, toAdd) + } + + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ + spt.IdentifierAttribute: identifier, + "error": err.Error(), + }) + + return ctx, diags + } + + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } + + return ctx, diags +} + +func tagsReadFunc(ctx context.Context, d *schema.ResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + inContext, ok := conns.FromContext(ctx) + if !ok { + return ctx, diags + } + + tagsInContext, ok := tftags.FromContext(ctx) + if !ok { + return ctx, diags + } + var identifier string + if identifierAttribute := spt.IdentifierAttribute; identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + + var err error + if v, ok := sp.(interface { + ListTags(context.Context, any, string) error + }); ok { + err = v.ListTags(ctx, meta, identifier) // Sets tags in Context + } else if v, ok := sp.(interface { + ListTags(context.Context, any, string, string) error + }); ok && spt.ResourceType != "" { + err = v.ListTags(ctx, meta, identifier, spt.ResourceType) // Sets tags in Context + } + + if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { + // ISO partitions may not support tagging, giving error + tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ + spt.IdentifierAttribute: d.Id(), + "error": err.Error(), + }) + return ctx, diags + } + + if inContext.ServicePackageName == names.DynamoDB && err != nil { + // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. + if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + err = nil + } + } + + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } + + // Remove any provider configured ignore_tags and system tags from those returned from the service API. + toAdd := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) + + // The resource's configured tags do not include any provider configured default_tags. + if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) + } + + // Computed tags_all do. + if err := d.Set(names.AttrTagsAll, toAdd.Map()); err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) + } + + return ctx, diags +} diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go index 89e8e1fe3524..dedcdfd637fa 100644 --- a/internal/provider/tags_interceptor_test.go +++ b/internal/provider/tags_interceptor_test.go @@ -2,7 +2,6 @@ package provider import ( "context" - "errors" "testing" "github.com/hashicorp/go-cty/cty" @@ -26,16 +25,7 @@ func (t *mockService) SDKDataSources(ctx context.Context) []*types.ServicePackag } func (t *mockService) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { - return []*types.ServicePackageSDKResource{ - { - Factory: nil, - TypeName: "aws_test", - Name: "Test", - Tags: &types.ServicePackageResourceTags{ - IdentifierAttribute: "arn", - }, - }, - } + return []*types.ServicePackageSDKResource{} } func (t *mockService) ServicePackageName() string { @@ -50,7 +40,7 @@ func (t *mockService) ListTags(ctx context.Context, meta any, identifier string) inContext.TagsOut = types.Some(tags) } - return errors.New("test error") + return nil } func (t *mockService) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { @@ -63,7 +53,7 @@ func TestTagsInterceptor(t *testing.T) { var interceptors interceptorItems sp := &types.ServicePackageResourceTags{ - IdentifierAttribute: "arn", + IdentifierAttribute: "id", } tags := tagsInterceptor{tags: sp} @@ -86,39 +76,55 @@ func TestTagsInterceptor(t *testing.T) { }), } - d := &differ{} + bootstrapContext := func(ctx context.Context, meta any) context.Context { + ctx = conns.NewContext(ctx, "Test", "aws_test") + if v, ok := meta.(*conns.AWSClient); ok { + ctx = tftags.NewContext(ctx, v.DefaultTagsConfig, v.IgnoreTagsConfig) + } + + return ctx + } + + ctx := context.Background() + ctx = bootstrapContext(ctx, conn) + d := &resourceData{} - _, _ = finalTagsUpdate(context.Background(), d, &mockService{}, nil, nil, sp, "TestService", "Test", conn) + _, diags := finalTagsUpdate(ctx, d, &mockService{}, sp, "TestService", "Test", conn) + if got, want := len(diags), 0; got != want { + t.Errorf("length of diags = %v, want %v", got, want) + } } -type differ struct{} +type resourceData struct{} -func (d *differ) GetRawConfig() cty.Value { - return cty.MapVal(map[string]cty.Value{ - "tags_all": cty.StringVal(""), +func (d *resourceData) GetRawConfig() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ + "tags": cty.MapVal(map[string]cty.Value{ + "tag1": cty.StringVal("value1"), + }), }) } -func (d *differ) GetRawPlan() cty.Value { - return cty.MapVal(map[string]cty.Value{ +func (d *resourceData) GetRawPlan() cty.Value { + return cty.ObjectVal(map[string]cty.Value{ "tags_all": cty.MapVal(map[string]cty.Value{ "tag1": cty.UnknownVal(cty.String), }), }) } -func (d *differ) GetRawState() cty.Value { +func (d *resourceData) GetRawState() cty.Value { // nosemgrep:ci.aws-in-func-name return cty.Value{} } -func (d *differ) Get(key string) any { +func (d *resourceData) Get(key string) any { return nil } -func (d *differ) Id() string { +func (d *resourceData) Id() string { return "id" } -func (d *differ) Set(string, any) error { +func (d *resourceData) Set(string, any) error { return nil } From 0a09def7629f92ae4db6272284c99b022fce2940 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 19 Apr 2023 12:06:22 -0500 Subject: [PATCH 054/304] chore: cleanup --- internal/provider/intercept.go | 133 ++------------------- internal/provider/intercept_test.go | 12 +- internal/provider/tags_interceptor.go | 5 +- internal/provider/tags_interceptor_test.go | 32 +++-- 4 files changed, 39 insertions(+), 143 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index d0d56cd47699..56e25e8241e9 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -23,12 +23,12 @@ import ( // no further interceptors in the chain are run and neither is the schema's method. // In other cases all interceptors in the chain are run. type interceptor interface { - run(context.Context, *schema.ResourceData, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) + run(context.Context, resourceDiff, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) } -type interceptorFunc func(context.Context, *schema.ResourceData, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) +type interceptorFunc func(context.Context, resourceDiff, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) -func (f interceptorFunc) run(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func (f interceptorFunc) run(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return f(ctx, d, meta, when, why, diags) } @@ -179,7 +179,7 @@ func (r *wrappedResource) StateUpgrade(f schema.StateUpgradeFunc) schema.StateUp } } -type tagsCRUDFunc func(context.Context, *schema.ResourceData, conns.ServicePackage, *types.ServicePackageResourceTags, string, string, any, diag.Diagnostics) (context.Context, diag.Diagnostics) +type tagsCRUDFunc func(context.Context, resourceDiff, conns.ServicePackage, *types.ServicePackageResourceTags, string, string, any, diag.Diagnostics) (context.Context, diag.Diagnostics) // tagsInterceptor implements transparent tagging. type tagsInterceptor struct { @@ -188,7 +188,7 @@ type tagsInterceptor struct { readFunc tagsCRUDFunc } -func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func (r tagsInterceptor) run(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { if r.tags == nil { return ctx, diags } @@ -364,126 +364,7 @@ type resourceDiff interface { GetRawPlan() cty.Value GetRawConfig() cty.Value GetRawState() cty.Value + GetChange(key string) (interface{}, interface{}) + HasChange(key string) bool Set(string, any) error } - -func finalTagsUpdate(ctx context.Context, d resourceDiff, sp conns.ServicePackage, r *types.ServicePackageResourceTags, serviceName, resourceName string, meta any) (context.Context, diag.Diagnostics) { - var diags diag.Diagnostics - - inContext, ok := conns.FromContext(ctx) - if !ok { - return ctx, diags - } - - tagsInContext, ok := tftags.FromContext(ctx) - if !ok { - return ctx, diags - } - - if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { - configTags := make(map[string]string) - if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { - c := config.GetAttr("tags") - if !c.IsNull() { - for k, v := range c.AsValueMap() { - configTags[k] = v.AsString() - } - } - } - - stateTags := make(map[string]string) - if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { - s := state.GetAttr("tags_all") - for k, v := range s.AsValueMap() { - stateTags[k] = v.AsString() - } - } - - tagsAll := tftags.New(ctx, stateTags) - // if tags_all was computed because not wholly known - // Merge the resource's configured tags with any provider configured default_tags. - configAll := tagsInContext.DefaultConfig.MergeTags(tftags.New(ctx, configTags)) - // Remove system tags. - configAll = configAll.IgnoreSystem(inContext.ServicePackageName) - - toAdd := configAll.Difference(tagsAll) - toRemove := tagsAll.Difference(configAll) - - var identifier string - if identifierAttribute := r.IdentifierAttribute; identifierAttribute == "id" { - identifier = d.Id() - } else { - identifier = d.Get(identifierAttribute).(string) - } - // If the service package has a generic resource update tags methods, call it. - var err error - - if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, any, any) error - }); ok { - err = v.UpdateTags(ctx, meta, identifier, toRemove, toAdd) - } else if v, ok := sp.(interface { - UpdateTags(context.Context, any, string, string, any, any) error - }); ok && r.ResourceType != "" { - err = v.UpdateTags(ctx, meta, identifier, r.ResourceType, toRemove, toAdd) - } - - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ - r.IdentifierAttribute: identifier, - "error": err.Error(), - }) - - return ctx, diags - } - - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "updating tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) - } - - if v, ok := sp.(interface { - ListTags(context.Context, any, string) error - }); ok { - err = v.ListTags(ctx, meta, identifier) // Sets tags in Context - } else if v, ok := sp.(interface { - ListTags(context.Context, any, string, string) error - }); ok && r.ResourceType != "" { - err = v.ListTags(ctx, meta, identifier, r.ResourceType) // Sets tags in Context - } - - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ - r.IdentifierAttribute: d.Id(), - "error": err.Error(), - }) - return ctx, diags - } - - if inContext.ServicePackageName == names.DynamoDB && err != nil { - // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. - if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { - err = nil - } - } - - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) - } - - // Remove any provider configured ignore_tags and system tags from those returned from the service API. - toAdd = tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) - - // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) - } - - // Computed tags_all do. - if err := d.Set(names.AttrTagsAll, toAdd.Map()); err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTagsAll, err) - } - } - return ctx, diags -} diff --git a/internal/provider/intercept_test.go b/internal/provider/intercept_test.go index 381766e863f9..3a467d049265 100644 --- a/internal/provider/intercept_test.go +++ b/internal/provider/intercept_test.go @@ -17,21 +17,21 @@ func TestInterceptorsWhy(t *testing.T) { interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: After, why: Delete, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) @@ -58,21 +58,21 @@ func TestInterceptedHandler(t *testing.T) { interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: After, why: Delete, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d *schema.ResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index af6a30768114..256585e5762c 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -16,7 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) -func tagsListFunc(ctx context.Context, d *schema.ResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func tagsListFunc(ctx context.Context, d resourceDiff, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { inContext, ok := conns.FromContext(ctx) if !ok { return ctx, diags @@ -91,7 +90,7 @@ func tagsListFunc(ctx context.Context, d *schema.ResourceData, sp conns.ServiceP return ctx, diags } -func tagsReadFunc(ctx context.Context, d *schema.ResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func tagsReadFunc(ctx context.Context, d resourceDiff, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { inContext, ok := conns.FromContext(ctx) if !ok { return ctx, diags diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go index dedcdfd637fa..dcf601ac92c4 100644 --- a/internal/provider/tags_interceptor_test.go +++ b/internal/provider/tags_interceptor_test.go @@ -2,9 +2,11 @@ package provider import ( "context" + "errors" "testing" "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/types" @@ -40,10 +42,10 @@ func (t *mockService) ListTags(ctx context.Context, meta any, identifier string) inContext.TagsOut = types.Some(tags) } - return nil + return errors.New("test error") } -func (t *mockService) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { +func (t *mockService) UpdateTags(context.Context, any, string, string, any) error { return nil } @@ -56,7 +58,11 @@ func TestTagsInterceptor(t *testing.T) { IdentifierAttribute: "id", } - tags := tagsInterceptor{tags: sp} + tags := tagsInterceptor{ + tags: sp, + listFunc: tagsListFunc, + readFunc: tagsReadFunc, + } interceptors = append(interceptors, interceptorItem{ when: Finally, @@ -85,13 +91,15 @@ func TestTagsInterceptor(t *testing.T) { return ctx } - ctx := context.Background() - ctx = bootstrapContext(ctx, conn) + ctx := bootstrapContext(context.Background(), conn) d := &resourceData{} - _, diags := finalTagsUpdate(ctx, d, &mockService{}, sp, "TestService", "Test", conn) - if got, want := len(diags), 0; got != want { - t.Errorf("length of diags = %v, want %v", got, want) + for _, v := range interceptors { + var diags diag.Diagnostics + _, diags = v.interceptor.run(ctx, d, conn, v.when, v.why, diags) + if got, want := len(diags), 1; got != want { + t.Errorf("length of diags = %v, want %v", got, want) + } } } @@ -128,3 +136,11 @@ func (d *resourceData) Id() string { func (d *resourceData) Set(string, any) error { return nil } + +func (d *resourceData) GetChange(key string) (interface{}, interface{}) { + return nil, nil +} + +func (d *resourceData) HasChange(key string) bool { + return false +} From bbf4f457036f87b5f212bd1bb82d63e414450dcc Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 19 Apr 2023 12:46:27 -0500 Subject: [PATCH 055/304] chore: schemaResourcData refactor --- internal/provider/intercept.go | 33 ++++++++++++++------------- internal/provider/intercept_test.go | 12 +++++----- internal/provider/tags_interceptor.go | 4 ++-- internal/verify/diff.go | 12 ++++++++-- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 56e25e8241e9..e8d3ee2bee76 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -18,17 +18,29 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) +// schemaResourceData is an interface that implements functions from schema.ResourceData +type schemaResourceData interface { + Id() string + Get(key string) any + GetRawPlan() cty.Value + GetRawConfig() cty.Value + GetRawState() cty.Value + GetChange(key string) (interface{}, interface{}) + HasChange(key string) bool + Set(string, any) error +} + // An interceptor is functionality invoked during the CRUD request lifecycle. // If a Before interceptor returns Diagnostics indicating an error occurred then // no further interceptors in the chain are run and neither is the schema's method. // In other cases all interceptors in the chain are run. type interceptor interface { - run(context.Context, resourceDiff, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) + run(context.Context, schemaResourceData, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) } -type interceptorFunc func(context.Context, resourceDiff, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) +type interceptorFunc func(context.Context, schemaResourceData, any, when, why, diag.Diagnostics) (context.Context, diag.Diagnostics) -func (f interceptorFunc) run(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func (f interceptorFunc) run(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return f(ctx, d, meta, when, why, diags) } @@ -179,7 +191,7 @@ func (r *wrappedResource) StateUpgrade(f schema.StateUpgradeFunc) schema.StateUp } } -type tagsCRUDFunc func(context.Context, resourceDiff, conns.ServicePackage, *types.ServicePackageResourceTags, string, string, any, diag.Diagnostics) (context.Context, diag.Diagnostics) +type tagsCRUDFunc func(context.Context, schemaResourceData, conns.ServicePackage, *types.ServicePackageResourceTags, string, string, any, diag.Diagnostics) (context.Context, diag.Diagnostics) // tagsInterceptor implements transparent tagging. type tagsInterceptor struct { @@ -188,7 +200,7 @@ type tagsInterceptor struct { readFunc tagsCRUDFunc } -func (r tagsInterceptor) run(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { if r.tags == nil { return ctx, diags } @@ -357,14 +369,3 @@ func (r tagsInterceptor) run(ctx context.Context, d resourceDiff, meta any, when return ctx, diags } - -type resourceDiff interface { - Id() string - Get(key string) any - GetRawPlan() cty.Value - GetRawConfig() cty.Value - GetRawState() cty.Value - GetChange(key string) (interface{}, interface{}) - HasChange(key string) bool - Set(string, any) error -} diff --git a/internal/provider/intercept_test.go b/internal/provider/intercept_test.go index 3a467d049265..64748c5107ba 100644 --- a/internal/provider/intercept_test.go +++ b/internal/provider/intercept_test.go @@ -17,21 +17,21 @@ func TestInterceptorsWhy(t *testing.T) { interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: After, why: Delete, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) @@ -58,21 +58,21 @@ func TestInterceptedHandler(t *testing.T) { interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: After, why: Delete, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) interceptors = append(interceptors, interceptorItem{ when: Before, why: Create, - interceptor: interceptorFunc(func(ctx context.Context, d resourceDiff, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { + interceptor: interceptorFunc(func(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { return ctx, diags }), }) diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 256585e5762c..7d02dfa6f849 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) -func tagsListFunc(ctx context.Context, d resourceDiff, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func tagsListFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { inContext, ok := conns.FromContext(ctx) if !ok { return ctx, diags @@ -90,7 +90,7 @@ func tagsListFunc(ctx context.Context, d resourceDiff, sp conns.ServicePackage, return ctx, diags } -func tagsReadFunc(ctx context.Context, d resourceDiff, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { inContext, ok := conns.FromContext(ctx) if !ok { return ctx, diags diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 8c9e30fb1c9c..ef7fcb879ded 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -55,7 +55,7 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ } } - if len(allTags) > 0 && !allTags.HasZeroValue() { + if len(allTags) > 0 && (!newTags.HasZeroValue() || !allTags.HasZeroValue()) { if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } @@ -71,10 +71,18 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) } - } else if len(allTags) > 0 && allTags.HasZeroValue() { + return nil + } + + var ta tftags.KeyValueTags + if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { + ta = tftags.New(ctx, tagsAll) + } + if len(allTags) > 0 && !ta.DeepEqual(allTags) && allTags.HasZeroValue() { if err := diff.SetNewComputed("tags_all"); err != nil { return fmt.Errorf("error setting tags_all to computed: %w", err) } + return nil } } else if tagsAll, ok := diff.Get("tags_all").(map[string]interface{}); ok { ta := tftags.New(ctx, tagsAll) From 52056d90b92171a44f48f6829a16949444fa7ad0 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 19 Apr 2023 18:45:54 -0500 Subject: [PATCH 056/304] listFunc -> updateFun --- internal/provider/intercept.go | 10 +++++----- internal/provider/provider.go | 6 +++--- internal/provider/tags_interceptor.go | 2 +- internal/provider/tags_interceptor_test.go | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index e8d3ee2bee76..405e5ccfa3fc 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -25,7 +25,7 @@ type schemaResourceData interface { GetRawPlan() cty.Value GetRawConfig() cty.Value GetRawState() cty.Value - GetChange(key string) (interface{}, interface{}) + GetChange(key string) (any, any) HasChange(key string) bool Set(string, any) error } @@ -195,9 +195,9 @@ type tagsCRUDFunc func(context.Context, schemaResourceData, conns.ServicePackage // tagsInterceptor implements transparent tagging. type tagsInterceptor struct { - tags *types.ServicePackageResourceTags - listFunc tagsCRUDFunc - readFunc tagsCRUDFunc + tags *types.ServicePackageResourceTags + updateFunc tagsCRUDFunc + readFunc tagsCRUDFunc } func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any, when when, why why, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { @@ -361,7 +361,7 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any switch why { case Update: if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { - ctx, diags = r.listFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) + ctx, diags = r.updateFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) ctx, diags = r.readFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) } } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index f9a8dbf735b6..b3ed9411c6ad 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -365,9 +365,9 @@ func New(ctx context.Context) (*schema.Provider, error) { when: Before | After | Finally, why: Create | Read | Update, interceptor: tagsInterceptor{ - tags: v.Tags, - listFunc: tagsListFunc, - readFunc: tagsReadFunc, + tags: v.Tags, + updateFunc: tagsUpdateFunc, + readFunc: tagsReadFunc, }, }) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 7d02dfa6f849..2fd497696583 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) -func tagsListFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { +func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePackage, spt *types.ServicePackageResourceTags, serviceName, resourceName string, meta any, diags diag.Diagnostics) (context.Context, diag.Diagnostics) { inContext, ok := conns.FromContext(ctx) if !ok { return ctx, diags diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go index dcf601ac92c4..76cbad8723f3 100644 --- a/internal/provider/tags_interceptor_test.go +++ b/internal/provider/tags_interceptor_test.go @@ -59,9 +59,9 @@ func TestTagsInterceptor(t *testing.T) { } tags := tagsInterceptor{ - tags: sp, - listFunc: tagsListFunc, - readFunc: tagsReadFunc, + tags: sp, + updateFunc: tagsUpdateFunc, + readFunc: tagsReadFunc, } interceptors = append(interceptors, interceptorItem{ From 61554fef62ba54acd6848366a33b993bf12f399b Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 19 Apr 2023 18:55:26 -0500 Subject: [PATCH 057/304] use constants for tags and tags_all --- internal/provider/intercept.go | 8 ++++---- internal/provider/tags_interceptor.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 405e5ccfa3fc..4dfc4106b2ef 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -20,13 +20,13 @@ import ( // schemaResourceData is an interface that implements functions from schema.ResourceData type schemaResourceData interface { - Id() string Get(key string) any - GetRawPlan() cty.Value + GetChange(key string) (any, any) GetRawConfig() cty.Value + GetRawPlan() cty.Value GetRawState() cty.Value - GetChange(key string) (any, any) HasChange(key string) bool + Id() string Set(string, any) error } @@ -360,7 +360,7 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any case Finally: switch why { case Update: - if !d.GetRawPlan().GetAttr("tags_all").IsWhollyKnown() { + if !d.GetRawPlan().GetAttr(names.AttrTagsAll).IsWhollyKnown() { ctx, diags = r.updateFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) ctx, diags = r.readFunc(ctx, d, sp, r.tags, serviceName, resourceName, meta, diags) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 2fd497696583..7cf684ed2602 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -28,7 +28,7 @@ func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServiceP configTags := make(map[string]string) if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { - c := config.GetAttr("tags") + c := config.GetAttr(names.AttrTags) if !c.IsNull() { for k, v := range c.AsValueMap() { configTags[k] = v.AsString() @@ -38,7 +38,7 @@ func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServiceP stateTags := make(map[string]string) if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { - s := state.GetAttr("tags_all") + s := state.GetAttr(names.AttrTagsAll) for k, v := range s.AsValueMap() { stateTags[k] = v.AsString() } From 10ec30eb080d4629ef2e9e60b4d6d4ac19aa0f55 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 20 Apr 2023 13:42:48 -0500 Subject: [PATCH 058/304] allow duplicate tags --- internal/provider/intercept.go | 2 +- internal/provider/tags_interceptor.go | 2 +- internal/service/ec2/vpc_test.go | 2 +- internal/tags/key_value_tags.go | 50 +++++++++++++++++++++++++++ internal/verify/diff.go | 6 ++-- 5 files changed, 56 insertions(+), 6 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 4dfc4106b2ef..b58113df416d 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -348,7 +348,7 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any tags := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).RemoveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 7cf684ed2602..950b488de726 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -142,7 +142,7 @@ func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePac toAdd := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).Map()); err != nil { + if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).RemoveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index f450f409da0f..2a47f5f1d5bc 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -136,7 +136,7 @@ func TestAccVPC_tags(t *testing.T) { }) } -func TestAccVPC_DefaultTags_providerOnly(t *testing.T) { +func TestAccVPC_DefaultTags_providerOnlyTestAccVPC_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) var vpc ec2.Vpc resourceName := "aws_vpc.test" diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 835f70f3f40c..7e41f48782ca 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -3,12 +3,14 @@ package tags import ( "context" "fmt" + "log" "net/url" "reflect" "regexp" "sort" "strings" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" @@ -737,6 +739,54 @@ func (td *TagData) String() string { return fmt.Sprintf("TagData{%s}", strings.Join(fields, ", ")) } +// schemaResourceData is an interface that implements functions from schema.ResourceData +type schemaResourceData interface { + GetRawConfig() cty.Value + GetRawPlan() cty.Value + GetRawState() cty.Value + Get(string) interface{} +} + +func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { + result := make(map[string]string) + for k, v := range tags { + result[k] = v.ValueString() + } + + configTags := make(map[string]string) + if config := d.GetRawPlan(); !config.IsNull() && config.IsKnown() { + c := config.GetAttr("tags") + if !c.IsNull() { + for k, v := range c.AsValueMap() { + configTags[k] = v.AsString() + } + } + } + + if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { + c := config.GetAttr("tags") + if !c.IsNull() { + for k, v := range c.AsValueMap() { + if _, ok := configTags[k]; !ok { + configTags[k] = v.AsString() + } + } + } + } + + log.Printf("[DEBUG] config_tags: %v", configTags) + log.Printf("[DEBUG] tags_incoming: %v", result) + for k, v := range configTags { + if _, ok := result[k]; !ok { + log.Printf("[DEBUG] tags_diff: key(%s), value(%s)", k, v) + result[k] = v + } + } + + log.Printf("[DEBUG] tags_outgoing: %v", result) + return New(ctx, result) +} + // ToSnakeCase converts a string to snake case. // // For example, AWS Go SDK field names are in PascalCase, diff --git a/internal/verify/diff.go b/internal/verify/diff.go index ef7fcb879ded..7ea2d7a5f2dd 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -26,9 +26,9 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ resourceTags := tftags.New(ctx, diff.Get("tags").(map[string]interface{})) - if defaultTagsConfig.TagsEqual(resourceTags) { - return fmt.Errorf(`"tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again`) - } + //if defaultTagsConfig.TagsEqual(resourceTags) { + // return fmt.Errorf(`"tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again`) + //} allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) // To ensure "tags_all" is correctly computed, we explicitly set the attribute diff From 64470f6b3b84e592775c66970eddcca68ff81cab Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 20 Apr 2023 13:48:15 -0500 Subject: [PATCH 059/304] cleanup interfaces --- internal/tags/key_value_tags.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 7e41f48782ca..b39538763163 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -3,7 +3,6 @@ package tags import ( "context" "fmt" - "log" "net/url" "reflect" "regexp" @@ -744,7 +743,6 @@ type schemaResourceData interface { GetRawConfig() cty.Value GetRawPlan() cty.Value GetRawState() cty.Value - Get(string) interface{} } func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { @@ -774,16 +772,12 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De } } - log.Printf("[DEBUG] config_tags: %v", configTags) - log.Printf("[DEBUG] tags_incoming: %v", result) for k, v := range configTags { if _, ok := result[k]; !ok { - log.Printf("[DEBUG] tags_diff: key(%s), value(%s)", k, v) result[k] = v } } - log.Printf("[DEBUG] tags_outgoing: %v", result) return New(ctx, result) } From 868b028018d8ae9f1080c46168b714ffaf05af6d Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 20 Apr 2023 18:14:48 -0500 Subject: [PATCH 060/304] allow duplicate tags --- internal/service/ec2/vpc_test.go | 9 +++++++-- internal/tags/key_value_tags.go | 28 +++++++++++++++++++++++++--- internal/verify/diff.go | 4 ---- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 2a47f5f1d5bc..3e30f5199609 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -403,6 +403,8 @@ func TestAccVPC_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) { func TestAccVPC_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { ctx := acctest.Context(t) + var vpc ec2.Vpc + resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, @@ -415,8 +417,11 @@ func TestAccVPC_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { acctest.ConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), testAccVPCConfig_tags1("overlapkey", "overlapvalue"), ), - PlanOnly: true, - ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), + Check: resource.ComposeTestCheckFunc( + acctest.CheckVPCExists(ctx, resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + ), }, }, }) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index b39538763163..11a82a0ec881 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -754,15 +754,28 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De configTags := make(map[string]string) if config := d.GetRawPlan(); !config.IsNull() && config.IsKnown() { c := config.GetAttr("tags") - if !c.IsNull() { + if !c.IsNull() && c.IsKnown() { for k, v := range c.AsValueMap() { configTags[k] = v.AsString() } } } + var configIsNull bool if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { c := config.GetAttr("tags") + configIsNull = c.IsNull() + if !c.IsNull() && c.IsKnown() { + for k, v := range c.AsValueMap() { + if _, ok := configTags[k]; !ok { + configTags[k] = v.AsString() + } + } + } + } + + if state := d.GetRawState(); !state.IsNull() && state.IsKnown() { + c := state.GetAttr("tags") if !c.IsNull() { for k, v := range c.AsValueMap() { if _, ok := configTags[k]; !ok { @@ -774,11 +787,20 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De for k, v := range configTags { if _, ok := result[k]; !ok { - result[k] = v + if defaultConfig != nil { + if val, ok := defaultConfig.Tags[k]; ok && val.ValueString() == v { + result[k] = v + } + } } } - return New(ctx, result) + out := tags + if !configIsNull { + out = New(ctx, result) + } + + return out } // ToSnakeCase converts a string to snake case. diff --git a/internal/verify/diff.go b/internal/verify/diff.go index 7ea2d7a5f2dd..64f5c80d6fbb 100644 --- a/internal/verify/diff.go +++ b/internal/verify/diff.go @@ -26,10 +26,6 @@ func SetTagsDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{ resourceTags := tftags.New(ctx, diff.Get("tags").(map[string]interface{})) - //if defaultTagsConfig.TagsEqual(resourceTags) { - // return fmt.Errorf(`"tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again`) - //} - allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) // To ensure "tags_all" is correctly computed, we explicitly set the attribute diff // when the merger of resource-level tags onto provider-level tags results in n > 0 tags, From ce86e3958ee8fc225a9a7d05d6ba14d92971dc42 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 20 Apr 2023 18:56:07 -0500 Subject: [PATCH 061/304] gofmt --- internal/tags/key_value_tags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 11a82a0ec881..daff108bf3eb 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -799,7 +799,7 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De if !configIsNull { out = New(ctx, result) } - + return out } From 7b54800543c4f7d215f7a525c967af3d881a36b1 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 20 Apr 2023 19:11:56 -0500 Subject: [PATCH 062/304] cleanup: rename fuctions --- internal/provider/intercept.go | 2 +- internal/provider/tags_interceptor.go | 2 +- internal/tags/key_value_tags.go | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index b58113df416d..3ac9a8c29683 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -348,7 +348,7 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any tags := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).RemoveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 950b488de726..fe9055e898b1 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -142,7 +142,7 @@ func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePac toAdd := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).RemoveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index daff108bf3eb..65ebe3067837 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -745,7 +745,7 @@ type schemaResourceData interface { GetRawState() cty.Value } -func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { +func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { result := make(map[string]string) for k, v := range tags { result[k] = v.ValueString() @@ -761,10 +761,15 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De } } - var configIsNull bool if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { c := config.GetAttr("tags") - configIsNull = c.IsNull() + + // if the config is null just return the incoming tags + // no duplicates to calculate + if c.IsNull() { + return tags + } + if !c.IsNull() && c.IsKnown() { for k, v := range c.AsValueMap() { if _, ok := configTags[k]; !ok { @@ -795,12 +800,7 @@ func (tags KeyValueTags) RemoveDuplicates(ctx context.Context, defaultConfig *De } } - out := tags - if !configIsNull { - out = New(ctx, result) - } - - return out + return New(ctx, result) } // ToSnakeCase converts a string to snake case. From 59fcef9fc5a4bb8a90f8f739ae2291fa1dcd6647 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 21 Apr 2023 10:49:38 -0500 Subject: [PATCH 063/304] test: computed tag values --- internal/provider/intercept.go | 4 +-- internal/provider/tags_interceptor.go | 4 +-- internal/service/ec2/vpc_test.go | 37 +++++++++++++++++++++++++++ internal/tags/key_value_tags.go | 7 +++-- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index 3ac9a8c29683..fcaa70eac277 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -347,8 +347,8 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any // Remove any provider configured ignore_tags and system tags from those returned from the service API. tags := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) - // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, tags.RemoveDefaultConfig(tagsInContext.DefaultConfig).ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + // The resource's configured tags can now include duplicate tags that have been configured on the provider. + if err := d.Set(names.AttrTags, tags.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index fe9055e898b1..2ac0ece095ed 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -141,8 +141,8 @@ func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePac // Remove any provider configured ignore_tags and system tags from those returned from the service API. toAdd := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) - // The resource's configured tags do not include any provider configured default_tags. - if err := d.Set(names.AttrTags, toAdd.RemoveDefaultConfig(tagsInContext.DefaultConfig).ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + // The resource's configured tags can now include duplicate tags that have been configured on the provider. + if err := d.Set(names.AttrTags, toAdd.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 3e30f5199609..8c83c1f2491b 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -136,6 +136,29 @@ func TestAccVPC_tags(t *testing.T) { }) } +func TestAccVPC_tags_computed(t *testing.T) { + ctx := acctest.Context(t) + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckVPCDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCConfig_tags_computed, + Check: resource.ComposeTestCheckFunc( + acctest.CheckVPCExists(ctx, resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "tags.eip"), + ), + }, + }, + }) +} + func TestAccVPC_DefaultTags_providerOnlyTestAccVPC_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) var vpc ec2.Vpc @@ -1044,6 +1067,20 @@ resource "aws_vpc" "test" { `, tagKey1, tagValue1, tagKey2, tagValue2) } +const testAccVPCConfig_tags_computed = ` +resource "aws_eip" "test" { + vpc = true +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + eip = aws_eip.test.public_ip + } +} +` + func testAccVPCConfig_ignoreChangesDynamicTagsMergedLocals(localTagKey1, localTagValue1 string) string { return fmt.Sprintf(` locals { diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 65ebe3067837..20b8823687ba 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -746,8 +746,11 @@ type schemaResourceData interface { } func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { + // remove default config. + t := tags.RemoveDefaultConfig(defaultConfig) + result := make(map[string]string) - for k, v := range tags { + for k, v := range t { result[k] = v.ValueString() } @@ -767,7 +770,7 @@ func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *D // if the config is null just return the incoming tags // no duplicates to calculate if c.IsNull() { - return tags + return t } if !c.IsNull() && c.IsKnown() { From 3d79521bcd966ee9a498c6f35828004781486d70 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 21 Apr 2023 11:01:26 -0500 Subject: [PATCH 064/304] test: zero value tags --- internal/service/ec2/vpc_test.go | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 8c83c1f2491b..1b39652dbbec 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -159,6 +159,59 @@ func TestAccVPC_tags_computed(t *testing.T) { }) } +func TestAccVPC_DefaultTags_zeroValue(t *testing.T) { + ctx := acctest.Context(t) + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckVPCDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: acctest.ConfigCompose( + acctest.ConfigDefaultTags_Tags1("key1", ""), + testAccVPCConfig_basic, + ), + Check: resource.ComposeTestCheckFunc( + acctest.CheckVPCExists(ctx, resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", ""), + ), + }, + { + Config: acctest.ConfigCompose( + acctest.ConfigDefaultTags_Tags1("key1", ""), + testAccVPCConfig_tags1("key2", ""), + ), + Check: resource.ComposeTestCheckFunc( + acctest.CheckVPCExists(ctx, resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", ""), + resource.TestCheckResourceAttr(resourceName, "tags_all.key2", ""), + ), + }, + { + Config: acctest.ConfigCompose( + acctest.ConfigDefaultTags_Tags1("key1", "value1"), + testAccVPCConfig_tags1("key2", ""), + ), + Check: resource.ComposeTestCheckFunc( + acctest.CheckVPCExists(ctx, resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key2", ""), + ), + }, + }, + }) +} + func TestAccVPC_DefaultTags_providerOnlyTestAccVPC_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) var vpc ec2.Vpc From 025ed976abcb132444c853ac4fcc764c9a020ff0 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 21 Apr 2023 11:09:11 -0500 Subject: [PATCH 065/304] testfmt --- internal/service/ec2/vpc_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 1b39652dbbec..938b3842dd27 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -1122,7 +1122,7 @@ resource "aws_vpc" "test" { const testAccVPCConfig_tags_computed = ` resource "aws_eip" "test" { - vpc = true + vpc = true } resource "aws_vpc" "test" { From 394de933f839c018f5bc1a0d7996be2a5fe36caf Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 21 Apr 2023 13:29:17 -0500 Subject: [PATCH 066/304] fix rebase conflicts --- CHANGELOG.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc744711650..25df38e0e136 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,24 +24,6 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) -BREAKING CHANGES: - -* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) -* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) - -NOTES: - -* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) - -BREAKING CHANGES: - -* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) -* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) - -NOTES: - -* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) - FEATURES: * **New Data Source:** `aws_dms_endpoint` ([#30717](https://github.com/hashicorp/terraform-provider-aws/issues/30717)) From 2da2e99b2ed147161e340b740ca9c0ade6f9377d Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 21 Apr 2023 14:20:09 -0500 Subject: [PATCH 067/304] lintfix --- internal/provider/tags_interceptor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/tags_interceptor_test.go b/internal/provider/tags_interceptor_test.go index 76cbad8723f3..8eb3449db4dd 100644 --- a/internal/provider/tags_interceptor_test.go +++ b/internal/provider/tags_interceptor_test.go @@ -83,7 +83,7 @@ func TestTagsInterceptor(t *testing.T) { } bootstrapContext := func(ctx context.Context, meta any) context.Context { - ctx = conns.NewContext(ctx, "Test", "aws_test") + ctx = conns.NewResourceContext(ctx, "Test", "aws_test") if v, ok := meta.(*conns.AWSClient); ok { ctx = tftags.NewContext(ctx, v.DefaultTagsConfig, v.IgnoreTagsConfig) } From ab0efcf50508bbd78112155cf05725484f628412 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 21 Apr 2023 16:40:29 -0400 Subject: [PATCH 068/304] networkmanager/core: Remove policy_document arg --- .../service/networkmanager/core_network.go | 77 +--------------- .../networkmanager/core_network_test.go | 91 ------------------- 2 files changed, 4 insertions(+), 164 deletions(-) diff --git a/internal/service/networkmanager/core_network.go b/internal/service/networkmanager/core_network.go index 5b644e36ccac..5e7db2914d6c 100644 --- a/internal/service/networkmanager/core_network.go +++ b/internal/service/networkmanager/core_network.go @@ -12,11 +12,9 @@ import ( "github.com/aws/aws-sdk-go/service/networkmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" @@ -43,10 +41,7 @@ func ResourceCoreNetwork() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, - CustomizeDiff: customdiff.Sequence( - resourceCoreNetworkCustomizeDiff, - verify.SetTagsDiff, - ), + CustomizeDiff: verify.SetTagsDiff, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(30 * time.Minute), @@ -77,10 +72,9 @@ func ResourceCoreNetwork() *schema.Resource { ConflictsWith: []string{"base_policy_region"}, }, "create_base_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ConflictsWith: []string{"policy_document"}, + Type: schema.TypeBool, + Optional: true, + Default: false, }, "created_at": { Type: schema.TypeString, @@ -118,23 +112,6 @@ func ResourceCoreNetwork() *schema.Resource { ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 50), }, - "policy_document": { - Deprecated: "Use the aws_networkmanager_core_network_policy_attachment resource instead. " + - "This attribute will be removed in the next major version of the provider.", - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validation.All( - validation.StringLenBetween(0, 10000000), - validation.StringIsJSON, - ), - DiffSuppressFunc: verify.SuppressEquivalentJSONDiffs, - StateFunc: func(v interface{}) string { - json, _ := structure.NormalizeJsonString(v) - return json - }, - ConflictsWith: []string{"create_base_policy"}, - }, "segments": { Type: schema.TypeList, Computed: true, @@ -181,14 +158,9 @@ func resourceCoreNetworkCreate(ctx context.Context, d *schema.ResourceData, meta input.Description = aws.String(v.(string)) } - if v, ok := d.GetOk("policy_document"); ok { - input.PolicyDocument = aws.String(v.(string)) - } - // check if the user wants to create a base policy document // this creates the core network with a starting policy document set to LIVE // this is required for the first terraform apply if there attachments to the core network - // and the core network is created without the policy_document argument set if _, ok := d.GetOk("create_base_policy"); ok { // if user supplies a region or multiple regions use it in the base policy, otherwise use current region regions := []interface{}{meta.(*conns.AWSClient).Region} @@ -251,24 +223,6 @@ func resourceCoreNetworkRead(ctx context.Context, d *schema.ResourceData, meta i } d.Set("state", coreNetwork.State) - // getting the policy document uses a different API call - // policy document is also optional - coreNetworkPolicy, err := FindCoreNetworkPolicyByID(ctx, conn, d.Id()) - - if tfresource.NotFound(err) { - d.Set("policy_document", nil) - } else if err != nil { - return diag.Errorf("reading Network Manager Core Network (%s) policy: %s", d.Id(), err) - } else { - encodedPolicyDocument, err := protocol.EncodeJSONValue(coreNetworkPolicy.PolicyDocument, protocol.NoEscape) - - if err != nil { - return diag.Errorf("encoding Network Manager Core Network (%s) policy document: %s", d.Id(), err) - } - - d.Set("policy_document", encodedPolicyDocument) - } - SetTagsOut(ctx, coreNetwork.Tags) return nil @@ -292,18 +246,6 @@ func resourceCoreNetworkUpdate(ctx context.Context, d *schema.ResourceData, meta } } - if d.HasChange("policy_document") { - err := PutAndExecuteCoreNetworkPolicy(ctx, conn, d.Id(), d.Get("policy_document").(string)) - - if err != nil { - return diag.FromErr(err) - } - - if _, err := waitCoreNetworkUpdated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { - return diag.Errorf("waiting for Network Manager Core Network (%s) update: %s", d.Id(), err) - } - } - if d.HasChange("create_base_policy") { if _, ok := d.GetOk("create_base_policy"); ok { // if user supplies a region or multiple regions use it in the base policy, otherwise use current region @@ -358,17 +300,6 @@ func resourceCoreNetworkDelete(ctx context.Context, d *schema.ResourceData, meta return nil } -func resourceCoreNetworkCustomizeDiff(_ context.Context, d *schema.ResourceDiff, meta interface{}) error { - if d.HasChange("policy_document") { - if o, n := d.GetChange("policy_document"); !verify.JSONStringsEqual(o.(string), n.(string)) { - d.SetNewComputed("edges") - d.SetNewComputed("segments") - } - } - - return nil -} - func FindCoreNetworkByID(ctx context.Context, conn *networkmanager.NetworkManager, id string) (*networkmanager.CoreNetwork, error) { input := &networkmanager.GetCoreNetworkInput{ CoreNetworkId: aws.String(id), diff --git a/internal/service/networkmanager/core_network_test.go b/internal/service/networkmanager/core_network_test.go index ae72395c3bab..a6bc1387d12f 100644 --- a/internal/service/networkmanager/core_network_test.go +++ b/internal/service/networkmanager/core_network_test.go @@ -33,7 +33,6 @@ func TestAccNetworkManagerCoreNetwork_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "created_at"), resource.TestCheckResourceAttr(resourceName, "description", ""), resource.TestMatchResourceAttr(resourceName, "id", regexp.MustCompile(`core-network-.+`)), - resource.TestCheckResourceAttr(resourceName, "policy_document", ""), resource.TestCheckResourceAttr(resourceName, "state", networkmanager.CoreNetworkStateAvailable), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), @@ -151,64 +150,6 @@ func TestAccNetworkManagerCoreNetwork_description(t *testing.T) { }) } -func TestAccNetworkManagerCoreNetwork_policyDocument(t *testing.T) { - ctx := acctest.Context(t) - resourceName := "aws_networkmanager_core_network.test" - originalSegmentValue := "segmentValue1" - updatedSegmentValue := "segmentValue2" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccCoreNetworkConfig_policyDocument(originalSegmentValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckCoreNetworkExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"65022-65534\"],\"edge-locations\":[{\"location\":\"%s\"}],\"vpn-ecmp-support\":true},\"segments\":[{\"isolate-attachments\":false,\"name\":\"%s\",\"require-attachment-acceptance\":true}],\"version\":\"2021.12\"}", acctest.Region(), originalSegmentValue)), - resource.TestCheckTypeSetElemNestedAttrs(resourceName, "edges.*", map[string]string{ - "asn": "65022", - "edge_location": acctest.Region(), - "inside_cidr_blocks.#": "0", - }), - resource.TestCheckTypeSetElemNestedAttrs(resourceName, "segments.*", map[string]string{ - "edge_locations.#": "1", - "edge_locations.0": acctest.Region(), - "name": originalSegmentValue, - "shared_segments.#": "0", - }), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"create_base_policy"}, - }, - { - Config: testAccCoreNetworkConfig_policyDocument(updatedSegmentValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckCoreNetworkExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"65022-65534\"],\"edge-locations\":[{\"location\":\"%s\"}],\"vpn-ecmp-support\":true},\"segments\":[{\"isolate-attachments\":false,\"name\":\"%s\",\"require-attachment-acceptance\":true}],\"version\":\"2021.12\"}", acctest.Region(), updatedSegmentValue)), - resource.TestCheckTypeSetElemNestedAttrs(resourceName, "edges.*", map[string]string{ - "asn": "65022", - "edge_location": acctest.Region(), - "inside_cidr_blocks.#": "0", - }), - resource.TestCheckTypeSetElemNestedAttrs(resourceName, "segments.*", map[string]string{ - "edge_locations.#": "1", - "edge_locations.0": acctest.Region(), - "name": updatedSegmentValue, - "shared_segments.#": "0", - }), - ), - }, - }, - }) -} - func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_networkmanager_core_network.test" @@ -224,7 +165,6 @@ func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion(t *t Check: resource.ComposeTestCheckFunc( testAccCheckCoreNetworkExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "create_base_policy", "true"), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"64512-65534\"],\"edge-locations\":[{\"location\":\"%s\"}],\"vpn-ecmp-support\":false},\"segments\":[{\"description\":\"base-policy\",\"isolate-attachments\":false,\"name\":\"segment\",\"require-attachment-acceptance\":false}],\"version\":\"2021.12\"}", acctest.Region())), resource.TestCheckNoResourceAttr(resourceName, "base_policy_region"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "edges.*", map[string]string{ "asn": "64512", @@ -264,7 +204,6 @@ func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion(t *test Check: resource.ComposeTestCheckFunc( testAccCheckCoreNetworkExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "create_base_policy", "true"), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"64512-65534\"],\"edge-locations\":[{\"location\":\"%s\"}],\"vpn-ecmp-support\":false},\"segments\":[{\"description\":\"base-policy\",\"isolate-attachments\":false,\"name\":\"segment\",\"require-attachment-acceptance\":false}],\"version\":\"2021.12\"}", acctest.AlternateRegion())), resource.TestCheckResourceAttr(resourceName, "base_policy_region", acctest.AlternateRegion()), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "edges.*", map[string]string{ "asn": "64512", @@ -304,9 +243,6 @@ func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion(t Check: resource.ComposeTestCheckFunc( testAccCheckCoreNetworkExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "create_base_policy", "true"), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"64512-65534\"],\"edge-locations\":[{\"location\":\"%s\"},{\"location\":\"%s\"}],\"vpn-ecmp-support\":false},\"segments\":[{\"description\":\"base-policy\",\"isolate-attachments\":false,\"name\":\"segment\",\"require-attachment-acceptance\":false}],\"version\":\"2021.12\"}", acctest.AlternateRegion(), acctest.Region())), - // use test below if locations are unordered - // resource.TestMatchResourceAttr(resourceName, "policy_document", regexp.MustCompile(`{"core-network-configuration":{"asn-ranges":\["64512-65534"\],"edge-locations":\[{"location":".+"},{"location":".+"}\],"vpn-ecmp-support":false},"segments":\[{"description":"base-policy","isolate-attachments":false,"name":"segment","require-attachment-acceptance":false}\],"version":"2021.12"}`)), resource.TestCheckResourceAttr(resourceName, "base_policy_regions.#", "2"), resource.TestCheckTypeSetElemAttr(resourceName, "base_policy_regions.*", acctest.AlternateRegion()), resource.TestCheckTypeSetElemAttr(resourceName, "base_policy_regions.*", acctest.Region()), @@ -351,7 +287,6 @@ func TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePol Config: testAccCoreNetworkConfig_basic(), Check: resource.ComposeTestCheckFunc( testAccCheckCoreNetworkExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "policy_document", ""), ), }, { @@ -365,7 +300,6 @@ func TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePol Check: resource.ComposeTestCheckFunc( testAccCheckCoreNetworkExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "create_base_policy", "true"), - resource.TestCheckResourceAttr(resourceName, "policy_document", fmt.Sprintf("{\"core-network-configuration\":{\"asn-ranges\":[\"64512-65534\"],\"edge-locations\":[{\"location\":\"%s\"}],\"vpn-ecmp-support\":false},\"segments\":[{\"description\":\"base-policy\",\"isolate-attachments\":false,\"name\":\"segment\",\"require-attachment-acceptance\":false}],\"version\":\"2021.12\"}", acctest.Region())), resource.TestCheckNoResourceAttr(resourceName, "base_policy_region"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "edges.*", map[string]string{ "asn": "64512", @@ -478,31 +412,6 @@ resource "aws_networkmanager_core_network" "test" { `, description) } -func testAccCoreNetworkConfig_policyDocument(segmentValue string) string { - return fmt.Sprintf(` -resource "aws_networkmanager_global_network" "test" {} - -data "aws_networkmanager_core_network_policy_document" "test" { - core_network_configuration { - asn_ranges = ["65022-65534"] - - edge_locations { - location = %[2]q - } - } - - segments { - name = %[1]q - } -} - -resource "aws_networkmanager_core_network" "test" { - global_network_id = aws_networkmanager_global_network.test.id - policy_document = data.aws_networkmanager_core_network_policy_document.test.json -} -`, segmentValue, acctest.Region()) -} - func testAccCoreNetworkConfig_basePolicyDocumentWithoutRegion() string { return ` resource "aws_networkmanager_global_network" "test" {} From 7d75213a356737e0ea4012138dae9a6e2beef9cd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 21 Apr 2023 16:51:31 -0400 Subject: [PATCH 069/304] Add changelog, update docs --- .changelog/30875.txt | 7 +++++++ website/docs/r/networkmanager_core_network.html.markdown | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .changelog/30875.txt diff --git a/.changelog/30875.txt b/.changelog/30875.txt new file mode 100644 index 000000000000..39e28b3957d9 --- /dev/null +++ b/.changelog/30875.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change +resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead +``` + +```release-note:note +resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument +``` \ No newline at end of file diff --git a/website/docs/r/networkmanager_core_network.html.markdown b/website/docs/r/networkmanager_core_network.html.markdown index 0fa9ee9c95d7..f176559516f9 100644 --- a/website/docs/r/networkmanager_core_network.html.markdown +++ b/website/docs/r/networkmanager_core_network.html.markdown @@ -10,8 +10,6 @@ description: |- Provides a core network resource. -~> **NOTE on Core Networks and Policy Attachments:** For a given core network, this resource's `policy_document` argument is incompatible with using the [`aws_networkmanager_core_network_policy_attachment` resource](/docs/providers/aws/r/networkmanager_core_network_policy_attachment.html). When using this resource's `policy_document` argument and the `aws_networkmanager_core_network_policy_attachment` resource, both will attempt to manage the core network's policy document and Terraform will show a permanent difference. - ## Example Usage ### Basic @@ -176,7 +174,7 @@ The following arguments are supported: * `description` - (Optional) Description of the Core Network. * `base_policy_region` - (Optional, **Deprecated** use the `base_policy_regions` argument instead) The base policy created by setting the `create_base_policy` argument to `true` requires a region to be set in the `edge-locations`, `location` key. If `base_policy_region` is not specified, the region used in the base policy defaults to the region specified in the `provider` block. * `base_policy_regions` - (Optional) A list of regions to add to the base policy. The base policy created by setting the `create_base_policy` argument to `true` requires one or more regions to be set in the `edge-locations`, `location` key. If `base_policy_regions` is not specified, the region used in the base policy defaults to the region specified in the `provider` block. -* `create_base_policy` - (Optional) Specifies whether to create a base policy when a core network is created or updated. A base policy is created and set to `LIVE` to allow attachments to the core network (e.g. VPC Attachments) before applying a policy document provided using the [`aws_networkmanager_core_network_policy_attachment` resource](/docs/providers/aws/r/networkmanager_core_network_policy_attachment.html). This base policy is needed if your core network does not have any `LIVE` policies (e.g. a core network resource created without the `policy_document` argument) and your policy document has static routes pointing to VPC attachments and you want to attach your VPCs to the core network before applying the desired policy document. Valid values are `true` or `false`. Conflicts with `policy_document`. An example of this Terraform snippet can be found above [for VPC Attachment in a single region](#with-vpc-attachment-single-region) and [for VPC Attachment multi-region](#with-vpc-attachment-multi-region). An example base policy is shown below. This base policy is overridden with the policy that you specify in the [`aws_networkmanager_core_network_policy_attachment` resource](/docs/providers/aws/r/networkmanager_core_network_policy_attachment.html). +* `create_base_policy` - (Optional) Specifies whether to create a base policy when a core network is created or updated. A base policy is created and set to `LIVE` to allow attachments to the core network (e.g. VPC Attachments) before applying a policy document provided using the [`aws_networkmanager_core_network_policy_attachment` resource](/docs/providers/aws/r/networkmanager_core_network_policy_attachment.html). This base policy is needed if your core network does not have any `LIVE` policies and your policy document has static routes pointing to VPC attachments and you want to attach your VPCs to the core network before applying the desired policy document. Valid values are `true` or `false`. An example of this Terraform snippet can be found above [for VPC Attachment in a single region](#with-vpc-attachment-single-region) and [for VPC Attachment multi-region](#with-vpc-attachment-multi-region). An example base policy is shown below. This base policy is overridden with the policy that you specify in the [`aws_networkmanager_core_network_policy_attachment` resource](/docs/providers/aws/r/networkmanager_core_network_policy_attachment.html). ```json { @@ -204,7 +202,6 @@ The following arguments are supported: ``` * `global_network_id` - (Required) The ID of the global network that a core network will be a part of. -* `policy_document` - (Optional, **Deprecated** use the [`aws_networkmanager_core_network_policy_attachment`](networkmanager_core_network_policy_attachment.html) resource instead) Policy document for creating a core network. Note that updating this argument will result in the new policy document version being set as the `LATEST` and `LIVE` policy document. Refer to the [Core network policies documentation](https://docs.aws.amazon.com/network-manager/latest/cloudwan/cloudwan-policy-change-sets.html) for more information. Conflicts with `create_base_policy`. * `tags` - (Optional) Key-value tags for the Core Network. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Timeouts From 16b72ad91c493193cac1cd19904fee5fe37d2d0b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 24 Apr 2023 23:27:20 +0000 Subject: [PATCH 070/304] Update CHANGELOG.md for #30793 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25df38e0e136..6f1ecae5a082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ ## 4.65.0 (Unreleased) +BREAKING CHANGES: + +* data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) + +NOTES: + +* resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) + FEATURES: * **New Resource:** `aws_synthetics_group` ([#30678](https://github.com/hashicorp/terraform-provider-aws/issues/30678)) From 52d30ea41189c0c826b98922b272ce5ed93f001e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 25 Apr 2023 10:48:22 -0400 Subject: [PATCH 071/304] docs: Remove unneeded note --- .../networkmanager_core_network_policy_attachment.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/r/networkmanager_core_network_policy_attachment.html.markdown b/website/docs/r/networkmanager_core_network_policy_attachment.html.markdown index 296993157add..841aea6e0e04 100644 --- a/website/docs/r/networkmanager_core_network_policy_attachment.html.markdown +++ b/website/docs/r/networkmanager_core_network_policy_attachment.html.markdown @@ -10,8 +10,6 @@ description: |- Provides a Core Network Policy Attachment resource. This puts a Core Network Policy to an existing Core Network and executes the change set, which deploys changes globally based on the policy submitted (Sets the policy to `LIVE`). -~> **NOTE on Core Networks and Policy Attachments:** For a given policy attachment, this resource is incompatible with using the [`aws_networkmanager_core_network` resource](/docs/providers/aws/r/networkmanager_core_network.html) `policy_document` argument. When using that argument and this resource, both will attempt to manage the core network's policy document and Terraform will show a permanent difference. - ~> **NOTE:** Deleting this resource will not delete the current policy defined in this resource. Deleting this resource will also not revert the current `LIVE` policy to the previous version. ## Example Usage From 3f73a0a1049ed8d64ae222010b62abaced513f14 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 25 Apr 2023 15:21:38 +0000 Subject: [PATCH 072/304] Update CHANGELOG.md for #30875 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f1ecae5a082..c5eeb32d2b06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ BREAKING CHANGES: * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) NOTES: * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From 4f67f5cc3d643e9f11ed1f0944c025fa1c88d1c3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 08:41:10 -0400 Subject: [PATCH 073/304] r/aws_db_security_group: Remove resource. --- .changelog/#####.txt | 3 + internal/service/rds/security_group.go | 316 ------------------ internal/service/rds/service_package_gen.go | 8 - .../docs/r/db_security_group.html.markdown | 61 ---- 4 files changed, 3 insertions(+), 385 deletions(-) create mode 100644 .changelog/#####.txt delete mode 100644 internal/service/rds/security_group.go delete mode 100644 website/docs/r/db_security_group.html.markdown diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..e35c354f37f8 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +provider: With the retirement of EC2-Classic the`aws_db_security_group` resource has been removed +``` \ No newline at end of file diff --git a/internal/service/rds/security_group.go b/internal/service/rds/security_group.go deleted file mode 100644 index c4afc8c981c0..000000000000 --- a/internal/service/rds/security_group.go +++ /dev/null @@ -1,316 +0,0 @@ -package rds - -import ( - "bytes" - "context" - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/create" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/internal/verify" - "github.com/hashicorp/terraform-provider-aws/names" -) - -// @SDKResource("aws_db_security_group", name="DB Security Group") -// @Tags(identifierAttribute="arn") -func ResourceSecurityGroup() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceSecurityGroupCreate, - ReadWithoutTimeout: resourceSecurityGroupRead, - UpdateWithoutTimeout: resourceSecurityGroupUpdate, - DeleteWithoutTimeout: resourceSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - - Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - - "ingress": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr": { - Type: schema.TypeString, - Optional: true, - }, - - "security_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_owner_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, - Set: resourceSecurityGroupIngressHash, - }, - - names.AttrTags: tftags.TagsSchema(), - names.AttrTagsAll: tftags.TagsSchemaComputed(), - }, - - CustomizeDiff: verify.SetTagsDiff, - - DeprecationMessage: `With the retirement of EC2-Classic the aws_db_security_group resource has been deprecated and will be removed in a future version.`, - } -} - -func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new RDS DB Security Groups can be created`) -} - -func resourceSecurityGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - - sg, err := resourceSecurityGroupRetrieve(ctx, d, meta) - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading RDS DB Security Group (%s): %s", d.Id(), err) - } - - d.Set("name", sg.DBSecurityGroupName) - d.Set("description", sg.DBSecurityGroupDescription) - - // Create an empty schema.Set to hold all ingress rules - rules := &schema.Set{ - F: resourceSecurityGroupIngressHash, - } - - for _, v := range sg.IPRanges { - rule := map[string]interface{}{"cidr": *v.CIDRIP} - rules.Add(rule) - } - - for _, g := range sg.EC2SecurityGroups { - rule := map[string]interface{}{} - if g.EC2SecurityGroupId != nil { - rule["security_group_id"] = aws.StringValue(g.EC2SecurityGroupId) - } - if g.EC2SecurityGroupName != nil { - rule["security_group_name"] = aws.StringValue(g.EC2SecurityGroupName) - } - if g.EC2SecurityGroupOwnerId != nil { - rule["security_group_owner_id"] = aws.StringValue(g.EC2SecurityGroupOwnerId) - } - rules.Add(rule) - } - - d.Set("ingress", rules) - - arn := aws.StringValue(sg.DBSecurityGroupArn) - d.Set("arn", arn) - - return diags -} - -func resourceSecurityGroupUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).RDSConn() - - if d.HasChange("ingress") { - sg, err := resourceSecurityGroupRetrieve(ctx, d, meta) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating RDS DB Security Group (%s): %s", d.Id(), err) - } - - oi, ni := d.GetChange("ingress") - if oi == nil { - oi = new(schema.Set) - } - if ni == nil { - ni = new(schema.Set) - } - - ois := oi.(*schema.Set) - nis := ni.(*schema.Set) - removeIngress := ois.Difference(nis).List() - newIngress := nis.Difference(ois).List() - - // DELETE old Ingress rules - for _, ing := range removeIngress { - err := resourceSecurityGroupRevokeRule(ctx, ing, *sg.DBSecurityGroupName, conn) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating RDS DB Security Group (%s): revoking ingress: %s", d.Id(), err) - } - } - - // ADD new/updated Ingress rules - for _, ing := range newIngress { - err := resourceSecurityGroupAuthorizeRule(ctx, ing, *sg.DBSecurityGroupName, conn) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating RDS DB Security Group (%s): authorizing ingress: %s", d.Id(), err) - } - } - } - - return append(diags, resourceSecurityGroupRead(ctx, d, meta)...) -} - -func resourceSecurityGroupDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).RDSConn() - - log.Printf("[DEBUG] DB Security Group destroy: %v", d.Id()) - - opts := rds.DeleteDBSecurityGroupInput{DBSecurityGroupName: aws.String(d.Id())} - - _, err := conn.DeleteDBSecurityGroupWithContext(ctx, &opts) - if err != nil { - if tfawserr.ErrCodeEquals(err, "InvalidDBSecurityGroup.NotFound") { - return diags - } - return sdkdiag.AppendErrorf(diags, "deleting RDS DB Security Group (%s): %s", d.Id(), err) - } - - return diags -} - -func resourceSecurityGroupRetrieve(ctx context.Context, d *schema.ResourceData, meta interface{}) (*rds.DBSecurityGroup, error) { - conn := meta.(*conns.AWSClient).RDSConn() - - opts := rds.DescribeDBSecurityGroupsInput{ - DBSecurityGroupName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] DB Security Group describe configuration: %#v", opts) - - resp, err := conn.DescribeDBSecurityGroupsWithContext(ctx, &opts) - if err != nil { - return nil, fmt.Errorf("Error retrieving DB Security Groups: %s", err) - } - - if len(resp.DBSecurityGroups) != 1 || - aws.StringValue(resp.DBSecurityGroups[0].DBSecurityGroupName) != d.Id() { - return nil, fmt.Errorf("Unable to find DB Security Group: %#v", resp.DBSecurityGroups) - } - - return resp.DBSecurityGroups[0], nil -} - -// Authorizes the ingress rule on the db security group -func resourceSecurityGroupAuthorizeRule(ctx context.Context, ingress interface{}, dbSecurityGroupName string, conn *rds.RDS) error { - ing := ingress.(map[string]interface{}) - - opts := rds.AuthorizeDBSecurityGroupIngressInput{ - DBSecurityGroupName: aws.String(dbSecurityGroupName), - } - - if attr, ok := ing["cidr"]; ok && attr != "" { - opts.CIDRIP = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_name"]; ok && attr != "" { - opts.EC2SecurityGroupName = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_id"]; ok && attr != "" { - opts.EC2SecurityGroupId = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_owner_id"]; ok && attr != "" { - opts.EC2SecurityGroupOwnerId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Authorize ingress rule configuration: %#v", opts) - - _, err := conn.AuthorizeDBSecurityGroupIngressWithContext(ctx, &opts) - if err != nil { - return fmt.Errorf("Error authorizing security group ingress: %s", err) - } - - return nil -} - -// Revokes the ingress rule on the db security group -func resourceSecurityGroupRevokeRule(ctx context.Context, ingress interface{}, dbSecurityGroupName string, conn *rds.RDS) error { - ing := ingress.(map[string]interface{}) - - opts := rds.RevokeDBSecurityGroupIngressInput{ - DBSecurityGroupName: aws.String(dbSecurityGroupName), - } - - if attr, ok := ing["cidr"]; ok && attr != "" { - opts.CIDRIP = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_name"]; ok && attr != "" { - opts.EC2SecurityGroupName = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_id"]; ok && attr != "" { - opts.EC2SecurityGroupId = aws.String(attr.(string)) - } - - if attr, ok := ing["security_group_owner_id"]; ok && attr != "" { - opts.EC2SecurityGroupOwnerId = aws.String(attr.(string)) - } - - log.Printf("[DEBUG] Revoking ingress rule configuration: %#v", opts) - - _, err := conn.RevokeDBSecurityGroupIngressWithContext(ctx, &opts) - if err != nil { - return fmt.Errorf("Error revoking security group ingress: %s", err) - } - - return nil -} - -func resourceSecurityGroupIngressHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["cidr"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_owner_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return create.StringHashcode(buf.String()) -} diff --git a/internal/service/rds/service_package_gen.go b/internal/service/rds/service_package_gen.go index 64f2a8c6e404..b1972b05fef9 100644 --- a/internal/service/rds/service_package_gen.go +++ b/internal/service/rds/service_package_gen.go @@ -154,14 +154,6 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka Factory: ResourceProxyTarget, TypeName: "aws_db_proxy_target", }, - { - Factory: ResourceSecurityGroup, - TypeName: "aws_db_security_group", - Name: "DB Security Group", - Tags: &types.ServicePackageResourceTags{ - IdentifierAttribute: "arn", - }, - }, { Factory: ResourceSnapshot, TypeName: "aws_db_snapshot", diff --git a/website/docs/r/db_security_group.html.markdown b/website/docs/r/db_security_group.html.markdown deleted file mode 100644 index cc05d7f9b71e..000000000000 --- a/website/docs/r/db_security_group.html.markdown +++ /dev/null @@ -1,61 +0,0 @@ ---- -subcategory: "RDS (Relational Database)" -layout: "aws" -page_title: "AWS: aws_db_security_group" -description: |- - Provides an RDS security group resource. ---- - -# Resource: aws_db_security_group - -Provides an RDS security group resource. This is only for DB instances in the -EC2-Classic Platform. For instances inside a VPC, use the -[`aws_db_instance.vpc_security_group_ids`](/docs/providers/aws/r/db_instance.html#vpc_security_group_ids) -attribute instead. - -!> **WARNING:** With the retirement of EC2-Classic the `aws_db_security_group` resource has been deprecated and will be removed in a future version. Any existing resources can be removed from [Terraform state](https://www.terraform.io/language/state) using the [`terraform state rm`](https://www.terraform.io/cli/commands/state/rm#command-state-rm) command. - -## Example Usage - -```terraform -resource "aws_db_security_group" "default" { - name = "rds_sg" - - ingress { - cidr = "10.0.0.0/24" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) The name of the DB security group. -* `description` - (Optional) The description of the DB security group. Defaults to "Managed by Terraform". -* `ingress` - (Required) A list of ingress rules. -* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. - -Ingress blocks support the following: - -* `cidr` - The CIDR block to accept -* `security_group_name` - The name of the security group to authorize -* `security_group_id` - The ID of the security group to authorize -* `security_group_owner_id` - The owner Id of the security group provided - by `security_group_name`. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - The db security group ID. -* `arn` - The arn of the DB security group. -* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). - -## Import - -DB Security groups can be imported using the `name`, e.g., - -``` -$ terraform import aws_db_security_group.default aws_rds_sg-1 -``` From d9dcae57c57a9c457e4ff69b4e3c54284a12b878 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 08:49:52 -0400 Subject: [PATCH 074/304] r/aws_elasticache_security_group: Remove resource. --- .changelog/#####.txt | 4 + .../service/elasticache/security_group.go | 127 ------------------ .../elasticache/service_package_gen.go | 4 - internal/service/elasticache/sweep.go | 51 ------- .../elasticache_security_group.html.markdown | 56 -------- 5 files changed, 4 insertions(+), 238 deletions(-) delete mode 100644 internal/service/elasticache/security_group.go delete mode 100644 website/docs/r/elasticache_security_group.html.markdown diff --git a/.changelog/#####.txt b/.changelog/#####.txt index e35c354f37f8..0e8462732216 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,7 @@ ```release-note:breaking-change provider: With the retirement of EC2-Classic the`aws_db_security_group` resource has been removed +``` + +```release-note:breaking-change +provider: With the retirement of EC2-Classic the`aws_elasticache_security_group` resource has been removed ``` \ No newline at end of file diff --git a/internal/service/elasticache/security_group.go b/internal/service/elasticache/security_group.go deleted file mode 100644 index 22d907b7d45b..000000000000 --- a/internal/service/elasticache/security_group.go +++ /dev/null @@ -1,127 +0,0 @@ -package elasticache - -import ( - "context" - "log" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" -) - -// @SDKResource("aws_elasticache_security_group") -func ResourceSecurityGroup() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceSecurityGroupCreate, - ReadWithoutTimeout: resourceSecurityGroupRead, - DeleteWithoutTimeout: resourceSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - - Schema: map[string]*schema.Schema{ - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "security_group_names": { - Type: schema.TypeSet, - Required: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - - DeprecationMessage: `With the retirement of EC2-Classic the aws_elasticache_security_group resource has been deprecated and will be removed in a future version.`, - } -} - -func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new ElastiCache Security Groups can be created`) -} - -func resourceSecurityGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).ElastiCacheConn() - req := &elasticache.DescribeCacheSecurityGroupsInput{ - CacheSecurityGroupName: aws.String(d.Id()), - } - - res, err := conn.DescribeCacheSecurityGroupsWithContext(ctx, req) - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading ElastiCache Cache Security Group (%s): %s", d.Id(), err) - } - if len(res.CacheSecurityGroups) == 0 { - return sdkdiag.AppendErrorf(diags, "reading ElastiCache Cache Security Group (%s): empty response", d.Id()) - } - - var group *elasticache.CacheSecurityGroup - for _, g := range res.CacheSecurityGroups { - if aws.StringValue(g.CacheSecurityGroupName) == d.Id() { - group = g - } - } - if group == nil { - return sdkdiag.AppendErrorf(diags, "reading ElastiCache Cache Security Group (%s): not found", d.Id()) - } - - d.Set("name", group.CacheSecurityGroupName) - d.Set("description", group.Description) - - sgNames := make([]string, 0, len(group.EC2SecurityGroups)) - for _, sg := range group.EC2SecurityGroups { - sgNames = append(sgNames, *sg.EC2SecurityGroupName) - } - d.Set("security_group_names", sgNames) - - return diags -} - -func resourceSecurityGroupDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).ElastiCacheConn() - - log.Printf("[DEBUG] Cache security group delete: %s", d.Id()) - - err := retry.RetryContext(ctx, 5*time.Minute, func() *retry.RetryError { - _, err := conn.DeleteCacheSecurityGroupWithContext(ctx, &elasticache.DeleteCacheSecurityGroupInput{ - CacheSecurityGroupName: aws.String(d.Id()), - }) - - if tfawserr.ErrCodeEquals(err, "InvalidCacheSecurityGroupState", "DependencyViolation") { - return retry.RetryableError(err) - } - - if err != nil { - return retry.RetryableError(err) - } - - return nil - }) - - if tfresource.TimedOut(err) { - _, err = conn.DeleteCacheSecurityGroupWithContext(ctx, &elasticache.DeleteCacheSecurityGroupInput{ - CacheSecurityGroupName: aws.String(d.Id()), - }) - } - if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting ElastiCache Cache Security Group (%s): %s", d.Id(), err) - } - return diags -} diff --git a/internal/service/elasticache/service_package_gen.go b/internal/service/elasticache/service_package_gen.go index f283ad5f5c1e..1ea8e1994339 100644 --- a/internal/service/elasticache/service_package_gen.go +++ b/internal/service/elasticache/service_package_gen.go @@ -70,10 +70,6 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka IdentifierAttribute: "arn", }, }, - { - Factory: ResourceSecurityGroup, - TypeName: "aws_elasticache_security_group", - }, { Factory: ResourceSubnetGroup, TypeName: "aws_elasticache_subnet_group", diff --git a/internal/service/elasticache/sweep.go b/internal/service/elasticache/sweep.go index f04eaf17e280..289eca1a5ef2 100644 --- a/internal/service/elasticache/sweep.go +++ b/internal/service/elasticache/sweep.go @@ -55,15 +55,6 @@ func init() { }, }) - resource.AddTestSweepers("aws_elasticache_security_group", &resource.Sweeper{ - Name: "aws_elasticache_security_group", - F: sweepCacheSecurityGroups, - Dependencies: []string{ - "aws_elasticache_cluster", - "aws_elasticache_replication_group", - }, - }) - resource.AddTestSweepers("aws_elasticache_subnet_group", &resource.Sweeper{ Name: "aws_elasticache_subnet_group", F: sweepSubnetGroups, @@ -270,48 +261,6 @@ func sweepReplicationGroups(region string) error { return errs.ErrorOrNil() } -func sweepCacheSecurityGroups(region string) error { - ctx := sweep.Context(region) - client, err := sweep.SharedRegionalSweepClient(region) - if err != nil { - return fmt.Errorf("error getting client: %s", err) - } - conn := client.(*conns.AWSClient).ElastiCacheConn() - - err = conn.DescribeCacheSecurityGroupsPagesWithContext(ctx, &elasticache.DescribeCacheSecurityGroupsInput{}, func(page *elasticache.DescribeCacheSecurityGroupsOutput, lastPage bool) bool { - if len(page.CacheSecurityGroups) == 0 { - log.Print("[DEBUG] No ElastiCache Cache Security Groups to sweep") - return false - } - - for _, securityGroup := range page.CacheSecurityGroups { - name := aws.StringValue(securityGroup.CacheSecurityGroupName) - - if name == "default" { - log.Printf("[INFO] Skipping ElastiCache Cache Security Group: %s", name) - continue - } - - log.Printf("[INFO] Deleting ElastiCache Cache Security Group: %s", name) - _, err := conn.DeleteCacheSecurityGroupWithContext(ctx, &elasticache.DeleteCacheSecurityGroupInput{ - CacheSecurityGroupName: aws.String(name), - }) - if err != nil { - log.Printf("[ERROR] Failed to delete ElastiCache Cache Security Group (%s): %s", name, err) - } - } - return !lastPage - }) - if err != nil { - if sweep.SkipSweepError(err) { - log.Printf("[WARN] Skipping ElastiCache Cache Security Group sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("Error retrieving ElastiCache Cache Security Groups: %s", err) - } - return nil -} - func sweepSubnetGroups(region string) error { ctx := sweep.Context(region) client, err := sweep.SharedRegionalSweepClient(region) diff --git a/website/docs/r/elasticache_security_group.html.markdown b/website/docs/r/elasticache_security_group.html.markdown deleted file mode 100644 index 1ee2f5e7d433..000000000000 --- a/website/docs/r/elasticache_security_group.html.markdown +++ /dev/null @@ -1,56 +0,0 @@ ---- -subcategory: "ElastiCache" -layout: "aws" -page_title: "AWS: aws_elasticache_security_group" -description: |- - Provides an ElastiCache Security Group to control access to one or more cache clusters. ---- - -# Resource: aws_elasticache_security_group - -Provides an ElastiCache Security Group to control access to one or more cache -clusters. - -~> **NOTE:** ElastiCache Security Groups are for use only when working with an -ElastiCache cluster **outside** of a VPC. If you are using a VPC, see the -[ElastiCache Subnet Group resource](elasticache_subnet_group.html). - -!> **WARNING:** With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been deprecated and will be removed in a future version. Any existing resources can be removed from [Terraform state](https://www.terraform.io/language/state) using the [`terraform state rm`](https://www.terraform.io/cli/commands/state/rm#command-state-rm) command. - -## Example Usage - -```terraform -resource "aws_security_group" "bar" { - name = "security-group" -} - -resource "aws_elasticache_security_group" "bar" { - name = "elasticache-security-group" - security_group_names = [aws_security_group.bar.name] -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` – (Required) Name for the cache security group. This value is stored as a lowercase string. -* `description` – (Optional) description for the cache security group. Defaults to "Managed by Terraform". -* `security_group_names` – (Required) List of EC2 security group names to be -authorized for ingress to the cache security group - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `description` -* `name` -* `security_group_names` - -## Import - -ElastiCache Security Groups can be imported by name, e.g., - -``` -$ terraform import aws_elasticache_security_group.my_ec_security_group ec-security-group-1 -``` From 18bc3955c16044ac2f587c77249f60fda906c1ed Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 08:51:57 -0400 Subject: [PATCH 075/304] r/aws_redshift_security_group: Remove resource. --- .changelog/#####.txt | 4 + internal/service/redshift/security_group.go | 291 ------------------ .../service/redshift/service_package_gen.go | 4 - .../r/redshift_security_group.html.markdown | 54 ---- 4 files changed, 4 insertions(+), 349 deletions(-) delete mode 100644 internal/service/redshift/security_group.go delete mode 100644 website/docs/r/redshift_security_group.html.markdown diff --git a/.changelog/#####.txt b/.changelog/#####.txt index 0e8462732216..0c2f05c0caa9 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -4,4 +4,8 @@ provider: With the retirement of EC2-Classic the`aws_db_security_group` resource ```release-note:breaking-change provider: With the retirement of EC2-Classic the`aws_elasticache_security_group` resource has been removed +``` + +```release-note:breaking-change +provider: With the retirement of EC2-Classic the`aws_redshift_security_group` resource has been removed ``` \ No newline at end of file diff --git a/internal/service/redshift/security_group.go b/internal/service/redshift/security_group.go deleted file mode 100644 index bc859c8e7ed5..000000000000 --- a/internal/service/redshift/security_group.go +++ /dev/null @@ -1,291 +0,0 @@ -package redshift - -import ( - "bytes" - "context" - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "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/create" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" -) - -// @SDKResource("aws_redshift_security_group") -func ResourceSecurityGroup() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceSecurityGroupCreate, - ReadWithoutTimeout: resourceSecurityGroupRead, - UpdateWithoutTimeout: resourceSecurityGroupUpdate, - DeleteWithoutTimeout: resourceSecurityGroupDelete, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.All( - validation.StringLenBetween(1, 255), - validation.StringNotInSlice([]string{"default"}, false), - validation.StringMatch(regexp.MustCompile(`^[0-9a-z-]+$`), "must contain only lowercase alphanumeric characters and hyphens"), - ), - }, - - "description": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: "Managed by Terraform", - }, - - "ingress": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cidr": { - Type: schema.TypeString, - Optional: true, - }, - - "security_group_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "security_group_owner_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - }, - }, - Set: resourceSecurityGroupIngressHash, - }, - }, - - DeprecationMessage: `With the retirement of EC2-Classic the aws_redshift_security_group resource has been deprecated and will be removed in a future version.`, - } -} - -func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Redshift Security Groups can be created`) -} - -func resourceSecurityGroupRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - sg, err := resourceSecurityGroupRetrieve(ctx, d, meta) - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading Redshift Security Group (%s): %s", d.Id(), err) - } - - rules := &schema.Set{ - F: resourceSecurityGroupIngressHash, - } - - for _, v := range sg.IPRanges { - rule := map[string]interface{}{"cidr": aws.StringValue(v.CIDRIP)} - rules.Add(rule) - } - - for _, g := range sg.EC2SecurityGroups { - rule := map[string]interface{}{ - "security_group_name": aws.StringValue(g.EC2SecurityGroupName), - "security_group_owner_id": aws.StringValue(g.EC2SecurityGroupOwnerId), - } - rules.Add(rule) - } - - d.Set("ingress", rules) - d.Set("name", sg.ClusterSecurityGroupName) - d.Set("description", sg.Description) - - return diags -} - -func resourceSecurityGroupUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).RedshiftConn() - - if d.HasChange("ingress") { - o, n := d.GetChange("ingress") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } - - os := o.(*schema.Set) - ns := n.(*schema.Set) - - removeIngressRules := expandSGRevokeIngress(os.Difference(ns).List()) - if len(removeIngressRules) > 0 { - for _, r := range removeIngressRules { - r.ClusterSecurityGroupName = aws.String(d.Id()) - - _, err := conn.RevokeClusterSecurityGroupIngressWithContext(ctx, &r) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Redshift Security Group (%s): revoking ingress: %s", d.Id(), err) - } - } - } - - addIngressRules := expandSGAuthorizeIngress(ns.Difference(os).List()) - if len(addIngressRules) > 0 { - for _, r := range addIngressRules { - r.ClusterSecurityGroupName = aws.String(d.Id()) - - _, err := conn.AuthorizeClusterSecurityGroupIngressWithContext(ctx, &r) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Redshift Security Group (%s): authorizing ingress: %s", d.Id(), err) - } - } - } - } - return append(diags, resourceSecurityGroupRead(ctx, d, meta)...) -} - -func resourceSecurityGroupDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).RedshiftConn() - - log.Printf("[DEBUG] Redshift Security Group destroy: %v", d.Id()) - opts := redshift.DeleteClusterSecurityGroupInput{ - ClusterSecurityGroupName: aws.String(d.Id()), - } - - _, err := conn.DeleteClusterSecurityGroupWithContext(ctx, &opts) - - if tfawserr.ErrCodeEquals(err, "InvalidRedshiftSecurityGroup.NotFound") { - return diags - } - - if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting Redshift Security Group (%s): %s", d.Id(), err) - } - - return diags -} - -func resourceSecurityGroupRetrieve(ctx context.Context, d *schema.ResourceData, meta interface{}) (*redshift.ClusterSecurityGroup, error) { - conn := meta.(*conns.AWSClient).RedshiftConn() - - opts := redshift.DescribeClusterSecurityGroupsInput{ - ClusterSecurityGroupName: aws.String(d.Id()), - } - - resp, err := conn.DescribeClusterSecurityGroupsWithContext(ctx, &opts) - if err != nil { - return nil, &retry.NotFoundError{ - LastError: err, - LastRequest: opts, - } - } - - if len(resp.ClusterSecurityGroups) == 0 || resp.ClusterSecurityGroups[0] == nil { - return nil, tfresource.NewEmptyResultError(opts) - } - - if l := len(resp.ClusterSecurityGroups); l > 1 { - return nil, tfresource.NewTooManyResultsError(l, opts) - } - - result := resp.ClusterSecurityGroups[0] - if aws.StringValue(result.ClusterSecurityGroupName) != d.Id() { - return nil, &retry.NotFoundError{ - LastRequest: opts, - } - } - - return result, nil -} - -func resourceSecurityGroupIngressHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v, ok := m["cidr"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - if v, ok := m["security_group_owner_id"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } - - return create.StringHashcode(buf.String()) -} - -func expandSGAuthorizeIngress(configured []interface{}) []redshift.AuthorizeClusterSecurityGroupIngressInput { - var ingress []redshift.AuthorizeClusterSecurityGroupIngressInput - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - i := redshift.AuthorizeClusterSecurityGroupIngressInput{} - - if v, ok := data["cidr"]; ok { - i.CIDRIP = aws.String(v.(string)) - } - - if v, ok := data["security_group_name"]; ok { - i.EC2SecurityGroupName = aws.String(v.(string)) - } - - if v, ok := data["security_group_owner_id"]; ok { - i.EC2SecurityGroupOwnerId = aws.String(v.(string)) - } - - ingress = append(ingress, i) - } - - return ingress -} - -func expandSGRevokeIngress(configured []interface{}) []redshift.RevokeClusterSecurityGroupIngressInput { - var ingress []redshift.RevokeClusterSecurityGroupIngressInput - - // Loop over our configured parameters and create - // an array of aws-sdk-go compatible objects - for _, pRaw := range configured { - data := pRaw.(map[string]interface{}) - - i := redshift.RevokeClusterSecurityGroupIngressInput{} - - if v, ok := data["cidr"]; ok { - i.CIDRIP = aws.String(v.(string)) - } - - if v, ok := data["security_group_name"]; ok { - i.EC2SecurityGroupName = aws.String(v.(string)) - } - - if v, ok := data["security_group_owner_id"]; ok { - i.EC2SecurityGroupOwnerId = aws.String(v.(string)) - } - - ingress = append(ingress, i) - } - - return ingress -} diff --git a/internal/service/redshift/service_package_gen.go b/internal/service/redshift/service_package_gen.go index 0f0c44825048..826d1bb73b1b 100644 --- a/internal/service/redshift/service_package_gen.go +++ b/internal/service/redshift/service_package_gen.go @@ -118,10 +118,6 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka Factory: ResourceScheduledAction, TypeName: "aws_redshift_scheduled_action", }, - { - Factory: ResourceSecurityGroup, - TypeName: "aws_redshift_security_group", - }, { Factory: ResourceSnapshotCopyGrant, TypeName: "aws_redshift_snapshot_copy_grant", diff --git a/website/docs/r/redshift_security_group.html.markdown b/website/docs/r/redshift_security_group.html.markdown deleted file mode 100644 index e152e7fb2ddb..000000000000 --- a/website/docs/r/redshift_security_group.html.markdown +++ /dev/null @@ -1,54 +0,0 @@ ---- -subcategory: "Redshift" -layout: "aws" -page_title: "AWS: aws_redshift_security_group" -description: |- - Provides a Redshift security group resource. ---- - -# Resource: aws_redshift_security_group - -Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters. - -!> **WARNING:** With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been deprecated and will be removed in a future version. Any existing resources can be removed from [Terraform state](https://www.terraform.io/language/state) using the [`terraform state rm`](https://www.terraform.io/cli/commands/state/rm#command-state-rm) command. - -## Example Usage - -```terraform -resource "aws_redshift_security_group" "default" { - name = "redshift-sg" - - ingress { - cidr = "10.0.0.0/24" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) The name of the Redshift security group. -* `description` - (Optional) The description of the Redshift security group. Defaults to "Managed by Terraform". -* `ingress` - (Optional) A list of ingress rules. - -Ingress blocks support the following: - -* `cidr` - The CIDR block to accept -* `security_group_name` - The name of the security group to authorize -* `security_group_owner_id` - The owner Id of the security group provided - by `security_group_name`. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - The Redshift security group ID. - -## Import - -Redshift security groups can be imported using the `name`, e.g., - -``` -$ terraform import aws_redshift_security_group.testgroup1 redshift_test_group -``` From 491377d145697aafa2b99da4c3cf4dad6f534df0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 11:54:13 -0400 Subject: [PATCH 076/304] r/aws_db_instance: Remove 'security_group_names'. --- .changelog/#####.txt | 4 ++++ internal/service/rds/instance.go | 22 ---------------------- website/docs/r/db_instance.html.markdown | 3 --- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index 0c2f05c0caa9..ae195ede2a6e 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -8,4 +8,8 @@ provider: With the retirement of EC2-Classic the`aws_elasticache_security_group` ```release-note:breaking-change provider: With the retirement of EC2-Classic the`aws_redshift_security_group` resource has been removed +``` + +```release-note:breaking-change +resource/aws_db_instance: With the retirement of EC2-Classic the`security_group_names` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 6973a477a146..859b397c4bd2 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -544,12 +544,6 @@ func ResourceInstance() *schema.Resource { }, }, }, - "security_group_names": { - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Deprecated: `With the retirement of EC2-Classic the security_group_names attribute has been deprecated and will be removed in a future version.`, - }, "skip_final_snapshot": { Type: schema.TypeBool, Optional: true, @@ -636,10 +630,6 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() - if v, ok := d.GetOk("security_group_names"); ok && v.(*schema.Set).Len() > 0 { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new RDS DB Instances can be created referencing RDS DB Security Groups`) - } - // Some API calls (e.g. CreateDBInstanceReadReplica and // RestoreDBInstanceFromDBSnapshot do not support all parameters to // correctly apply all settings in one pass. For missing parameters or @@ -1526,10 +1516,6 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in input.Port = aws.Int64(int64(v.(int))) } - if v := d.Get("security_group_names").(*schema.Set); v.Len() > 0 { - input.DBSecurityGroups = flex.ExpandStringSet(v) - } - if v, ok := d.GetOk("storage_throughput"); ok { input.StorageThroughput = aws.Int64(int64(v.(int))) } @@ -1708,7 +1694,6 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta inte for _, v := range v.DBSecurityGroups { securityGroupNames = append(securityGroupNames, aws.StringValue(v.DBSecurityGroupName)) } - d.Set("security_group_names", securityGroupNames) d.Set("status", v.DBInstanceStatus) d.Set("storage_encrypted", v.StorageEncrypted) d.Set("storage_throughput", v.StorageThroughput) @@ -2141,13 +2126,6 @@ func dbInstancePopulateModify(input *rds_sdkv2.ModifyDBInstanceInput, d *schema. input.ReplicaMode = types.ReplicaMode(d.Get("replica_mode").(string)) } - if d.HasChange("security_group_names") { - if v := d.Get("security_group_names").(*schema.Set); v.Len() > 0 { - needsModify = true - input.DBSecurityGroups = flex.ExpandStringValueSet(v) - } - } - if d.HasChange("storage_throughput") { needsModify = true input.StorageThroughput = aws.Int32(int32(d.Get("storage_throughput").(int))) diff --git a/website/docs/r/db_instance.html.markdown b/website/docs/r/db_instance.html.markdown index 999ed9a2b285..37789ad70724 100644 --- a/website/docs/r/db_instance.html.markdown +++ b/website/docs/r/db_instance.html.markdown @@ -236,9 +236,6 @@ PostgreSQL and MySQL Read Replicas](https://docs.aws.amazon.com/AmazonRDS/latest for more information on using Replication. * `restore_to_point_in_time` - (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary point in time. Requires the `identifier` argument to be set with the name of the new DB instance to be created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. * `s3_import` - (Optional) Restore from a Percona Xtrabackup in S3. See [Importing Data into an Amazon RDS MySQL DB Instance](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html) -* `security_group_names` - (Optional/Deprecated) List of DB Security Groups to -associate. Only used for [DB Instances on the _EC2-Classic_ -Platform](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html#USER_VPC.FindDefaultVPC). * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB From 04394188703d21811d2cd63cf09671696b4f49fc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 12:00:35 -0400 Subject: [PATCH 077/304] d/aws_db_instance: Remove 'db_security_groups'. --- .changelog/#####.txt | 4 ++++ internal/service/rds/instance_data_source.go | 6 ------ website/docs/d/db_instance.html.markdown | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index ae195ede2a6e..b26f9daabd75 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -12,4 +12,8 @@ provider: With the retirement of EC2-Classic the`aws_redshift_security_group` re ```release-note:breaking-change resource/aws_db_instance: With the retirement of EC2-Classic the`security_group_names` attribute has been removed +``` + +```release-note:breaking-change +data-source/aws_db_instance: With the retirement of EC2-Classic the`db_security_groups` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/rds/instance_data_source.go b/internal/service/rds/instance_data_source.go index e54ac9e9952c..e601bb5de59b 100644 --- a/internal/service/rds/instance_data_source.go +++ b/internal/service/rds/instance_data_source.go @@ -74,11 +74,6 @@ func DataSourceInstance() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "db_security_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, "db_subnet_group": { Type: schema.TypeString, Computed: true, @@ -241,7 +236,6 @@ func dataSourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta in for _, v := range v.DBSecurityGroups { securityGroupNames = append(securityGroupNames, aws.StringValue(v.DBSecurityGroupName)) } - d.Set("db_security_groups", securityGroupNames) if v.DBSubnetGroup != nil { d.Set("db_subnet_group", v.DBSubnetGroup.DBSubnetGroupName) } else { diff --git a/website/docs/d/db_instance.html.markdown b/website/docs/d/db_instance.html.markdown index fea67df5541d..c86f1326cabd 100644 --- a/website/docs/d/db_instance.html.markdown +++ b/website/docs/d/db_instance.html.markdown @@ -38,7 +38,6 @@ In addition to all arguments above, the following attributes are exported: * `db_instance_class` - Contains the name of the compute and memory capacity class of the DB instance. * `db_name` - Contains the name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance. * `db_parameter_groups` - Provides the list of DB parameter groups applied to this DB instance. -* `db_security_groups` - Provides List of DB security groups associated to this DB instance. * `db_subnet_group` - Name of the subnet group associated with the DB instance. * `db_instance_port` - Port that the DB instance listens on. * `enabled_cloudwatch_logs_exports` - List of log types to export to cloudwatch. From a2d67ef2bd1821b6b18655d2e37b4d03d73cbd39 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 12:21:55 -0400 Subject: [PATCH 078/304] r/aws_elasticache_cluster: Remove 'security_group_names'. --- .changelog/#####.txt | 4 ++++ internal/service/elasticache/cluster.go | 16 ---------------- website/docs/r/elasticache_cluster.html.markdown | 1 - 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index b26f9daabd75..80d14ae0619b 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -16,4 +16,8 @@ resource/aws_db_instance: With the retirement of EC2-Classic the`security_group_ ```release-note:breaking-change data-source/aws_db_instance: With the retirement of EC2-Classic the`db_security_groups` attribute has been removed +``` + +```release-note:breaking-change +resource/aws_elasticache_cluster: With the retirement of EC2-Classic the`security_group_names` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/elasticache/cluster.go b/internal/service/elasticache/cluster.go index 8f0ea3be310e..3e7655fc198a 100644 --- a/internal/service/elasticache/cluster.go +++ b/internal/service/elasticache/cluster.go @@ -273,7 +273,6 @@ func ResourceCluster() *schema.Resource { "parameter_group_name", "port", "security_group_ids", - "security_group_names", "snapshot_arns", "snapshot_name", "snapshot_retention_limit", @@ -287,14 +286,6 @@ func ResourceCluster() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "security_group_names": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Deprecated: `With the retirement of EC2-Classic the security_group_names attribute has been deprecated and will be removed in a future version.`, - }, "snapshot_arns": { Type: schema.TypeList, MaxItems: 1, @@ -350,10 +341,6 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ElastiCacheConn() - if v, ok := d.GetOk("security_group_names"); ok && v.(*schema.Set).Len() > 0 { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new ElastiCache Clusters can be created referencing ElastiCache Security Groups`) - } - input := &elasticache.CreateCacheClusterInput{ Tags: GetTagsIn(ctx), } @@ -571,9 +558,6 @@ func setFromCacheCluster(d *schema.ResourceData, c *elasticache.CacheCluster) er d.Set("auto_minor_version_upgrade", strconv.FormatBool(aws.BoolValue(c.AutoMinorVersionUpgrade))) d.Set("subnet_group_name", c.CacheSubnetGroupName) - if err := d.Set("security_group_names", flattenSecurityGroupNames(c.CacheSecurityGroups)); err != nil { - return fmt.Errorf("setting security_group_names: %w", err) - } if err := d.Set("security_group_ids", flattenSecurityGroupIDs(c.SecurityGroups)); err != nil { return fmt.Errorf("setting security_group_ids: %w", err) } diff --git a/website/docs/r/elasticache_cluster.html.markdown b/website/docs/r/elasticache_cluster.html.markdown index 2b711f45bb10..b683d44c4385 100644 --- a/website/docs/r/elasticache_cluster.html.markdown +++ b/website/docs/r/elasticache_cluster.html.markdown @@ -174,7 +174,6 @@ The minimum maintenance window is a 60 minute period. Example: `sun:05:00-sun:09 * `preferred_outpost_arn` - (Optional, Required if `outpost_mode` is specified) The outpost ARN in which the cache cluster will be created. * `replication_group_id` - (Optional, Required if `engine` is not specified) ID of the replication group to which this cluster should belong. If this parameter is specified, the cluster is added to the specified replication group as a read replica; otherwise, the cluster is a standalone primary that is not part of any replication group. * `security_group_ids` – (Optional, VPC only) One or more VPC security groups associated with the cache cluster -* `security_group_names` – (Optional, EC2 Classic only) List of security group names to associate with this cache cluster. Changing this value will re-create the resource. * `snapshot_arns` – (Optional, Redis only) Single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. The object name cannot contain any commas. Changing `snapshot_arns` forces a new resource. * `snapshot_name` - (Optional, Redis only) Name of a snapshot from which to restore data into the new node group. Changing `snapshot_name` forces a new resource. * `snapshot_retention_limit` - (Optional, Redis only) Number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. Please note that setting a `snapshot_retention_limit` is not supported on cache.t1.micro cache nodes From 6a2def143ec689c1eed31e94789cffcd44b67e10 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 12:29:20 -0400 Subject: [PATCH 079/304] Correct CHANGELOG file name. --- .changelog/{#####.txt => 30966.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 30966.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/30966.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/30966.txt From ede2b395750d835482625277abb80cab992f7e64 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 12:38:53 -0400 Subject: [PATCH 080/304] Remove mention of 'EC2 Classic' and dead link. --- website/docs/r/elasticache_subnet_group.html.markdown | 4 ---- 1 file changed, 4 deletions(-) diff --git a/website/docs/r/elasticache_subnet_group.html.markdown b/website/docs/r/elasticache_subnet_group.html.markdown index dc2443059574..a9ff48588ed1 100644 --- a/website/docs/r/elasticache_subnet_group.html.markdown +++ b/website/docs/r/elasticache_subnet_group.html.markdown @@ -10,10 +10,6 @@ description: |- Provides an ElastiCache Subnet Group resource. -~> **NOTE:** ElastiCache Subnet Groups are only for use when working with an -ElastiCache cluster **inside** of a VPC. If you are on EC2 Classic, see the -[ElastiCache Security Group resource](elasticache_security_group.html). - ## Example Usage ```terraform From dde358356a9ad48b86b5938268b797d09d9cf404 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 12:43:19 -0400 Subject: [PATCH 081/304] d/aws_elasticache_cluster: Remove 'security_group_names'. --- .changelog/30966.txt | 16 ++++++++++------ .../service/elasticache/cluster_data_source.go | 6 ------ .../elasticache/cluster_data_source_test.go | 2 +- internal/service/elasticache/flex.go | 10 ---------- website/docs/d/elasticache_cluster.html.markdown | 1 - 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 80d14ae0619b..01512ee24200 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -1,23 +1,27 @@ ```release-note:breaking-change -provider: With the retirement of EC2-Classic the`aws_db_security_group` resource has been removed +provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed ``` ```release-note:breaking-change -provider: With the retirement of EC2-Classic the`aws_elasticache_security_group` resource has been removed +provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed ``` ```release-note:breaking-change -provider: With the retirement of EC2-Classic the`aws_redshift_security_group` resource has been removed +provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed ``` ```release-note:breaking-change -resource/aws_db_instance: With the retirement of EC2-Classic the`security_group_names` attribute has been removed +resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ``` ```release-note:breaking-change -data-source/aws_db_instance: With the retirement of EC2-Classic the`db_security_groups` attribute has been removed +data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed ``` ```release-note:breaking-change -resource/aws_elasticache_cluster: With the retirement of EC2-Classic the`security_group_names` attribute has been removed +resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed +``` + +```release-note:breaking-change +data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/elasticache/cluster_data_source.go b/internal/service/elasticache/cluster_data_source.go index 128aab3fe526..56bdc756b87a 100644 --- a/internal/service/elasticache/cluster_data_source.go +++ b/internal/service/elasticache/cluster_data_source.go @@ -151,11 +151,6 @@ func DataSourceCluster() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "security_group_names": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, "snapshot_retention_limit": { Type: schema.TypeInt, Computed: true, @@ -198,7 +193,6 @@ func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta int d.Set("ip_discovery", cluster.IpDiscovery) d.Set("network_type", cluster.NetworkType) d.Set("preferred_outpost_arn", cluster.PreferredOutpostArn) - d.Set("security_group_names", flattenSecurityGroupNames(cluster.CacheSecurityGroups)) d.Set("security_group_ids", flattenSecurityGroupIDs(cluster.SecurityGroups)) if cluster.CacheParameterGroup != nil { diff --git a/internal/service/elasticache/cluster_data_source_test.go b/internal/service/elasticache/cluster_data_source_test.go index 9fb26eeecafa..66933858e754 100644 --- a/internal/service/elasticache/cluster_data_source_test.go +++ b/internal/service/elasticache/cluster_data_source_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) -func TestAccElastiCacheClusterDataSource_Data_basic(t *testing.T) { +func TestAccElastiCacheClusterDataSource_basic(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") diff --git a/internal/service/elasticache/flex.go b/internal/service/elasticache/flex.go index 582ca3f6991e..87fa713d7f5c 100644 --- a/internal/service/elasticache/flex.go +++ b/internal/service/elasticache/flex.go @@ -15,16 +15,6 @@ func flattenSecurityGroupIDs(securityGroups []*elasticache.SecurityGroupMembersh return result } -func flattenSecurityGroupNames(securityGroups []*elasticache.CacheSecurityGroupMembership) []string { - result := make([]string, 0, len(securityGroups)) - for _, sg := range securityGroups { - if sg.CacheSecurityGroupName != nil { - result = append(result, *sg.CacheSecurityGroupName) - } - } - return result -} - func flattenLogDeliveryConfigurations(logDeliveryConfiguration []*elasticache.LogDeliveryConfiguration) []map[string]interface{} { if len(logDeliveryConfiguration) == 0 { return nil diff --git a/website/docs/d/elasticache_cluster.html.markdown b/website/docs/d/elasticache_cluster.html.markdown index 9718dcfc6a38..b10e4f347b54 100644 --- a/website/docs/d/elasticache_cluster.html.markdown +++ b/website/docs/d/elasticache_cluster.html.markdown @@ -35,7 +35,6 @@ In addition to all arguments above, the following attributes are exported: * `ip_discovery` - The IP version advertised in the discovery protocol. * `network_type` - The IP versions for cache cluster connections. * `subnet_group_name` – Name of the subnet group associated to the cache cluster. -* `security_group_names` – List of security group names associated with this cache cluster. * `security_group_ids` – List VPC security groups associated with the cache cluster. * `parameter_group_name` – Name of the parameter group associated with this cache cluster. * `replication_group_id` - The replication group to which this cache cluster belongs. From dea5e9134fd7bae095250891c4ad11a54c4dc7df Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 13:38:59 -0400 Subject: [PATCH 082/304] r/aws_redshift_cluster: Remove 'cluster_security_groups'. --- .changelog/30966.txt | 4 ++++ internal/service/redshift/cluster.go | 22 ------------------- website/docs/r/redshift_cluster.html.markdown | 2 -- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 01512ee24200..eb9957d7325b 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -24,4 +24,8 @@ resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `securi ```release-note:breaking-change data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed +``` + +```release-note:breaking-change +resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/redshift/cluster.go b/internal/service/redshift/cluster.go index c158355e0de4..da9e65126b8a 100644 --- a/internal/service/redshift/cluster.go +++ b/internal/service/redshift/cluster.go @@ -126,13 +126,6 @@ func ResourceCluster() *schema.Resource { Optional: true, Computed: true, }, - "cluster_security_groups": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Deprecated: `With the retirement of EC2-Classic the cluster_security_groups attribute has been deprecated and will be removed in a future version.`, - }, "cluster_subnet_group_name": { Type: schema.TypeString, Optional: true, @@ -393,10 +386,6 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RedshiftConn() - if v, ok := d.GetOk("cluster_security_groups"); ok && v.(*schema.Set).Len() > 0 { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Redshift Clusters can be created referencing Redshift Security Groups`) - } - clusterID := d.Get("cluster_identifier").(string) backupInput := &redshift.RestoreFromClusterSnapshotInput{ AllowVersionUpgrade: aws.Bool(d.Get("allow_version_upgrade").(bool)), @@ -664,13 +653,6 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter var apiList []*string - for _, clusterSecurityGroup := range rsc.ClusterSecurityGroups { - apiList = append(apiList, clusterSecurityGroup.ClusterSecurityGroupName) - } - d.Set("cluster_security_groups", aws.StringValueSlice(apiList)) - - apiList = nil - for _, iamRole := range rsc.IamRoles { apiList = append(apiList, iamRole.IamRoleArn) } @@ -713,10 +695,6 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int input.ClusterParameterGroupName = aws.String(d.Get("cluster_parameter_group_name").(string)) } - if d.HasChange("cluster_security_groups") { - input.ClusterSecurityGroups = flex.ExpandStringSet(d.Get("cluster_security_groups").(*schema.Set)) - } - if d.HasChange("maintenance_track_name") { input.MaintenanceTrackName = aws.String(d.Get("maintenance_track_name").(string)) } diff --git a/website/docs/r/redshift_cluster.html.markdown b/website/docs/r/redshift_cluster.html.markdown index 6dcf81d6095e..d0340cd9fb0b 100644 --- a/website/docs/r/redshift_cluster.html.markdown +++ b/website/docs/r/redshift_cluster.html.markdown @@ -45,7 +45,6 @@ The following arguments are supported: Note that this may show up in logs, and it will be stored in the state file. Password must contain at least 8 chars and contain at least one uppercase letter, one lowercase letter, and one number. * `master_username` - (Required unless a `snapshot_identifier` is provided) Username for the master DB user. -* `cluster_security_groups` - (Optional) A list of security groups to be associated with this cluster. * `vpc_security_group_ids` - (Optional) A list of Virtual Private Cloud (VPC) security groups to be associated with the cluster. * `cluster_subnet_group_name` - (Optional) The name of a cluster subnet group to be associated with this cluster. If this parameter is not provided the resulting cluster will be deployed outside virtual private cloud (VPC). * `availability_zone` - (Optional) The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision the cluster. For example, if you have several EC2 instances running in a specific Availability Zone, then you might want the cluster to be provisioned in the same zone in order to decrease network latency. Can only be changed if `availability_zone_relocation_enabled` is `true`. @@ -113,7 +112,6 @@ In addition to all arguments above, the following attributes are exported: * `preferred_maintenance_window` - The backup window * `endpoint` - The connection endpoint * `encrypted` - Whether the data in the cluster is encrypted -* `cluster_security_groups` - The security groups associated with the cluster * `vpc_security_group_ids` - The VPC security group Ids associated with the cluster * `dns_name` - The DNS name of the cluster * `port` - The Port the cluster responds on From abae10869008f1c5c4e71a71591ba13b2f8b639d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 13:41:02 -0400 Subject: [PATCH 083/304] d/aws_redshift_cluster: Remove 'cluster_security_groups'. --- .changelog/30966.txt | 4 ++++ internal/service/redshift/cluster_data_source.go | 12 ------------ website/docs/d/redshift_cluster.html.markdown | 1 - 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index eb9957d7325b..c0bae8c3cfd5 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -28,4 +28,8 @@ data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `sec ```release-note:breaking-change resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed +``` + +```release-note:breaking-change +data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/redshift/cluster_data_source.go b/internal/service/redshift/cluster_data_source.go index ac35f4868df3..6049eb5f857e 100644 --- a/internal/service/redshift/cluster_data_source.go +++ b/internal/service/redshift/cluster_data_source.go @@ -85,11 +85,6 @@ func DataSourceCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "cluster_security_groups": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, "cluster_subnet_group_name": { Type: schema.TypeString, Computed: true, @@ -241,13 +236,6 @@ func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta int d.Set("cluster_public_key", rsc.ClusterPublicKey) d.Set("cluster_revision_number", rsc.ClusterRevisionNumber) - - var csg []string - for _, g := range rsc.ClusterSecurityGroups { - csg = append(csg, aws.StringValue(g.ClusterSecurityGroupName)) - } - d.Set("cluster_security_groups", csg) - d.Set("cluster_subnet_group_name", rsc.ClusterSubnetGroupName) if len(rsc.ClusterNodes) > 1 { diff --git a/website/docs/d/redshift_cluster.html.markdown b/website/docs/d/redshift_cluster.html.markdown index 74f85cebc8ec..f1a0cf4ded38 100644 --- a/website/docs/d/redshift_cluster.html.markdown +++ b/website/docs/d/redshift_cluster.html.markdown @@ -63,7 +63,6 @@ In addition to all arguments above, the following attributes are exported: * `cluster_parameter_group_name` - The name of the parameter group to be associated with this cluster * `cluster_public_key` - Public key for the cluster * `cluster_revision_number` - The cluster revision number -* `cluster_security_groups` - The security groups associated with the cluster * `cluster_subnet_group_name` - The name of a cluster subnet group to be associated with this cluster * `cluster_type` - Cluster type * `database_name` - Name of the default database in the cluster From 9c6469aa13773cc28acc8f495da52d5ae0a5a273 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 14:04:40 -0400 Subject: [PATCH 084/304] r/aws_launch_configuration: Remove 'vpc_classic_link_id' and 'vpc_classic_link_security_groups'. --- .changelog/30966.txt | 4 ++++ .../autoscaling/launch_configuration.go | 23 ------------------- .../autoscaling/launch_configuration_test.go | 2 -- .../docs/r/launch_configuration.html.markdown | 2 -- 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index c0bae8c3cfd5..085df5623971 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -32,4 +32,8 @@ resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_s ```release-note:breaking-change data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed +``` + +```release-note:breaking-change +resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes hav been removed ``` \ No newline at end of file diff --git a/internal/service/autoscaling/launch_configuration.go b/internal/service/autoscaling/launch_configuration.go index d53dab6ec3d4..567ffca83ece 100644 --- a/internal/service/autoscaling/launch_configuration.go +++ b/internal/service/autoscaling/launch_configuration.go @@ -309,19 +309,6 @@ func ResourceLaunchConfiguration() *schema.Resource { return }, }, - "vpc_classic_link_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Deprecated: `With the retirement of EC2-Classic the vpc_classic_link_id attribute has been deprecated and will be removed in a future version.`, - }, - "vpc_classic_link_security_groups": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Deprecated: `With the retirement of EC2-Classic the vpc_classic_link_security_groups attribute has been deprecated and will be removed in a future version.`, - }, }, } } @@ -331,14 +318,6 @@ func resourceLaunchConfigurationCreate(ctx context.Context, d *schema.ResourceDa autoscalingconn := meta.(*conns.AWSClient).AutoScalingConn() ec2conn := meta.(*conns.AWSClient).EC2Conn() - if _, ok := d.GetOk("vpc_classic_link_id"); ok { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Auto Scaling Launch Configurations can be created referencing ClassicLink`) - } - - if v, ok := d.GetOk("vpc_classic_link_security_groups"); ok && v.(*schema.Set).Len() > 0 { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Auto Scaling Launch Configurations can be created referencing ClassicLink`) - } - lcName := create.Name(d.Get("name").(string), d.Get("name_prefix").(string)) input := autoscaling.CreateLaunchConfigurationInput{ EbsOptimized: aws.Bool(d.Get("ebs_optimized").(bool)), @@ -497,8 +476,6 @@ func resourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceData d.Set("user_data", userDataHashSum(v)) } } - d.Set("vpc_classic_link_id", lc.ClassicLinkVPCId) - d.Set("vpc_classic_link_security_groups", aws.StringValueSlice(lc.ClassicLinkVPCSecurityGroups)) rootDeviceName, err := findImageRootDeviceName(ctx, ec2conn, d.Get("image_id").(string)) diff --git a/internal/service/autoscaling/launch_configuration_test.go b/internal/service/autoscaling/launch_configuration_test.go index 6f7c50d87ea1..72b3083907bf 100644 --- a/internal/service/autoscaling/launch_configuration_test.go +++ b/internal/service/autoscaling/launch_configuration_test.go @@ -54,8 +54,6 @@ func TestAccAutoScalingLaunchConfiguration_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spot_price", ""), resource.TestCheckNoResourceAttr(resourceName, "user_data"), resource.TestCheckNoResourceAttr(resourceName, "user_data_base64"), - resource.TestCheckResourceAttr(resourceName, "vpc_classic_link_id", ""), - resource.TestCheckResourceAttr(resourceName, "vpc_classic_link_security_groups.#", "0"), ), }, { diff --git a/website/docs/r/launch_configuration.html.markdown b/website/docs/r/launch_configuration.html.markdown index b460764f4c9a..6a5f96c9ba38 100644 --- a/website/docs/r/launch_configuration.html.markdown +++ b/website/docs/r/launch_configuration.html.markdown @@ -163,8 +163,6 @@ The following arguments are optional: * `spot_price` - (Optional; Default: On-demand price) The maximum price to use for reserving spot instances. * `user_data` - (Optional) The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. * `user_data_base64` - (Optional) Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. -* `vpc_classic_link_id` - (Optional) The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`) -* `vpc_classic_link_security_groups` - (Optional) The IDs of one or more security groups for the specified ClassicLink-enabled VPC (eg. `sg-46ae3d11`). ## Block devices From 2f3c827125a6003f638e4972ce45a267a08acf42 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 14:06:40 -0400 Subject: [PATCH 085/304] d/aws_launch_configuration: Remove 'vpc_classic_link_id' and 'vpc_classic_link_security_groups'. --- .changelog/30966.txt | 4 ++++ .../autoscaling/launch_configuration_data_source.go | 11 ----------- .../launch_configuration_data_source_test.go | 2 -- website/docs/d/launch_configuration.html.markdown | 2 -- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 085df5623971..b3bac1782d83 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -36,4 +36,8 @@ data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluste ```release-note:breaking-change resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes hav been removed +``` + +```release-note:breaking-change +data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes hav been removed ``` \ No newline at end of file diff --git a/internal/service/autoscaling/launch_configuration_data_source.go b/internal/service/autoscaling/launch_configuration_data_source.go index 70cc492e6c9a..054f66eb68eb 100644 --- a/internal/service/autoscaling/launch_configuration_data_source.go +++ b/internal/service/autoscaling/launch_configuration_data_source.go @@ -181,15 +181,6 @@ func DataSourceLaunchConfiguration() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "vpc_classic_link_id": { - Type: schema.TypeString, - Computed: true, - }, - "vpc_classic_link_security_groups": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, }, } } @@ -232,8 +223,6 @@ func dataSourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceDa d.Set("security_groups", aws.StringValueSlice(lc.SecurityGroups)) d.Set("spot_price", lc.SpotPrice) d.Set("user_data", lc.UserData) - d.Set("vpc_classic_link_id", lc.ClassicLinkVPCId) - d.Set("vpc_classic_link_security_groups", aws.StringValueSlice(lc.ClassicLinkVPCSecurityGroups)) rootDeviceName, err := findImageRootDeviceName(ctx, ec2conn, d.Get("image_id").(string)) diff --git a/internal/service/autoscaling/launch_configuration_data_source_test.go b/internal/service/autoscaling/launch_configuration_data_source_test.go index 7db166a5030e..205fb4f49790 100644 --- a/internal/service/autoscaling/launch_configuration_data_source_test.go +++ b/internal/service/autoscaling/launch_configuration_data_source_test.go @@ -41,8 +41,6 @@ func TestAccAutoScalingLaunchConfigurationDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(datasourceName, "spot_price", resourceName, "spot_price"), // Resource and data source user_data have differing representations in state. resource.TestCheckResourceAttrSet(datasourceName, "user_data"), - resource.TestCheckResourceAttrPair(datasourceName, "vpc_classic_link_id", resourceName, "vpc_classic_link_id"), - resource.TestCheckResourceAttrPair(datasourceName, "vpc_classic_link_security_groups.#", resourceName, "vpc_classic_link_security_groups.#"), ), }, }, diff --git a/website/docs/d/launch_configuration.html.markdown b/website/docs/d/launch_configuration.html.markdown index d5ebc69c2af8..1570179bc7d9 100644 --- a/website/docs/d/launch_configuration.html.markdown +++ b/website/docs/d/launch_configuration.html.markdown @@ -41,8 +41,6 @@ In addition to all arguments above, the following attributes are exported: * `http_put_response_hop_limit` - The desired HTTP PUT response hop limit for instance metadata requests. * `security_groups` - List of associated Security Group IDS. * `associate_public_ip_address` - Whether a Public IP address is associated with the instance. -* `vpc_classic_link_id` - ID of a ClassicLink-enabled VPC. -* `vpc_classic_link_security_groups` - The IDs of one or more Security Groups for the specified ClassicLink-enabled VPC. * `user_data` - User Data of the instance. * `enable_monitoring` - Whether Detailed Monitoring is Enabled. * `ebs_optimized` - Whether the launched EC2 instance will be EBS-optimized. From 06b157caacfe3cf18035f2c4710007d6a336aa23 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 14:52:57 -0400 Subject: [PATCH 086/304] r/aws_vpc_peering_connection: Remove 'allow_classic_link_to_remote_vpc' and 'allow_vpc_to_remote_classic_link'. --- .changelog/30966.txt | 8 ++- .../service/ec2/vpc_peering_connection.go | 61 +------------------ .../ec2/vpc_peering_connection_test.go | 50 --------------- .../r/vpc_peering_connection.html.markdown | 6 -- 4 files changed, 9 insertions(+), 116 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index b3bac1782d83..7b853d0209d4 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -35,9 +35,13 @@ data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluste ``` ```release-note:breaking-change -resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes hav been removed +resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ``` ```release-note:breaking-change -data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes hav been removed +data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed +``` + +```release-note:breaking-change +resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_peering_connection.go b/internal/service/ec2/vpc_peering_connection.go index 71b0ae854f18..9db71be65ee3 100644 --- a/internal/service/ec2/vpc_peering_connection.go +++ b/internal/service/ec2/vpc_peering_connection.go @@ -89,23 +89,11 @@ var vpcPeeringConnectionOptionsSchema = &schema.Schema{ MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "allow_classic_link_to_remote_vpc": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Deprecated: `With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.`, - }, "allow_remote_vpc_dns_resolution": { Type: schema.TypeBool, Optional: true, Default: false, }, - "allow_vpc_to_remote_classic_link": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Deprecated: `With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.`, - }, }, }, } @@ -114,10 +102,6 @@ func resourceVPCPeeringConnectionCreate(ctx context.Context, d *schema.ResourceD var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - if peeringConnectionOptionsAllowsClassicLink(d) { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new VPC Peering Connections can be created with ClassicLink options enabled`) - } - input := &ec2.CreateVpcPeeringConnectionInput{ PeerVpcId: aws.String(d.Get("peer_vpc_id").(string)), TagSpecifications: getTagSpecificationsIn(ctx, ec2.ResourceTypeVpcPeeringConnection), @@ -296,17 +280,16 @@ func acceptVPCPeeringConnection(ctx context.Context, conn *ec2.EC2, vpcPeeringCo func modifyVPCPeeringConnectionOptions(ctx context.Context, conn *ec2.EC2, d *schema.ResourceData, vpcPeeringConnection *ec2.VpcPeeringConnection, checkActive bool) error { var accepterPeeringConnectionOptions, requesterPeeringConnectionOptions *ec2.PeeringConnectionOptionsRequest - crossRegionPeering := aws.StringValue(vpcPeeringConnection.RequesterVpcInfo.Region) != aws.StringValue(vpcPeeringConnection.AccepterVpcInfo.Region) if key := "accepter"; d.HasChange(key) { if v, ok := d.GetOk(key); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - accepterPeeringConnectionOptions = expandPeeringConnectionOptionsRequest(v.([]interface{})[0].(map[string]interface{}), crossRegionPeering) + accepterPeeringConnectionOptions = expandPeeringConnectionOptionsRequest(v.([]interface{})[0].(map[string]interface{})) } } if key := "requester"; d.HasChange(key) { if v, ok := d.GetOk(key); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - requesterPeeringConnectionOptions = expandPeeringConnectionOptionsRequest(v.([]interface{})[0].(map[string]interface{}), crossRegionPeering) + requesterPeeringConnectionOptions = expandPeeringConnectionOptionsRequest(v.([]interface{})[0].(map[string]interface{})) } } @@ -373,7 +356,7 @@ func vpcPeeringConnectionOptionsEqual(o1 *ec2.VpcPeeringConnectionOptionsDescrip aws.BoolValue(o1.AllowEgressFromLocalVpcToRemoteClassicLink) == aws.BoolValue(o2.AllowEgressFromLocalVpcToRemoteClassicLink) } -func expandPeeringConnectionOptionsRequest(tfMap map[string]interface{}, crossRegionPeering bool) *ec2.PeeringConnectionOptionsRequest { +func expandPeeringConnectionOptionsRequest(tfMap map[string]interface{}) *ec2.PeeringConnectionOptionsRequest { if tfMap == nil { return nil } @@ -384,16 +367,6 @@ func expandPeeringConnectionOptionsRequest(tfMap map[string]interface{}, crossRe apiObject.AllowDnsResolutionFromRemoteVpc = aws.Bool(v) } - if !crossRegionPeering { - if v, ok := tfMap["allow_classic_link_to_remote_vpc"].(bool); ok { - apiObject.AllowEgressFromLocalClassicLinkToRemoteVpc = aws.Bool(v) - } - - if v, ok := tfMap["allow_vpc_to_remote_classic_link"].(bool); ok { - apiObject.AllowEgressFromLocalVpcToRemoteClassicLink = aws.Bool(v) - } - } - return apiObject } @@ -408,33 +381,5 @@ func flattenVPCPeeringConnectionOptionsDescription(apiObject *ec2.VpcPeeringConn tfMap["allow_remote_vpc_dns_resolution"] = aws.BoolValue(v) } - if v := apiObject.AllowEgressFromLocalClassicLinkToRemoteVpc; v != nil { - tfMap["allow_classic_link_to_remote_vpc"] = aws.BoolValue(v) - } - - if v := apiObject.AllowEgressFromLocalVpcToRemoteClassicLink; v != nil { - tfMap["allow_vpc_to_remote_classic_link"] = aws.BoolValue(v) - } - return tfMap } - -func peeringConnectionOptionsAllowsClassicLink(d *schema.ResourceData) bool { - fn := func(key string) bool { - if v, ok := d.GetOk(key); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - tfMap := v.([]interface{})[0].(map[string]interface{}) - - if v, ok := tfMap["allow_classic_link_to_remote_vpc"].(bool); ok && v { - return true - } - - if v, ok := tfMap["allow_vpc_to_remote_classic_link"].(bool); ok && v { - return true - } - } - - return false - } - - return fn("accepter") || fn("requester") -} diff --git a/internal/service/ec2/vpc_peering_connection_test.go b/internal/service/ec2/vpc_peering_connection_test.go index c7d411530881..369583cf640c 100644 --- a/internal/service/ec2/vpc_peering_connection_test.go +++ b/internal/service/ec2/vpc_peering_connection_test.go @@ -166,16 +166,6 @@ func TestAccVPCPeeringConnection_options(t *testing.T) { "requester.0.allow_remote_vpc_dns_resolution", "false", ), - resource.TestCheckResourceAttr( - resourceName, - "requester.0.allow_classic_link_to_remote_vpc", - "false", - ), - resource.TestCheckResourceAttr( - resourceName, - "requester.0.allow_vpc_to_remote_classic_link", - "false", - ), // Accepter's view: resource.TestCheckResourceAttr( resourceName, @@ -187,16 +177,6 @@ func TestAccVPCPeeringConnection_options(t *testing.T) { "accepter.0.allow_remote_vpc_dns_resolution", "true", ), - resource.TestCheckResourceAttr( - resourceName, - "accepter.0.allow_classic_link_to_remote_vpc", - "false", - ), - resource.TestCheckResourceAttr( - resourceName, - "accepter.0.allow_vpc_to_remote_classic_link", - "false", - ), testAccepterChange, ), ExpectNonEmptyPlan: true, @@ -226,16 +206,6 @@ func TestAccVPCPeeringConnection_options(t *testing.T) { "requester.0.allow_remote_vpc_dns_resolution", "false", ), - resource.TestCheckResourceAttr( - resourceName, - "requester.0.allow_classic_link_to_remote_vpc", - "false", - ), - resource.TestCheckResourceAttr( - resourceName, - "requester.0.allow_vpc_to_remote_classic_link", - "false", - ), // Accepter's view: resource.TestCheckResourceAttr( resourceName, @@ -247,16 +217,6 @@ func TestAccVPCPeeringConnection_options(t *testing.T) { "accepter.0.allow_remote_vpc_dns_resolution", "true", ), - resource.TestCheckResourceAttr( - resourceName, - "accepter.0.allow_classic_link_to_remote_vpc", - "false", - ), - resource.TestCheckResourceAttr( - resourceName, - "accepter.0.allow_vpc_to_remote_classic_link", - "false", - ), ), }, }, @@ -590,11 +550,6 @@ resource "aws_vpc_peering_connection" "test" { accepter { allow_remote_vpc_dns_resolution = true } - - requester { - allow_vpc_to_remote_classic_link = false - allow_classic_link_to_remote_vpc = false - } } `, rName) } @@ -722,11 +677,6 @@ resource "aws_vpc_peering_connection" "test" { accepter { allow_remote_vpc_dns_resolution = true } - - requester { - allow_vpc_to_remote_classic_link = false - allow_classic_link_to_remote_vpc = false - } } `, rName) } diff --git a/website/docs/r/vpc_peering_connection.html.markdown b/website/docs/r/vpc_peering_connection.html.markdown index 7fe0ddb2d1db..64a0983d9a85 100644 --- a/website/docs/r/vpc_peering_connection.html.markdown +++ b/website/docs/r/vpc_peering_connection.html.markdown @@ -125,12 +125,6 @@ must have support for the DNS hostnames enabled. This can be done using the [`en * `allow_remote_vpc_dns_resolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. -* `allow_classic_link_to_remote_vpc` - (Optional) Allow a local linked EC2-Classic instance to communicate -with instances in a peer VPC. This enables an outbound communication from the local ClassicLink connection -to the remote VPC. -* `allow_vpc_to_remote_classic_link` - (Optional) Allow a local VPC to communicate with a linked EC2-Classic -instance in a peer VPC. This enables an outbound communication from the local VPC to the remote ClassicLink -connection. ## Attributes Reference From 065c0c76029f6068bf03c85ac3886dfd2669efdf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 14:55:35 -0400 Subject: [PATCH 087/304] r/aws_vpc_peering_connection_accepter: Remove 'allow_classic_link_to_remote_vpc' and 'allow_vpc_to_remote_classic_link'. --- .changelog/30966.txt | 4 ++++ internal/service/ec2/vpc_peering_connection_accepter.go | 4 ---- website/docs/r/vpc_peering_connection_accepter.html.markdown | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 7b853d0209d4..6a7ae5b0f023 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -44,4 +44,8 @@ data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vp ```release-note:breaking-change resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed +``` + +```release-note:breaking-change +resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_peering_connection_accepter.go b/internal/service/ec2/vpc_peering_connection_accepter.go index 2e93e86d97c7..d3e9623fcaf8 100644 --- a/internal/service/ec2/vpc_peering_connection_accepter.go +++ b/internal/service/ec2/vpc_peering_connection_accepter.go @@ -88,10 +88,6 @@ func resourceVPCPeeringAccepterCreate(ctx context.Context, d *schema.ResourceDat var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - if peeringConnectionOptionsAllowsClassicLink(d) { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no VPC Peering Connections can be accepted with ClassicLink options enabled`) - } - vpcPeeringConnectionID := d.Get("vpc_peering_connection_id").(string) vpcPeeringConnection, err := FindVPCPeeringConnectionByID(ctx, conn, vpcPeeringConnectionID) diff --git a/website/docs/r/vpc_peering_connection_accepter.html.markdown b/website/docs/r/vpc_peering_connection_accepter.html.markdown index 396fa7582a8a..1b4f0671ee83 100644 --- a/website/docs/r/vpc_peering_connection_accepter.html.markdown +++ b/website/docs/r/vpc_peering_connection_accepter.html.markdown @@ -107,10 +107,6 @@ In addition to all arguments above, the following attributes are exported: * `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. -* `allow_classic_link_to_remote_vpc` - Indicates whether a local ClassicLink connection can communicate -with the peer VPC over the VPC Peering Connection. -* `allow_vpc_to_remote_classic_link` - Indicates whether a local VPC can communicate with a ClassicLink -connection in the peer VPC over the VPC Peering Connection. ## Import From 7973386d268a9ba02ab8cb5cdf3740f70dc59ba8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:03:18 -0400 Subject: [PATCH 088/304] r/aws_vpc_peering_connection_options: Remove 'allow_classic_link_to_remote_vpc' and 'allow_vpc_to_remote_classic_link'. --- .changelog/30966.txt | 4 ++ .../ec2/vpc_peering_connection_options.go | 4 -- .../vpc_peering_connection_options_test.go | 58 ++++--------------- ...c_peering_connection_options.html.markdown | 11 ---- 4 files changed, 15 insertions(+), 62 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 6a7ae5b0f023..4f2642227b6d 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -48,4 +48,8 @@ resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `all ```release-note:breaking-change resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed +``` + +```release-note:breaking-change +resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_peering_connection_options.go b/internal/service/ec2/vpc_peering_connection_options.go index 6582065d5ec5..8050b045ca3a 100644 --- a/internal/service/ec2/vpc_peering_connection_options.go +++ b/internal/service/ec2/vpc_peering_connection_options.go @@ -38,10 +38,6 @@ func resourceVPCPeeringConnectionOptionsCreate(ctx context.Context, d *schema.Re var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - if peeringConnectionOptionsAllowsClassicLink(d) { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new VPC Peering Connection Options can be created with ClassicLink options enabled`) - } - vpcPeeringConnectionID := d.Get("vpc_peering_connection_id").(string) vpcPeeringConnection, err := FindVPCPeeringConnectionByID(ctx, conn, vpcPeeringConnectionID) diff --git a/internal/service/ec2/vpc_peering_connection_options_test.go b/internal/service/ec2/vpc_peering_connection_options_test.go index 34c2f7e5bf58..c690767e9e2a 100644 --- a/internal/service/ec2/vpc_peering_connection_options_test.go +++ b/internal/service/ec2/vpc_peering_connection_options_test.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/google/go-cmp/cmp" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -35,27 +34,19 @@ func TestAccVPCPeeringConnectionOptions_basic(t *testing.T) { // Requester's view: resource.TestCheckResourceAttr(resourceName, "requester.#", "1"), resource.TestCheckResourceAttr(resourceName, "requester.0.allow_remote_vpc_dns_resolution", "false"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_vpc_to_remote_classic_link", "false"), testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "requester", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(false), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(false), }, ), // Accepter's view: resource.TestCheckResourceAttr(resourceName, "accepter.#", "1"), resource.TestCheckResourceAttr(resourceName, "accepter.0.allow_remote_vpc_dns_resolution", "true"), - resource.TestCheckResourceAttr(resourceName, "accepter.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceName, "accepter.0.allow_vpc_to_remote_classic_link", "false"), testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "accepter", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), }, ), ), @@ -77,9 +68,7 @@ func TestAccVPCPeeringConnectionOptions_basic(t *testing.T) { testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "requester", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(false), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(false), }, ), // Accepter's view: @@ -91,9 +80,7 @@ func TestAccVPCPeeringConnectionOptions_basic(t *testing.T) { testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "accepter", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(false), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(false), }, ), ), @@ -126,27 +113,19 @@ func TestAccVPCPeeringConnectionOptions_differentRegionSameAccount(t *testing.T) // Requester's view: resource.TestCheckResourceAttr(resourceName, "requester.#", "1"), resource.TestCheckResourceAttr(resourceName, "requester.0.allow_remote_vpc_dns_resolution", "true"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_vpc_to_remote_classic_link", "false"), testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "requester", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), }, ), // Accepter's view: resource.TestCheckResourceAttr(resourceNamePeer, "accepter.#", "1"), resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_remote_vpc_dns_resolution", "true"), - resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_vpc_to_remote_classic_link", "false"), testAccCheckVPCPeeringConnectionOptionsWithProvider(ctx, pcxResourceNamePeer, "accepter", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), }, acctest.RegionProviderFunc(acctest.AlternateRegion(), &providers), ), @@ -170,9 +149,7 @@ func TestAccVPCPeeringConnectionOptions_differentRegionSameAccount(t *testing.T) testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "requester", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(false), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(false), }, ), // Accepter's view: @@ -184,9 +161,7 @@ func TestAccVPCPeeringConnectionOptions_differentRegionSameAccount(t *testing.T) testAccCheckVPCPeeringConnectionOptionsWithProvider(ctx, pcxResourceNamePeer, "accepter", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(false), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(false), }, acctest.RegionProviderFunc(acctest.AlternateRegion(), &providers), ), @@ -218,21 +193,15 @@ func TestAccVPCPeeringConnectionOptions_sameRegionDifferentAccount(t *testing.T) // Requester's view: resource.TestCheckResourceAttr(resourceName, "requester.#", "1"), resource.TestCheckResourceAttr(resourceName, "requester.0.allow_remote_vpc_dns_resolution", "true"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceName, "requester.0.allow_vpc_to_remote_classic_link", "false"), testAccCheckVPCPeeringConnectionOptions(ctx, pcxResourceName, "requester", &ec2.VpcPeeringConnectionOptionsDescription{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(false), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(false), + AllowDnsResolutionFromRemoteVpc: aws.Bool(true), }, ), // Accepter's view: resource.TestCheckResourceAttr(resourceNamePeer, "accepter.#", "1"), resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_remote_vpc_dns_resolution", "true"), - resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_classic_link_to_remote_vpc", "false"), - resource.TestCheckResourceAttr(resourceNamePeer, "accepter.0.allow_vpc_to_remote_classic_link", "false"), ), }, { @@ -273,8 +242,8 @@ func testAccCheckVPCPeeringConnectionOptionsWithProvider(ctx context.Context, n, o = output.RequesterVpcInfo } - if diff := cmp.Diff(options, o.PeeringOptions); diff != "" { - return fmt.Errorf("VPC Peering Connection Options mismatch (-want +got):\n%s", diff) + if got, want := aws.BoolValue(o.PeeringOptions.AllowDnsResolutionFromRemoteVpc), aws.BoolValue(options.AllowDnsResolutionFromRemoteVpc); got != want { + return fmt.Errorf("VPC Peering Connection Options AllowDnsResolutionFromRemoteVpc =%v, want = %v", got, want) } return nil @@ -316,11 +285,6 @@ resource "aws_vpc_peering_connection_options" "test" { accepter { allow_remote_vpc_dns_resolution = %[2]t } - - requester { - allow_vpc_to_remote_classic_link = false - allow_classic_link_to_remote_vpc = false - } } `, rName, accepterDnsResolution) } diff --git a/website/docs/r/vpc_peering_connection_options.html.markdown b/website/docs/r/vpc_peering_connection_options.html.markdown index 0b3bdce583ef..6aea4f38c7e6 100644 --- a/website/docs/r/vpc_peering_connection_options.html.markdown +++ b/website/docs/r/vpc_peering_connection_options.html.markdown @@ -44,11 +44,6 @@ resource "aws_vpc_peering_connection_options" "foo" { accepter { allow_remote_vpc_dns_resolution = true } - - requester { - allow_vpc_to_remote_classic_link = true - allow_classic_link_to_remote_vpc = true - } } ``` @@ -159,12 +154,6 @@ must have support for the DNS hostnames enabled. This can be done using the [`en * `allow_remote_vpc_dns_resolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. -* `allow_classic_link_to_remote_vpc` - (Optional) Allow a local linked EC2-Classic instance to communicate -with instances in a peer VPC. This enables an outbound communication from the local ClassicLink connection -to the remote VPC. This option is not supported for inter-region VPC peering. -* `allow_vpc_to_remote_classic_link` - (Optional) Allow a local VPC to communicate with a linked EC2-Classic -instance in a peer VPC. This enables an outbound communication from the local VPC to the remote ClassicLink -connection. This option is not supported for inter-region VPC peering. ## Attributes Reference From 0f5d3d690dd14a4359e6e05da740844b58eb30ac Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:05:57 -0400 Subject: [PATCH 089/304] d/aws_vpc_peering_connection: Remove 'allow_classic_link_to_remote_vpc' and 'allow_vpc_to_remote_classic_link'. --- .changelog/30966.txt | 4 ++++ website/docs/d/vpc_peering_connection.html.markdown | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 4f2642227b6d..1a656e45e68e 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -52,4 +52,8 @@ resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic ```release-note:breaking-change resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed +``` + +```release-note:breaking-change +data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ``` \ No newline at end of file diff --git a/website/docs/d/vpc_peering_connection.html.markdown b/website/docs/d/vpc_peering_connection.html.markdown index aef77738e0eb..9e30a6e3fa63 100644 --- a/website/docs/d/vpc_peering_connection.html.markdown +++ b/website/docs/d/vpc_peering_connection.html.markdown @@ -91,12 +91,6 @@ All of the argument attributes except `filter` are also exported as result attri * `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC. -* `allow_classic_link_to_remote_vpc` - Indicates whether a local ClassicLink connection can communicate -with the peer VPC over the VPC peering connection. - -* `allow_vpc_to_remote_classic_link` - Indicates whether a local VPC can communicate with a ClassicLink -connection in the peer VPC over the VPC peering connection. - #### CIDR block set Attributes Reference * `cidr_block` - CIDR block associated to the VPC of the specific VPC Peering Connection. From 80e964b1a3858829f16e0b91f86336776a68946b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:18:23 -0400 Subject: [PATCH 090/304] r/aws_vpc_peering_connection: Check Options is not nil before calling 'vpcPeeringConnectionOptionsEqual'. --- .changelog/30966.txt | 4 ++++ internal/service/ec2/vpc_peering_connection.go | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 1a656e45e68e..a7dd00fd05ee 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -56,4 +56,8 @@ resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic ```release-note:breaking-change data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed +``` + +```release-note:bug +resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_peering_connection.go b/internal/service/ec2/vpc_peering_connection.go index 9db71be65ee3..1b3a2117b8a5 100644 --- a/internal/service/ec2/vpc_peering_connection.go +++ b/internal/service/ec2/vpc_peering_connection.go @@ -328,13 +328,13 @@ func modifyVPCPeeringConnectionOptions(ctx context.Context, conn *ec2.EC2, d *sc return retry.NonRetryableError(err) } - if v := vpcPeeringConnection.AccepterVpcInfo; v != nil && accepterPeeringConnectionOptions != nil { + if v := vpcPeeringConnection.AccepterVpcInfo; v != nil && v.PeeringOptions != nil && accepterPeeringConnectionOptions != nil { if !vpcPeeringConnectionOptionsEqual(v.PeeringOptions, accepterPeeringConnectionOptions) { return retry.RetryableError(errors.New("Accepter Options not stable")) } } - if v := vpcPeeringConnection.RequesterVpcInfo; v != nil && requesterPeeringConnectionOptions != nil { + if v := vpcPeeringConnection.RequesterVpcInfo; v != nil && v.PeeringOptions != nil && requesterPeeringConnectionOptions != nil { if !vpcPeeringConnectionOptionsEqual(v.PeeringOptions, requesterPeeringConnectionOptions) { return retry.RetryableError(errors.New("Requester Options not stable")) } @@ -351,9 +351,7 @@ func modifyVPCPeeringConnectionOptions(ctx context.Context, conn *ec2.EC2, d *sc } func vpcPeeringConnectionOptionsEqual(o1 *ec2.VpcPeeringConnectionOptionsDescription, o2 *ec2.PeeringConnectionOptionsRequest) bool { - return aws.BoolValue(o1.AllowDnsResolutionFromRemoteVpc) == aws.BoolValue(o2.AllowDnsResolutionFromRemoteVpc) && - aws.BoolValue(o1.AllowEgressFromLocalClassicLinkToRemoteVpc) == aws.BoolValue(o2.AllowEgressFromLocalClassicLinkToRemoteVpc) && - aws.BoolValue(o1.AllowEgressFromLocalVpcToRemoteClassicLink) == aws.BoolValue(o2.AllowEgressFromLocalVpcToRemoteClassicLink) + return aws.BoolValue(o1.AllowDnsResolutionFromRemoteVpc) == aws.BoolValue(o2.AllowDnsResolutionFromRemoteVpc) } func expandPeeringConnectionOptionsRequest(tfMap map[string]interface{}) *ec2.PeeringConnectionOptionsRequest { From b857b6c3959baab00566d609789a089a5e1f2247 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:36:20 -0400 Subject: [PATCH 091/304] r/aws_vpc: Remove 'enable_classiclink' and 'enable_classiclink_dns_support'. --- .changelog/30966.txt | 4 ++ internal/service/ec2/vpc_.go | 106 ------------------------------- internal/service/ec2/vpc_test.go | 2 - website/docs/r/vpc.html.markdown | 8 --- 4 files changed, 4 insertions(+), 116 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index a7dd00fd05ee..342090141a3d 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -60,4 +60,8 @@ data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the ` ```release-note:bug resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` +``` + +```release-note:breaking-change +resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_.go b/internal/service/ec2/vpc_.go index 2c267b6e4771..e7c6ce0578da 100644 --- a/internal/service/ec2/vpc_.go +++ b/internal/service/ec2/vpc_.go @@ -90,18 +90,6 @@ func ResourceVPC() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "enable_classiclink": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Deprecated: `With the retirement of EC2-Classic the enable_classiclink attribute has been deprecated and will be removed in a future version.`, - }, - "enable_classiclink_dns_support": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Deprecated: `With the retirement of EC2-Classic the enable_classiclink_dns_support attribute has been deprecated and will be removed in a future version.`, - }, "enable_dns_hostnames": { Type: schema.TypeBool, Optional: true, @@ -186,10 +174,6 @@ func resourceVPCCreate(ctx context.Context, d *schema.ResourceData, meta interfa var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - if _, ok := d.GetOk("enable_classiclink"); ok { - return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new VPCs can be created with ClassicLink enabled`) - } - input := &ec2.CreateVpcInput{ AmazonProvidedIpv6CidrBlock: aws.Bool(d.Get("assign_generated_ipv6_cidr_block").(bool)), InstanceTenancy: aws.String(d.Get("instance_tenancy").(string)), @@ -255,8 +239,6 @@ func resourceVPCCreate(ctx context.Context, d *schema.ResourceData, meta interfa vpcInfo := vpcInfo{ vpc: vpc, - enableClassicLink: false, - enableClassicLinkDNSSupport: false, enableDnsHostnames: false, enableDnsSupport: true, enableNetworkAddressUsageMetrics: false, @@ -303,26 +285,6 @@ func resourceVPCRead(ctx context.Context, d *schema.ResourceData, meta interface d.Set("instance_tenancy", vpc.InstanceTenancy) d.Set("owner_id", ownerID) - if v, err := FindVPCClassicLinkEnabled(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { - d.Set("enable_classiclink", nil) - } else { - return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) ClassicLinkEnabled: %s", d.Id(), err) - } - } else { - d.Set("enable_classiclink", v) - } - - if v, err := FindVPCClassicLinkDNSSupported(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { - d.Set("enable_classiclink_dns_support", nil) - } else { - return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) ClassicLinkDnsSupported: %s", d.Id(), err) - } - } else { - d.Set("enable_classiclink_dns_support", v) - } - if v, err := FindVPCAttribute(ctx, conn, d.Id(), ec2.VpcAttributeNameEnableDnsHostnames); err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) Attribute (%s): %s", d.Id(), ec2.VpcAttributeNameEnableDnsHostnames, err) } else { @@ -429,18 +391,6 @@ func resourceVPCUpdate(ctx context.Context, d *schema.ResourceData, meta interfa } } - if d.HasChange("enable_classiclink") { - if err := modifyVPCClassicLink(ctx, conn, d.Id(), d.Get("enable_classiclink").(bool)); err != nil { - return sdkdiag.AppendErrorf(diags, "updating EC2 VPC (%s): %s", d.Id(), err) - } - } - - if d.HasChange("enable_classiclink_dns_support") { - if err := modifyVPCClassicLinkDNSSupport(ctx, conn, d.Id(), d.Get("enable_classiclink_dns_support").(bool)); err != nil { - return sdkdiag.AppendErrorf(diags, "updating EC2 VPC (%s): %s", d.Id(), err) - } - } - if d.HasChange("instance_tenancy") { if err := modifyVPCTenancy(ctx, conn, d.Id(), d.Get("instance_tenancy").(string)); err != nil { return sdkdiag.AppendErrorf(diags, "updating EC2 VPC (%s): %s", d.Id(), err) @@ -623,62 +573,6 @@ func modifyVPCAttributesOnCreate(ctx context.Context, conn *ec2.EC2, d *schema.R } } - if new, old := d.Get("enable_classiclink").(bool), vpcInfo.enableClassicLink; old != new { - if err := modifyVPCClassicLink(ctx, conn, d.Id(), new); err != nil { - return err - } - } - - if new, old := d.Get("enable_classiclink_dns_support").(bool), vpcInfo.enableClassicLinkDNSSupport; old != new { - if err := modifyVPCClassicLinkDNSSupport(ctx, conn, d.Id(), new); err != nil { - return err - } - } - - return nil -} - -func modifyVPCClassicLink(ctx context.Context, conn *ec2.EC2, vpcID string, v bool) error { - if v { - input := &ec2.EnableVpcClassicLinkInput{ - VpcId: aws.String(vpcID), - } - - if _, err := conn.EnableVpcClassicLinkWithContext(ctx, input); err != nil { - return fmt.Errorf("enabling EnableDnsHostnames: %w", err) - } - } else { - input := &ec2.DisableVpcClassicLinkInput{ - VpcId: aws.String(vpcID), - } - - if _, err := conn.DisableVpcClassicLinkWithContext(ctx, input); err != nil { - return fmt.Errorf("disabling EnableDnsHostnames: %w", err) - } - } - - return nil -} - -func modifyVPCClassicLinkDNSSupport(ctx context.Context, conn *ec2.EC2, vpcID string, v bool) error { - if v { - input := &ec2.EnableVpcClassicLinkDnsSupportInput{ - VpcId: aws.String(vpcID), - } - - if _, err := conn.EnableVpcClassicLinkDnsSupportWithContext(ctx, input); err != nil { - return fmt.Errorf("enabling ClassicLinkDnsSupport: %w", err) - } - } else { - input := &ec2.DisableVpcClassicLinkDnsSupportInput{ - VpcId: aws.String(vpcID), - } - - if _, err := conn.DisableVpcClassicLinkDnsSupportWithContext(ctx, input); err != nil { - return fmt.Errorf("disabling ClassicLinkDnsSupport: %w", err) - } - } - return nil } diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 938b3842dd27..9625e7948893 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -41,8 +41,6 @@ func TestAccVPC_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), diff --git a/website/docs/r/vpc.html.markdown b/website/docs/r/vpc.html.markdown index 6f0b9b26e9e5..89ef582e8257 100644 --- a/website/docs/r/vpc.html.markdown +++ b/website/docs/r/vpc.html.markdown @@ -79,11 +79,6 @@ The following arguments are supported: * `enable_dns_support` - (Optional) A boolean flag to enable/disable DNS support in the VPC. Defaults to true. * `enable_network_address_usage_metrics` - (Optional) Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false. * `enable_dns_hostnames` - (Optional) A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false. -* `enable_classiclink` - (Optional) A boolean flag to enable/disable ClassicLink - for the VPC. Only valid in regions and accounts that support EC2 Classic. - See the [ClassicLink documentation][1] for more information. Defaults false. -* `enable_classiclink_dns_support` - (Optional) A boolean flag to enable/disable ClassicLink DNS Support for the VPC. - Only valid in regions and accounts that support EC2 Classic. * `assign_generated_ipv6_cidr_block` - (Optional) Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is `false`. Conflicts with `ipv6_ipam_pool_id` * `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. @@ -97,7 +92,6 @@ In addition to all arguments above, the following attributes are exported: * `enable_dns_support` - Whether or not the VPC has DNS support * `enable_network_address_usage_metrics` - Whether Network Address Usage metrics are enabled for the VPC * `enable_dns_hostnames` - Whether or not the VPC has DNS hostname support -* `enable_classiclink` - Whether or not the VPC has Classiclink enabled * `main_route_table_id` - The ID of the main route table associated with this VPC. Note that you can change a VPC's main route table by using an [`aws_main_route_table_association`](/docs/providers/aws/r/main_route_table_association.html). @@ -109,8 +103,6 @@ In addition to all arguments above, the following attributes are exported: * `owner_id` - The ID of the AWS account that owns the VPC. * `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). -[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html - ## Import VPCs can be imported using the `vpc id`, e.g., From 7843210a5811ea0b742fffdbd6c0a815e2379e9e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:40:05 -0400 Subject: [PATCH 092/304] r/aws_default_vpc: Remove 'enable_classiclink' and 'enable_classiclink_dns_support'. --- .changelog/30966.txt | 4 + internal/service/ec2/find.go | 77 -------------------- internal/service/ec2/vpc_.go | 2 - internal/service/ec2/vpc_default_vpc.go | 34 --------- internal/service/ec2/vpc_default_vpc_test.go | 12 --- 5 files changed, 4 insertions(+), 125 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 342090141a3d..1468277d52e5 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -64,4 +64,8 @@ resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEq ```release-note:breaking-change resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed +``` + +```release-note:breaking-change +resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index cc4b9f5dc671..69a63e0a8789 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -2796,83 +2796,6 @@ func FindVPCAttribute(ctx context.Context, conn *ec2.EC2, vpcID string, attribut return aws.BoolValue(v.Value), nil } -func FindVPCClassicLinkEnabled(ctx context.Context, conn *ec2.EC2, vpcID string) (bool, error) { - input := &ec2.DescribeVpcClassicLinkInput{ - VpcIds: aws.StringSlice([]string{vpcID}), - } - - output, err := conn.DescribeVpcClassicLinkWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, errCodeInvalidVPCIDNotFound, errCodeUnsupportedOperation) { - return false, &retry.NotFoundError{ - LastError: err, - LastRequest: input, - } - } - - if err != nil { - return false, err - } - - if output == nil || len(output.Vpcs) == 0 || output.Vpcs[0] == nil { - return false, tfresource.NewEmptyResultError(input) - } - - if count := len(output.Vpcs); count > 1 { - return false, tfresource.NewTooManyResultsError(count, input) - } - - vpc := output.Vpcs[0] - - // Eventual consistency check. - if aws.StringValue(vpc.VpcId) != vpcID { - return false, &retry.NotFoundError{ - LastRequest: input, - } - } - - return aws.BoolValue(vpc.ClassicLinkEnabled), nil -} - -func FindVPCClassicLinkDNSSupported(ctx context.Context, conn *ec2.EC2, vpcID string) (bool, error) { - input := &ec2.DescribeVpcClassicLinkDnsSupportInput{ - VpcIds: aws.StringSlice([]string{vpcID}), - } - - output, err := conn.DescribeVpcClassicLinkDnsSupportWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, errCodeInvalidVPCIDNotFound, errCodeUnsupportedOperation) || - tfawserr.ErrMessageContains(err, errCodeAuthFailure, "This request has been administratively disabled") { - return false, &retry.NotFoundError{ - LastError: err, - LastRequest: input, - } - } - - if err != nil { - return false, err - } - - if output == nil || len(output.Vpcs) == 0 || output.Vpcs[0] == nil { - return false, tfresource.NewEmptyResultError(input) - } - - if count := len(output.Vpcs); count > 1 { - return false, tfresource.NewTooManyResultsError(count, input) - } - - vpc := output.Vpcs[0] - - // Eventual consistency check. - if aws.StringValue(vpc.VpcId) != vpcID { - return false, &retry.NotFoundError{ - LastRequest: input, - } - } - - return aws.BoolValue(vpc.ClassicLinkDnsSupported), nil -} - func FindVPC(ctx context.Context, conn *ec2.EC2, input *ec2.DescribeVpcsInput) (*ec2.Vpc, error) { output, err := FindVPCs(ctx, conn, input) diff --git a/internal/service/ec2/vpc_.go b/internal/service/ec2/vpc_.go index e7c6ce0578da..ff1a0f04e7e4 100644 --- a/internal/service/ec2/vpc_.go +++ b/internal/service/ec2/vpc_.go @@ -545,8 +545,6 @@ func defaultIPv6CIDRBlockAssociation(vpc *ec2.Vpc, associationID string) *ec2.Vp type vpcInfo struct { vpc *ec2.Vpc - enableClassicLink bool - enableClassicLinkDNSSupport bool enableDnsHostnames bool enableDnsSupport bool enableNetworkAddressUsageMetrics bool diff --git a/internal/service/ec2/vpc_default_vpc.go b/internal/service/ec2/vpc_default_vpc.go index 0ac248b2bb2f..045e0edcb9c9 100644 --- a/internal/service/ec2/vpc_default_vpc.go +++ b/internal/service/ec2/vpc_default_vpc.go @@ -75,18 +75,6 @@ func ResourceDefaultVPC() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "enable_classiclink": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Deprecated: `With the retirement of EC2-Classic the enable_classiclink attribute has been deprecated and will be removed in a future version.`, - }, - "enable_classiclink_dns_support": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Deprecated: `With the retirement of EC2-Classic the enable_classiclink_dns_support attribute has been deprecated and will be removed in a future version.`, - }, "enable_dns_hostnames": { Type: schema.TypeBool, Optional: true, @@ -183,26 +171,6 @@ func resourceDefaultVPCCreate(ctx context.Context, d *schema.ResourceData, meta vpcInfo.vpc = vpc - if v, err := FindVPCClassicLinkEnabled(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { - vpcInfo.enableClassicLink = false - } else { - return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) ClassicLinkEnabled: %s", d.Id(), err) - } - } else { - vpcInfo.enableClassicLink = v - } - - if v, err := FindVPCClassicLinkDNSSupported(ctx, conn, d.Id()); err != nil { - if tfresource.NotFound(err) { - vpcInfo.enableClassicLinkDNSSupport = false - } else { - return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) ClassicLinkDnsSupported: %s", d.Id(), err) - } - } else { - vpcInfo.enableClassicLinkDNSSupport = v - } - if v, err := FindVPCAttribute(ctx, conn, d.Id(), ec2.VpcAttributeNameEnableDnsHostnames); err != nil { return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) Attribute (%s): %s", d.Id(), ec2.VpcAttributeNameEnableDnsHostnames, err) } else { @@ -241,8 +209,6 @@ func resourceDefaultVPCCreate(ctx context.Context, d *schema.ResourceData, meta } vpcInfo.vpc = vpc - vpcInfo.enableClassicLink = false - vpcInfo.enableClassicLinkDNSSupport = false vpcInfo.enableDnsHostnames = true vpcInfo.enableDnsSupport = true vpcInfo.enableNetworkAddressUsageMetrics = false diff --git a/internal/service/ec2/vpc_default_vpc_test.go b/internal/service/ec2/vpc_default_vpc_test.go index 0492f576098f..b2331ed0b534 100644 --- a/internal/service/ec2/vpc_default_vpc_test.go +++ b/internal/service/ec2/vpc_default_vpc_test.go @@ -98,8 +98,6 @@ func testAccDefaultVPC_Existing_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), @@ -147,8 +145,6 @@ func testAccDefaultVPC_Existing_assignGeneratedIPv6CIDRBlock(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), @@ -224,8 +220,6 @@ func testAccDefaultVPC_NotFound_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), @@ -273,8 +267,6 @@ func testAccDefaultVPC_NotFound_assignGeneratedIPv6CIDRBlock(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), @@ -351,8 +343,6 @@ func testAccDefaultVPC_NotFound_assignGeneratedIPv6CIDRBlockAdoption(t *testing. resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), @@ -395,8 +385,6 @@ func testAccDefaultVPC_NotFound_assignGeneratedIPv6CIDRBlockAdoption(t *testing. resource.TestCheckResourceAttrSet(resourceName, "default_route_table_id"), resource.TestCheckResourceAttrSet(resourceName, "default_security_group_id"), resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_id"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink", "false"), - resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"), resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"), resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"), resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"), From ba76461d3c9dc49fe6198745dd7b907f40916428 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 15:58:04 -0400 Subject: [PATCH 093/304] r/aws_default_vpc: Fix crash 'panic: interface conversion: interface {} is nil, not string'. --- internal/service/ec2/vpc_.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/service/ec2/vpc_.go b/internal/service/ec2/vpc_.go index ff1a0f04e7e4..d346abd5e9c6 100644 --- a/internal/service/ec2/vpc_.go +++ b/internal/service/ec2/vpc_.go @@ -462,9 +462,14 @@ func resourceVPCDelete(ctx context.Context, d *schema.ResourceData, meta interfa } // If the VPC's CIDR block was allocated from an IPAM pool, wait for the allocation to disappear. - ipamPoolID := d.Get("ipv4_ipam_pool_id").(string) + var ipamPoolID string + if v, ok := d.GetOk("ipv4_ipam_pool_id"); ok { + ipamPoolID = v.(string) + } if ipamPoolID == "" { - ipamPoolID = d.Get("ipv6_ipam_pool_id").(string) + if v, ok := d.GetOk("ipv6_ipam_pool_id"); ok { + ipamPoolID = v.(string) + } } if ipamPoolID != "" && ipamPoolID != amazonIPv6PoolID { const ( From 009c81481650d58efc342368d0ac6133d7e5123d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 25 Apr 2023 17:03:04 -0400 Subject: [PATCH 094/304] Fix 'TestAccVPC_assignGeneratedIPv6CIDRBlockWithNetworkBorderGroup'. --- .../ec2/ec2_availability_zone_data_source_test.go | 10 +++++++++- internal/service/ec2/vpc_test.go | 14 +++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/internal/service/ec2/ec2_availability_zone_data_source_test.go b/internal/service/ec2/ec2_availability_zone_data_source_test.go index 63c59956bea7..867126648b64 100644 --- a/internal/service/ec2/ec2_availability_zone_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zone_data_source_test.go @@ -6,6 +6,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -187,7 +188,7 @@ func TestAccEC2AvailabilityZoneDataSource_zoneID(t *testing.T) { }) } -func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T) { +func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T, groupNames ...string) { conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn() input := &ec2.DescribeAvailabilityZonesInput{ @@ -197,6 +198,13 @@ func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T) { }), } + if len(groupNames) > 0 { + input.Filters = append(input.Filters, &ec2.Filter{ + Name: aws.String("group-name"), + Values: aws.StringSlice(groupNames), + }) + } + output, err := tfec2.FindAvailabilityZones(ctx, conn, input) if acctest.PreCheckSkipError(err) { diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 9625e7948893..86a1bbbed20c 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -896,7 +896,14 @@ func TestAccVPC_assignGeneratedIPv6CIDRBlockWithNetworkBorderGroup(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckLocalZoneAvailable(ctx, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) + // https://docs.aws.amazon.com/vpc/latest/userguide/Extend_VPCs.html#local-zone: + // "You can request the IPv6 Amazon-provided IP addresses and associate them with the network border group + // for a new or existing VPCs only for us-west-2-lax-1a and use-west-2-lax-1b. All other Local Zones don't support IPv6." + testAccPreCheckLocalZoneAvailable(ctx, t, "us-west-2-lax-1") + }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -1203,6 +1210,11 @@ data "aws_availability_zones" "available" { name = "opt-in-status" values = ["opted-in"] } + + filter { + name = "group-name" + values = ["us-west-2-lax-1"] + } } data "aws_availability_zone" "test" { From e176e9be908e65c61772d456b249c7cd0775d79d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 10:31:04 -0400 Subject: [PATCH 095/304] Fix providerlint 'AWSAR003'. --- internal/service/ec2/vpc_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 86a1bbbed20c..f45a6eae41de 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -902,7 +902,7 @@ func TestAccVPC_assignGeneratedIPv6CIDRBlockWithNetworkBorderGroup(t *testing.T) // https://docs.aws.amazon.com/vpc/latest/userguide/Extend_VPCs.html#local-zone: // "You can request the IPv6 Amazon-provided IP addresses and associate them with the network border group // for a new or existing VPCs only for us-west-2-lax-1a and use-west-2-lax-1b. All other Local Zones don't support IPv6." - testAccPreCheckLocalZoneAvailable(ctx, t, "us-west-2-lax-1") + testAccPreCheckLocalZoneAvailable(ctx, t, "us-west-2-lax-1") //lintignore:AWSAT003 }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -1194,7 +1194,7 @@ resource "aws_vpc" "test" { `, rName, assignGeneratedIpv6CidrBlock) } -func testAccVPCConfig_assignGeneratedIPv6CIDRBlockOptionalNetworkBorderGroup(rName string, localZoneNetworkBorderGroup bool) string { +func testAccVPCConfig_assignGeneratedIPv6CIDRBlockOptionalNetworkBorderGroup(rName string, localZoneNetworkBorderGroup bool) string { // lintignore:AWSAT003 return fmt.Sprintf(` data "aws_region" "current" {} From b9d7c2395ff8ee28cc1b1222f9b56f7dfcf95178 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 25 Apr 2023 13:59:42 -0500 Subject: [PATCH 096/304] tags: duplicate and computed tags on framework --- internal/framework/base.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/internal/framework/base.go b/internal/framework/base.go index 0c4cae091a8c..ab9493fd6a3b 100644 --- a/internal/framework/base.go +++ b/internal/framework/base.go @@ -90,17 +90,15 @@ func (r *ResourceWithConfigure) SetTagsAll(ctx context.Context, request resource } if !planTags.IsUnknown() { - resourceTags := tftags.New(ctx, planTags) + if !HasUnknownElements(planTags) { + resourceTags := tftags.New(ctx, planTags) - if defaultTagsConfig.TagsEqual(resourceTags) { - response.Diagnostics.AddError( - `"tags" are identical to those in the "default_tags" configuration block of the provider`, - "please de-duplicate and try again") - } - - allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) + allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) - response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root("tags_all"), flex.FlattenFrameworkStringValueMapLegacy(ctx, allTags.Map()))...) + response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root("tags_all"), flex.FlattenFrameworkStringValueMapLegacy(ctx, allTags.Map()))...) + } else { + response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root("tags_all"), tftags.Unknown)...) + } } else { response.Diagnostics.Append(response.Plan.SetAttribute(ctx, path.Root("tags_all"), tftags.Unknown)...) } @@ -210,3 +208,13 @@ func (w *WithTimeouts) DeleteTimeout(ctx context.Context, timeouts timeouts.Valu return timeout } + +func HasUnknownElements(m types.Map) bool { + for _, v := range m.Elements() { + if v.IsUnknown() { + return true + } + } + + return false +} From 1a9a6d3fc23c727980630831390c7ca1bf57e763 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 25 Apr 2023 18:26:25 -0500 Subject: [PATCH 097/304] ignore config tags after state fresh when resolving duplicates --- internal/framework/base.go | 4 ++-- internal/provider/intercept.go | 2 +- internal/provider/tags_interceptor.go | 2 +- internal/tags/key_value_tags.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/framework/base.go b/internal/framework/base.go index ab9493fd6a3b..908e6bfcd745 100644 --- a/internal/framework/base.go +++ b/internal/framework/base.go @@ -90,7 +90,7 @@ func (r *ResourceWithConfigure) SetTagsAll(ctx context.Context, request resource } if !planTags.IsUnknown() { - if !HasUnknownElements(planTags) { + if !mapHasUnknownElements(planTags) { resourceTags := tftags.New(ctx, planTags) allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) @@ -209,7 +209,7 @@ func (w *WithTimeouts) DeleteTimeout(ctx context.Context, timeouts timeouts.Valu return timeout } -func HasUnknownElements(m types.Map) bool { +func mapHasUnknownElements(m types.Map) bool { for _, v := range m.Elements() { if v.IsUnknown() { return true diff --git a/internal/provider/intercept.go b/internal/provider/intercept.go index fcaa70eac277..f1ccfe2625d4 100644 --- a/internal/provider/intercept.go +++ b/internal/provider/intercept.go @@ -348,7 +348,7 @@ func (r tagsInterceptor) run(ctx context.Context, d schemaResourceData, meta any tags := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags can now include duplicate tags that have been configured on the provider. - if err := d.Set(names.AttrTags, tags.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + if err := d.Set(names.AttrTags, tags.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, tagsInContext.IgnoreConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 2ac0ece095ed..83de6c05cc3c 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -142,7 +142,7 @@ func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePac toAdd := tagsInContext.TagsOut.UnwrapOrDefault().IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig) // The resource's configured tags can now include duplicate tags that have been configured on the provider. - if err := d.Set(names.AttrTags, toAdd.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, d).Map()); err != nil { + if err := d.Set(names.AttrTags, toAdd.ResolveDuplicates(ctx, tagsInContext.DefaultConfig, tagsInContext.IgnoreConfig, d).Map()); err != nil { return ctx, sdkdiag.AppendErrorf(diags, "setting %s: %s", names.AttrTags, err) } diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index 20b8823687ba..be91e0a2f809 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -745,7 +745,7 @@ type schemaResourceData interface { GetRawState() cty.Value } -func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, d schemaResourceData) KeyValueTags { +func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig *IgnoreConfig, d schemaResourceData) KeyValueTags { // remove default config. t := tags.RemoveDefaultConfig(defaultConfig) @@ -803,7 +803,7 @@ func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *D } } - return New(ctx, result) + return New(ctx, result).IgnoreConfig(ignoreConfig) } // ToSnakeCase converts a string to snake case. From 2c82632a2bb33756ad659bd272505c4acc0b75af Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 25 Apr 2023 20:43:03 -0500 Subject: [PATCH 098/304] resolve duplicates with default tags --- internal/provider/fwprovider/intercept.go | 2 +- .../vpc_security_group_ingress_rule_test.go | 9 +++- internal/tags/key_value_tags.go | 42 +++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/internal/provider/fwprovider/intercept.go b/internal/provider/fwprovider/intercept.go index c8e017d5c178..9765bab29b40 100644 --- a/internal/provider/fwprovider/intercept.go +++ b/internal/provider/fwprovider/intercept.go @@ -410,7 +410,7 @@ func (r tagsInterceptor) read(ctx context.Context, request resource.ReadRequest, stateTags := tftags.Null // Remove any provider configured ignore_tags and system tags from those returned from the service API. // The resource's configured tags do not include any provider configured default_tags. - if v := apiTags.IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig).RemoveDefaultConfig(tagsInContext.DefaultConfig).Map(); len(v) > 0 { + if v := apiTags.IgnoreSystem(inContext.ServicePackageName).IgnoreConfig(tagsInContext.IgnoreConfig).ResolveDuplicatesFramework(ctx, tagsInContext.DefaultConfig, tagsInContext.IgnoreConfig, response, diags).Map(); len(v) > 0 { stateTags = flex.FlattenFrameworkStringValueMapLegacy(ctx, v) } diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTags), &stateTags)...) diff --git a/internal/service/ec2/vpc_security_group_ingress_rule_test.go b/internal/service/ec2/vpc_security_group_ingress_rule_test.go index 4148f12854f2..8378de04921e 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_test.go @@ -461,6 +461,8 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_overlappi func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + var v ec2.SecurityGroupRule + resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, @@ -473,8 +475,11 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_duplicate acctest.ConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), testAccVPCSecurityGroupIngressRuleConfig_tags1(rName, "overlapkey", "overlapvalue"), ), - PlanOnly: true, - ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), + Check: resource.ComposeTestCheckFunc( + testAccCheckSecurityGroupIngressRuleExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + ), }, }, }) diff --git a/internal/tags/key_value_tags.go b/internal/tags/key_value_tags.go index be91e0a2f809..0b2581ccf769 100644 --- a/internal/tags/key_value_tags.go +++ b/internal/tags/key_value_tags.go @@ -7,9 +7,13 @@ import ( "reflect" "regexp" "sort" + "strconv" "strings" "github.com/hashicorp/go-cty/cty" + fwdiag "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/flex" @@ -806,6 +810,44 @@ func (tags KeyValueTags) ResolveDuplicates(ctx context.Context, defaultConfig *D return New(ctx, result).IgnoreConfig(ignoreConfig) } +func (tags KeyValueTags) ResolveDuplicatesFramework(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig *IgnoreConfig, resp *resource.ReadResponse, diags fwdiag.Diagnostics) KeyValueTags { + // remove default config. + t := tags.RemoveDefaultConfig(defaultConfig) + + var tagsAll types.Map + diags.Append(resp.State.GetAttribute(ctx, path.Root("tags"), &tagsAll)...) + + if diags.HasError() { + return KeyValueTags{} + } + + result := make(map[string]string) + for k, v := range t { + result[k] = v.ValueString() + } + + for k, v := range tagsAll.Elements() { + if _, ok := result[k]; !ok { + if defaultConfig != nil { + s, err := strconv.Unquote(v.String()) // TODO rework to use Framework Map.Equals() value + + if err != nil { + diags.AddError( + "unable to normalize string", + "unable to normalize string default value", + ) + } + + if val, ok := defaultConfig.Tags[k]; ok && val.ValueString() == s { + result[k] = s + } + } + } + } + + return New(ctx, result).IgnoreConfig(ignoreConfig) +} + // ToSnakeCase converts a string to snake case. // // For example, AWS Go SDK field names are in PascalCase, From 6a3e6f94baef3965bdb2366668707edb83d6d63b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 26 Apr 2023 14:52:58 +0000 Subject: [PATCH 099/304] Update CHANGELOG.md for #30842 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5eeb32d2b06..85876529b80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ BREAKING CHANGES: * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From f8bdac6cc33e9ed8b6ffd2cea313eda657ac7af3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 10:57:41 -0400 Subject: [PATCH 100/304] r/aws_eip: Remove support for standard domain. --- .changelog/30966.txt | 4 + internal/service/ec2/ec2_eip.go | 133 +++++++++++---------------- internal/service/ec2/ec2_eip_test.go | 18 +--- internal/service/ec2/find.go | 1 + 4 files changed, 63 insertions(+), 93 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index 1468277d52e5..e0ebdc703a66 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -68,4 +68,8 @@ resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` an ```release-note:breaking-change resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed +``` + +```release-note:breaking-change +resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ``` \ No newline at end of file diff --git a/internal/service/ec2/ec2_eip.go b/internal/service/ec2/ec2_eip.go index 55b511a85e7e..8778eab86907 100644 --- a/internal/service/ec2/ec2_eip.go +++ b/internal/service/ec2/ec2_eip.go @@ -140,10 +140,6 @@ func resourceEIPCreate(ctx context.Context, d *schema.ResourceData, meta interfa TagSpecifications: getTagSpecificationsIn(ctx, ec2.ResourceTypeElasticIp), } - if v := d.Get("vpc"); v != nil && v.(bool) { - input.Domain = aws.String(ec2.DomainTypeVpc) - } - if v, ok := d.GetOk("address"); ok { input.Address = aws.String(v.(string)) } @@ -152,6 +148,10 @@ func resourceEIPCreate(ctx context.Context, d *schema.ResourceData, meta interfa input.CustomerOwnedIpv4Pool = aws.String(v.(string)) } + if v := d.Get("vpc"); v != nil && v.(bool) { + input.Domain = aws.String(ec2.DomainTypeVpc) + } + if v, ok := d.GetOk("network_border_group"); ok { input.NetworkBorderGroup = aws.String(v.(string)) } @@ -176,17 +176,14 @@ func resourceEIPCreate(ctx context.Context, d *schema.ResourceData, meta interfa return sdkdiag.AppendErrorf(diags, "waiting for EC2 EIP (%s) create: %s", d.Id(), err) } - instanceID := d.Get("instance").(string) - eniID := d.Get("network_interface").(string) - - if instanceID != "" || eniID != "" { + if instanceID, eniID := d.Get("instance").(string), d.Get("network_interface").(string); instanceID != "" || eniID != "" { _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, d.Timeout(schema.TimeoutCreate), func() (interface{}, error) { return nil, associateEIP(ctx, conn, d.Id(), instanceID, eniID, d.Get("associate_with_private_ip").(string)) }, errCodeInvalidAllocationIDNotFound) if err != nil { - return sdkdiag.AppendErrorf(diags, "creating EC2 EIP (%s): %s", d.Id(), err) + return sdkdiag.AppendFromErr(diags, err) } } @@ -197,15 +194,12 @@ func resourceEIPRead(ctx context.Context, d *schema.ResourceData, meta interface var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - var err error - var address *ec2.Address - - if eipID(d.Id()).IsVPC() { - address, err = FindEIPByAllocationID(ctx, conn, d.Id()) - } else { - address, err = FindEIPByPublicIP(ctx, conn, d.Id()) + if !eipID(d.Id()).IsVPC() { + return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic %s domain EC2 EIPs are no longer supported`, ec2.DomainTypeStandard) } + address, err := FindEIPByAllocationID(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] EC2 EIP (%s) not found, removing from state", d.Id()) d.SetId("") @@ -256,19 +250,16 @@ func resourceEIPUpdate(ctx context.Context, d *schema.ResourceData, meta interfa if d.HasChanges("associate_with_private_ip", "instance", "network_interface") { o, n := d.GetChange("instance") oldInstanceID, newInstanceID := o.(string), n.(string) - associationID := d.Get("association_id").(string) - if oldInstanceID != "" || associationID != "" { - if err := disassociateEIP(ctx, conn, d.Id(), associationID); err != nil { - return sdkdiag.AppendErrorf(diags, "updating EC2 EIP (%s): %s", d.Id(), err) + if associationID := d.Get("association_id").(string); oldInstanceID != "" || associationID != "" { + if err := disassociateEIP(ctx, conn, associationID); err != nil { + return sdkdiag.AppendFromErr(diags, err) } } - newNetworkInterfaceID := d.Get("network_interface").(string) - - if newInstanceID != "" || newNetworkInterfaceID != "" { + if newNetworkInterfaceID := d.Get("network_interface").(string); newInstanceID != "" || newNetworkInterfaceID != "" { if err := associateEIP(ctx, conn, d.Id(), newInstanceID, newNetworkInterfaceID, d.Get("associate_with_private_ip").(string)); err != nil { - return sdkdiag.AppendErrorf(diags, "updating EC2 EIP (%s): %s", d.Id(), err) + return sdkdiag.AppendFromErr(diags, err) } } } @@ -280,25 +271,26 @@ func resourceEIPDelete(ctx context.Context, d *schema.ResourceData, meta interfa var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() + if !eipID(d.Id()).IsVPC() { + return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic %s domain EC2 EIPs are no longer supported`, ec2.DomainTypeStandard) + } + // If we are attached to an instance or interface, detach first. if associationID := d.Get("association_id").(string); associationID != "" || d.Get("instance").(string) != "" { - if err := disassociateEIP(ctx, conn, d.Id(), associationID); err != nil { - return sdkdiag.AppendErrorf(diags, "deleting EC2 EIP (%s): %s", d.Id(), err) + if err := disassociateEIP(ctx, conn, associationID); err != nil { + return sdkdiag.AppendFromErr(diags, err) } } - input := &ec2.ReleaseAddressInput{} - - if eipID(d.Id()).IsVPC() { - input.AllocationId = aws.String(d.Id()) + input := &ec2.ReleaseAddressInput{ + AllocationId: aws.String(d.Id()), + } - if v, ok := d.GetOk("network_border_group"); ok { - input.NetworkBorderGroup = aws.String(v.(string)) - } - } else { - input.PublicIp = aws.String(d.Id()) + if v, ok := d.GetOk("network_border_group"); ok { + input.NetworkBorderGroup = aws.String(v.(string)) } + log.Printf("[INFO] Deleting EC2 EIP: %s", d.Id()) _, err := conn.ReleaseAddressWithContext(ctx, input) if tfawserr.ErrCodeEquals(err, errCodeInvalidAllocationIDNotFound) { @@ -319,13 +311,9 @@ func (id eipID) IsVPC() bool { return strings.HasPrefix(string(id), "eipalloc-") } -func associateEIP(ctx context.Context, conn *ec2.EC2, id, instanceID, networkInterfaceID, privateIPAddress string) error { - input := &ec2.AssociateAddressInput{} - - if eipID(id).IsVPC() { - input.AllocationId = aws.String(id) - } else { - input.PublicIp = aws.String(id) +func associateEIP(ctx context.Context, conn *ec2.EC2, allocationID, instanceID, networkInterfaceID, privateIPAddress string) error { + input := &ec2.AssociateAddressInput{ + AllocationId: aws.String(allocationID), } if instanceID != "" { @@ -343,51 +331,41 @@ func associateEIP(ctx context.Context, conn *ec2.EC2, id, instanceID, networkInt output, err := conn.AssociateAddressWithContext(ctx, input) if err != nil { - return fmt.Errorf("associating: %w", err) + return fmt.Errorf("associating EC2 EIP (%s): %w", allocationID, err) } - if associationID := aws.StringValue(output.AssociationId); associationID != "" { - _, err := tfresource.RetryWhen(ctx, propagationTimeout, - func() (interface{}, error) { - return FindEIPByAssociationID(ctx, conn, associationID) - }, - func(err error) (bool, error) { - if tfresource.NotFound(err) { - return true, err - } + _, err = tfresource.RetryWhen(ctx, propagationTimeout, + func() (interface{}, error) { + return FindEIPByAssociationID(ctx, conn, aws.StringValue(output.AssociationId)) + }, + func(err error) (bool, error) { + if tfresource.NotFound(err) { + return true, err + } - // "InvalidInstanceID: The pending instance 'i-0504e5b44ea06d599' is not in a valid state for this operation." - if tfawserr.ErrMessageContains(err, errCodeInvalidInstanceID, "pending instance") { - return true, err - } + // "InvalidInstanceID: The pending instance 'i-0504e5b44ea06d599' is not in a valid state for this operation." + if tfawserr.ErrMessageContains(err, errCodeInvalidInstanceID, "pending instance") { + return true, err + } - return false, err - }, - ) + return false, err + }, + ) - if err != nil { - return fmt.Errorf("associating: waiting for completion: %w", err) - } - } else { - if err := waitForAddressAssociationClassic(ctx, conn, id, instanceID); err != nil { - return fmt.Errorf("associating: waiting for completion: %w", err) - } + if err != nil { + return fmt.Errorf("waiting for EC2 EIP (%s) association: %w", allocationID, err) } return nil } -func disassociateEIP(ctx context.Context, conn *ec2.EC2, id, associationID string) error { - input := &ec2.DisassociateAddressInput{} - - if eipID(id).IsVPC() { - if associationID == "" { - return nil - } +func disassociateEIP(ctx context.Context, conn *ec2.EC2, associationID string) error { + if associationID == "" { + return nil + } - input.AssociationId = aws.String(associationID) - } else { - input.PublicIp = aws.String(id) + input := &ec2.DisassociateAddressInput{ + AssociationId: aws.String(associationID), } _, err := conn.DisassociateAddressWithContext(ctx, input) @@ -397,7 +375,7 @@ func disassociateEIP(ctx context.Context, conn *ec2.EC2, id, associationID strin } if err != nil { - return fmt.Errorf("disassociating: %w", err) + return fmt.Errorf("disassociating EC2 EIP (%s): %w", associationID, err) } return nil @@ -406,6 +384,7 @@ func disassociateEIP(ctx context.Context, conn *ec2.EC2, id, associationID strin // waitForAddressAssociationClassic ensures the correct Instance is associated with an Address // // This can take a few seconds to appear correctly for EC2-Classic addresses. +// TODO Delete me. func waitForAddressAssociationClassic(ctx context.Context, conn *ec2.EC2, publicIP, instanceID string) error { err := retry.RetryContext(ctx, addressAssociationClassicTimeout, func() *retry.RetryError { address, err := FindEIPByPublicIP(ctx, conn, publicIP) diff --git a/internal/service/ec2/ec2_eip_test.go b/internal/service/ec2/ec2_eip_test.go index 891326fd96fe..f705c0d0d61a 100644 --- a/internal/service/ec2/ec2_eip_test.go +++ b/internal/service/ec2/ec2_eip_test.go @@ -5,7 +5,6 @@ import ( "fmt" "os" "regexp" - "strings" "testing" "github.com/aws/aws-sdk-go/service/ec2" @@ -654,14 +653,7 @@ func testAccCheckEIPExists(ctx context.Context, n string, v *ec2.Address) resour conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn() - var err error - var output *ec2.Address - - if strings.HasPrefix(rs.Primary.ID, "eipalloc-") { - output, err = tfec2.FindEIPByAllocationID(ctx, conn, rs.Primary.ID) - } else { - output, err = tfec2.FindEIPByPublicIP(ctx, conn, rs.Primary.ID) - } + output, err := tfec2.FindEIPByAllocationID(ctx, conn, rs.Primary.ID) if err != nil { return err @@ -682,13 +674,7 @@ func testAccCheckEIPDestroy(ctx context.Context) resource.TestCheckFunc { continue } - var err error - - if strings.HasPrefix(rs.Primary.ID, "eipalloc-") { - _, err = tfec2.FindEIPByAllocationID(ctx, conn, rs.Primary.ID) - } else { - _, err = tfec2.FindEIPByPublicIP(ctx, conn, rs.Primary.ID) - } + _, err := tfec2.FindEIPByAllocationID(ctx, conn, rs.Primary.ID) if tfresource.NotFound(err) { continue diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index 69a63e0a8789..93f836c907c4 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -792,6 +792,7 @@ func FindEIPByAssociationID(ctx context.Context, conn *ec2.EC2, id string) (*ec2 return output, nil } +// TODO Delete me. func FindEIPByPublicIP(ctx context.Context, conn *ec2.EC2, ip string) (*ec2.Address, error) { input := &ec2.DescribeAddressesInput{ PublicIps: aws.StringSlice([]string{ip}), From d70c04902cc7dcea286bf4369b156216e848ca24 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 26 Apr 2023 10:36:41 -0500 Subject: [PATCH 101/304] add test for computed tags --- .../vpc_security_group_ingress_rule_test.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/internal/service/ec2/vpc_security_group_ingress_rule_test.go b/internal/service/ec2/vpc_security_group_ingress_rule_test.go index 8378de04921e..74ea9fffffd8 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_test.go @@ -188,6 +188,30 @@ func TestAccVPCSecurityGroupIngressRule_tags(t *testing.T) { }) } +func TestAccVPCSecurityGroupIngressRule_tags_computed(t *testing.T) { + ctx := acctest.Context(t) + var v ec2.SecurityGroupRule + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_vpc_security_group_ingress_rule.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCSecurityGroupIngressRuleConfig_computed(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckSecurityGroupIngressRuleExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "tags.eip"), + ), + }, + }, + }) +} + func TestAccVPCSecurityGroupIngressRule_DefaultTags_providerOnly(t *testing.T) { ctx := acctest.Context(t) var v ec2.SecurityGroupRule @@ -1089,6 +1113,27 @@ resource "aws_vpc_security_group_ingress_rule" "test" { `, tagKey1, tagValue1)) } +func testAccVPCSecurityGroupIngressRuleConfig_computed(rName string) string { + return acctest.ConfigCompose(testAccVPCSecurityGroupRuleConfig_base(rName), ` +resource "aws_eip" "test" { + vpc = true +} + +resource "aws_vpc_security_group_ingress_rule" "test" { + security_group_id = aws_security_group.test.id + + cidr_ipv4 = "10.0.0.0/8" + from_port = 80 + ip_protocol = "tcp" + to_port = 8080 + + tags = { + eip = aws_eip.test.public_ip + } +} +`) +} + func testAccVPCSecurityGroupIngressRuleConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return acctest.ConfigCompose(testAccVPCSecurityGroupRuleConfig_base(rName), fmt.Sprintf(` resource "aws_vpc_security_group_ingress_rule" "test" { From fce8e751b998b072bf554a64d9417ae5765772e3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 11:28:54 -0400 Subject: [PATCH 102/304] r/aws_eip_association: Remove support for standard domain. --- .changelog/30966.txt | 4 ++ internal/service/ec2/ec2_eip.go | 37 ---------- internal/service/ec2/ec2_eip_association.go | 69 ++++++++----------- .../service/ec2/ec2_eip_association_test.go | 18 +---- internal/service/ec2/find.go | 22 ------ 5 files changed, 33 insertions(+), 117 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index e0ebdc703a66..b2a4800cb488 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -72,4 +72,8 @@ resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classic ```release-note:breaking-change resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported +``` + +```release-note:breaking-change +resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ``` \ No newline at end of file diff --git a/internal/service/ec2/ec2_eip.go b/internal/service/ec2/ec2_eip.go index 8778eab86907..0251b90e8d2c 100644 --- a/internal/service/ec2/ec2_eip.go +++ b/internal/service/ec2/ec2_eip.go @@ -2,7 +2,6 @@ package ec2 import ( "context" - "errors" "fmt" "log" "net" @@ -13,7 +12,6 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" @@ -23,11 +21,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) -const ( - // Maximum amount of time to wait for EIP association with EC2-Classic instances - addressAssociationClassicTimeout = 2 * time.Minute -) - // @SDKResource("aws_eip", name="EIP") // @Tags(identifierAttribute="id") func ResourceEIP() *schema.Resource { @@ -381,36 +374,6 @@ func disassociateEIP(ctx context.Context, conn *ec2.EC2, associationID string) e return nil } -// waitForAddressAssociationClassic ensures the correct Instance is associated with an Address -// -// This can take a few seconds to appear correctly for EC2-Classic addresses. -// TODO Delete me. -func waitForAddressAssociationClassic(ctx context.Context, conn *ec2.EC2, publicIP, instanceID string) error { - err := retry.RetryContext(ctx, addressAssociationClassicTimeout, func() *retry.RetryError { - address, err := FindEIPByPublicIP(ctx, conn, publicIP) - - if tfresource.NotFound(err) { - return retry.RetryableError(err) - } - - if err != nil { - return retry.NonRetryableError(err) - } - - if aws.StringValue(address.InstanceId) != instanceID { - return retry.RetryableError(errors.New("not associated")) - } - - return nil - }) - - if tfresource.TimedOut(err) { // nosemgrep:ci.helper-schema-TimeoutError-check-doesnt-return-output - _, err = FindEIPByPublicIP(ctx, conn, publicIP) - } - - return err -} - func ConvertIPToDashIP(ip string) string { return strings.Replace(ip, ".", "-", -1) } diff --git a/internal/service/ec2/ec2_eip_association.go b/internal/service/ec2/ec2_eip_association.go index 7d087285f4d4..2cd762a0d952 100644 --- a/internal/service/ec2/ec2_eip_association.go +++ b/internal/service/ec2/ec2_eip_association.go @@ -96,46 +96,34 @@ func resourceEIPAssociationCreate(ctx context.Context, d *schema.ResourceData, m input.PublicIp = aws.String(v.(string)) } - log.Printf("[DEBUG] Creating EC2 EIP Association: %s", input) output, err := conn.AssociateAddressWithContext(ctx, input) if err != nil { return sdkdiag.AppendErrorf(diags, "creating EC2 EIP Association: %s", err) } - if output.AssociationId != nil { - d.SetId(aws.StringValue(output.AssociationId)) + d.SetId(aws.StringValue(output.AssociationId)) - _, err = tfresource.RetryWhen(ctx, propagationTimeout, - func() (interface{}, error) { - return FindEIPByAssociationID(ctx, conn, d.Id()) - }, - func(err error) (bool, error) { - if tfresource.NotFound(err) { - return true, err - } + _, err = tfresource.RetryWhen(ctx, propagationTimeout, + func() (interface{}, error) { + return FindEIPByAssociationID(ctx, conn, d.Id()) + }, + func(err error) (bool, error) { + if tfresource.NotFound(err) { + return true, err + } - // "InvalidInstanceID: The pending instance 'i-0504e5b44ea06d599' is not in a valid state for this operation." - if tfawserr.ErrMessageContains(err, errCodeInvalidInstanceID, "pending instance") { - return true, err - } + // "InvalidInstanceID: The pending instance 'i-0504e5b44ea06d599' is not in a valid state for this operation." + if tfawserr.ErrMessageContains(err, errCodeInvalidInstanceID, "pending instance") { + return true, err + } - return false, err - }, - ) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for EC2 EIP Association (%s) create: %s", d.Id(), err) - } - } else { - // EC2-Classic. - publicIP := aws.StringValue(input.PublicIp) - d.SetId(publicIP) + return false, err + }, + ) - instanceID := aws.StringValue(input.InstanceId) - if err := waitForAddressAssociationClassic(ctx, conn, publicIP, instanceID); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for EC2 EIP (%s) to associate with EC2-Classic Instance (%s): %s", publicIP, instanceID, err) - } + if err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for EC2 EIP Association (%s) create: %s", d.Id(), err) } return append(diags, resourceEIPAssociationRead(ctx, d, meta)...) @@ -145,15 +133,12 @@ func resourceEIPAssociationRead(ctx context.Context, d *schema.ResourceData, met var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - var err error - var address *ec2.Address - - if eipAssociationID(d.Id()).IsVPC() { - address, err = FindEIPByAssociationID(ctx, conn, d.Id()) - } else { - address, err = FindEIPByPublicIP(ctx, conn, d.Id()) + if !eipAssociationID(d.Id()).IsVPC() { + return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic %s domain EC2 EIPs are no longer supported`, ec2.DomainTypeStandard) } + address, err := FindEIPByAssociationID(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] EC2 EIP Association (%s) not found, removing from state", d.Id()) d.SetId("") @@ -177,12 +162,12 @@ func resourceEIPAssociationDelete(ctx context.Context, d *schema.ResourceData, m var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - input := &ec2.DisassociateAddressInput{} + if !eipAssociationID(d.Id()).IsVPC() { + return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic %s domain EC2 EIPs are no longer supported`, ec2.DomainTypeStandard) + } - if eipAssociationID(d.Id()).IsVPC() { - input.AssociationId = aws.String(d.Id()) - } else { - input.PublicIp = aws.String(d.Id()) + input := &ec2.DisassociateAddressInput{ + AssociationId: aws.String(d.Id()), } log.Printf("[DEBUG] Deleting EC2 EIP Association: %s", d.Id()) diff --git a/internal/service/ec2/ec2_eip_association_test.go b/internal/service/ec2/ec2_eip_association_test.go index 229076eb1656..6eede43c6fed 100644 --- a/internal/service/ec2/ec2_eip_association_test.go +++ b/internal/service/ec2/ec2_eip_association_test.go @@ -3,7 +3,6 @@ package ec2_test import ( "context" "fmt" - "strings" "testing" "github.com/aws/aws-sdk-go/service/ec2" @@ -164,14 +163,7 @@ func testAccCheckEIPAssociationExists(ctx context.Context, n string, v *ec2.Addr conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn() - var err error - var output *ec2.Address - - if strings.HasPrefix(rs.Primary.ID, "eipassoc-") { - output, err = tfec2.FindEIPByAssociationID(ctx, conn, rs.Primary.ID) - } else { - output, err = tfec2.FindEIPByPublicIP(ctx, conn, rs.Primary.ID) - } + output, err := tfec2.FindEIPByAssociationID(ctx, conn, rs.Primary.ID) if err != nil { return err @@ -192,13 +184,7 @@ func testAccCheckEIPAssociationDestroy(ctx context.Context) resource.TestCheckFu continue } - var err error - - if strings.HasPrefix(rs.Primary.ID, "eipassoc-") { - _, err = tfec2.FindEIPByAssociationID(ctx, conn, rs.Primary.ID) - } else { - _, err = tfec2.FindEIPByPublicIP(ctx, conn, rs.Primary.ID) - } + _, err := tfec2.FindEIPByAssociationID(ctx, conn, rs.Primary.ID) if tfresource.NotFound(err) { continue diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index 93f836c907c4..10f36f418d2a 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -792,28 +792,6 @@ func FindEIPByAssociationID(ctx context.Context, conn *ec2.EC2, id string) (*ec2 return output, nil } -// TODO Delete me. -func FindEIPByPublicIP(ctx context.Context, conn *ec2.EC2, ip string) (*ec2.Address, error) { - input := &ec2.DescribeAddressesInput{ - PublicIps: aws.StringSlice([]string{ip}), - } - - output, err := FindEIP(ctx, conn, input) - - if err != nil { - return nil, err - } - - // Eventual consistency check. - if aws.StringValue(output.PublicIp) != ip { - return nil, &retry.NotFoundError{ - LastRequest: input, - } - } - - return output, nil -} - func FindHostByID(ctx context.Context, conn *ec2.EC2, id string) (*ec2.Host, error) { input := &ec2.DescribeHostsInput{ HostIds: aws.StringSlice([]string{id}), From c27c6a0add353da1b7425e8767cb98da6ab7deda Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 12:23:50 -0400 Subject: [PATCH 103/304] r/aws_security_group: Remove support for non-VPC security groups. --- .changelog/30966.txt | 4 + internal/service/ec2/vpc_security_group.go | 152 ++++++------------ .../service/ec2/vpc_security_group_test.go | 24 --- 3 files changed, 57 insertions(+), 123 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index b2a4800cb488..e6243dbe86ef 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -76,4 +76,8 @@ resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no ```release-note:breaking-change resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported +``` + +```release-note:breaking-change +resource/aws_security_group: With the retirement of EC2-Classic non-VPC security groups are no longer supported ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_security_group.go b/internal/service/ec2/vpc_security_group.go index 4f2bcf2202c0..c41a17e2e9d8 100644 --- a/internal/service/ec2/vpc_security_group.go +++ b/internal/service/ec2/vpc_security_group.go @@ -182,20 +182,20 @@ func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, me conn := meta.(*conns.AWSClient).EC2Conn() name := create.Name(d.Get("name").(string), d.Get("name_prefix").(string)) - input := &ec2.CreateSecurityGroupInput{ + inputC := &ec2.CreateSecurityGroupInput{ GroupName: aws.String(name), TagSpecifications: getTagSpecificationsIn(ctx, ec2.ResourceTypeSecurityGroup), } if v := d.Get("description"); v != nil { - input.Description = aws.String(v.(string)) + inputC.Description = aws.String(v.(string)) } if v, ok := d.GetOk("vpc_id"); ok { - input.VpcId = aws.String(v.(string)) + inputC.VpcId = aws.String(v.(string)) } - output, err := conn.CreateSecurityGroupWithContext(ctx, input) + output, err := conn.CreateSecurityGroupWithContext(ctx, inputC) if err != nil { return diag.Errorf("creating Security Group (%s): %s", name, err) @@ -204,57 +204,52 @@ func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, me d.SetId(aws.StringValue(output.GroupId)) // Wait for the security group to truly exist - group, err := WaitSecurityGroupCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)) - - if err != nil { + if _, err := WaitSecurityGroupCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return diag.Errorf("waiting for Security Group (%s) create: %s", d.Id(), err) } // AWS defaults all Security Groups to have an ALLOW ALL egress rule. // Here we revoke that rule, so users don't unknowingly have/use it. - // This will only be false for Security Groups in EC2-Classic - if aws.StringValue(group.VpcId) != "" { - input := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: aws.String(d.Id()), - IpPermissions: []*ec2.IpPermission{ - { - FromPort: aws.Int64(0), - ToPort: aws.Int64(0), - IpRanges: []*ec2.IpRange{ - { - CidrIp: aws.String("0.0.0.0/0"), - }, + inputR := &ec2.RevokeSecurityGroupEgressInput{ + GroupId: aws.String(d.Id()), + IpPermissions: []*ec2.IpPermission{ + { + FromPort: aws.Int64(0), + ToPort: aws.Int64(0), + IpRanges: []*ec2.IpRange{ + { + CidrIp: aws.String("0.0.0.0/0"), }, - IpProtocol: aws.String("-1"), }, + IpProtocol: aws.String("-1"), }, - } + }, + } - if _, err := conn.RevokeSecurityGroupEgressWithContext(ctx, input); err != nil { - return diag.Errorf("revoking default IPv4 egress rule for Security Group (%s): %s", d.Id(), err) - } + if _, err := conn.RevokeSecurityGroupEgressWithContext(ctx, inputR); err != nil { + return diag.Errorf("revoking default IPv4 egress rule for Security Group (%s): %s", d.Id(), err) + } - input = &ec2.RevokeSecurityGroupEgressInput{ - GroupId: aws.String(d.Id()), - IpPermissions: []*ec2.IpPermission{ - { - FromPort: aws.Int64(0), - ToPort: aws.Int64(0), - Ipv6Ranges: []*ec2.Ipv6Range{ - { - CidrIpv6: aws.String("::/0"), - }, + inputR = &ec2.RevokeSecurityGroupEgressInput{ + GroupId: aws.String(d.Id()), + IpPermissions: []*ec2.IpPermission{ + { + FromPort: aws.Int64(0), + ToPort: aws.Int64(0), + Ipv6Ranges: []*ec2.Ipv6Range{ + { + CidrIpv6: aws.String("::/0"), }, - IpProtocol: aws.String("-1"), }, + IpProtocol: aws.String("-1"), }, - } + }, + } - if _, err := conn.RevokeSecurityGroupEgressWithContext(ctx, input); err != nil { - // If we have a NotFound or InvalidParameterValue, then we are trying to remove the default IPv6 egress of a non-IPv6 enabled SG. - if !tfawserr.ErrCodeEquals(err, errCodeInvalidPermissionNotFound) && !tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "remote-ipv6-range") { - return diag.Errorf("revoking default IPv6 egress rule for Security Group (%s): %s", d.Id(), err) - } + if _, err := conn.RevokeSecurityGroupEgressWithContext(ctx, inputR); err != nil { + // If we have a NotFound or InvalidParameterValue, then we are trying to remove the default IPv6 egress of a non-IPv6 enabled SG. + if !tfawserr.ErrCodeEquals(err, errCodeInvalidPermissionNotFound) && !tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "remote-ipv6-range") { + return diag.Errorf("revoking default IPv6 egress rule for Security Group (%s): %s", d.Id(), err) } } @@ -330,13 +325,10 @@ func resourceSecurityGroupUpdate(ctx context.Context, d *schema.ResourceData, me return diag.Errorf("updating Security Group (%s) %s rules: %s", d.Id(), securityGroupRuleTypeIngress, err) } - // This will only be false for Security Groups in EC2-Classic - if d.Get("vpc_id") != nil { - err = updateSecurityGroupRules(ctx, conn, d, securityGroupRuleTypeEgress, group) + err = updateSecurityGroupRules(ctx, conn, d, securityGroupRuleTypeEgress, group) - if err != nil { - return diag.Errorf("updating Security Group (%s) %s rules: %s", d.Id(), securityGroupRuleTypeEgress, err) - } + if err != nil { + return diag.Errorf("updating Security Group (%s) %s rules: %s", d.Id(), securityGroupRuleTypeEgress, err) } return resourceSecurityGroupRead(ctx, d, meta) @@ -759,8 +751,6 @@ func updateSecurityGroupRules(ctx context.Context, conn *ec2.EC2, d *schema.Reso // adding is easier here, and Terraform should be fast enough to // not have service issues. - isVPC := aws.StringValue(group.VpcId) != "" - if len(del) > 0 { if ruleType == securityGroupRuleTypeEgress { input := &ec2.RevokeSecurityGroupEgressInput{ @@ -771,15 +761,10 @@ func updateSecurityGroupRules(ctx context.Context, conn *ec2.EC2, d *schema.Reso _, err = conn.RevokeSecurityGroupEgressWithContext(ctx, input) } else { input := &ec2.RevokeSecurityGroupIngressInput{ + GroupId: group.GroupId, IpPermissions: del, } - if isVPC { - input.GroupId = group.GroupId - } else { - input.GroupName = group.GroupName - } - _, err = conn.RevokeSecurityGroupIngressWithContext(ctx, input) } @@ -798,15 +783,10 @@ func updateSecurityGroupRules(ctx context.Context, conn *ec2.EC2, d *schema.Reso _, err = conn.AuthorizeSecurityGroupEgressWithContext(ctx, input) } else { input := &ec2.AuthorizeSecurityGroupIngressInput{ + GroupId: group.GroupId, IpPermissions: add, } - if isVPC { - input.GroupId = group.GroupId - } else { - input.GroupName = group.GroupName - } - _, err = conn.AuthorizeSecurityGroupIngressWithContext(ctx, input) } @@ -823,7 +803,6 @@ func updateSecurityGroupRules(ctx context.Context, conn *ec2.EC2, d *schema.Reso // if it finds invalid permissions input, namely a protocol of "-1" with either // to_port or from_port set to a non-zero value. func ExpandIPPerms(group *ec2.SecurityGroup, configured []interface{}) ([]*ec2.IpPermission, error) { - vpc := aws.StringValue(group.VpcId) != "" perms := make([]*ec2.IpPermission, len(configured)) for i, mRaw := range configured { @@ -854,11 +833,7 @@ func ExpandIPPerms(group *ec2.SecurityGroup, configured []interface{}) ([]*ec2.I } } if v, ok := m["self"]; ok && v.(bool) { - if vpc { - groups = append(groups, *group.GroupId) - } else { - groups = append(groups, *group.GroupName) - } + groups = append(groups, aws.StringValue(group.GroupId)) } if len(groups) > 0 { @@ -876,11 +851,6 @@ func ExpandIPPerms(group *ec2.SecurityGroup, configured []interface{}) ([]*ec2.I if ownerId != "" { perm.UserIdGroupPairs[i].UserId = aws.String(ownerId) } - - if !vpc { - perm.UserIdGroupPairs[i].GroupId = nil - perm.UserIdGroupPairs[i].GroupName = aws.String(id) - } } } @@ -942,41 +912,25 @@ type GroupIdentifier struct { // Flattens an array of UserSecurityGroups into a []*GroupIdentifier func FlattenSecurityGroups(list []*ec2.UserIdGroupPair, ownerId *string) []*GroupIdentifier { result := make([]*GroupIdentifier, 0, len(list)) + for _, g := range list { - var userId *string + var userID string if aws.StringValue(g.UserId) != "" && (ownerId == nil || aws.StringValue(ownerId) != aws.StringValue(g.UserId)) { - userId = g.UserId + userID = aws.StringValue(g.UserId) } // userid nil here for same vpc groups - vpc := aws.StringValue(g.GroupName) == "" - var id *string - if vpc { - id = g.GroupId - } else { - id = g.GroupName + id := aws.StringValue(g.GroupId) + if userID != "" { + id = userID + "/" + id } - // id is groupid for vpcs - // id is groupname for non vpc (classic) - - if userId != nil { - id = aws.String(*userId + "/" + *id) - } - - if vpc { - result = append(result, &GroupIdentifier{ - GroupId: id, - Description: g.Description, - }) - } else { - result = append(result, &GroupIdentifier{ - GroupId: g.GroupId, - GroupName: id, - Description: g.Description, - }) - } + result = append(result, &GroupIdentifier{ + GroupId: aws.String(id), + Description: g.Description, + }) } + return result } diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index 1f4bca2b47b2..efde81ef986e 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -915,8 +915,6 @@ func TestFlattenSecurityGroups(t *testing.T) { }, }, }, - // include the owner id, but keep it consitent with the same account. Tests - // EC2 classic situation { ownerId: aws.String("user1234"), pairs: []*ec2.UserIdGroupPair{ @@ -931,28 +929,6 @@ func TestFlattenSecurityGroups(t *testing.T) { }, }, }, - - // include the owner id, but from a different account. This is reflects - // EC2 Classic when referring to groups by name - { - ownerId: aws.String("user1234"), - pairs: []*ec2.UserIdGroupPair{ - { - GroupId: aws.String("sg-12345"), - GroupName: aws.String("somegroup"), // GroupName is only included in Classic - UserId: aws.String("user4321"), - }, - }, - expected: []*tfec2.GroupIdentifier{ - { - GroupId: aws.String("sg-12345"), - GroupName: aws.String("user4321/somegroup"), - }, - }, - }, - - // include the owner id, but from a different account. This reflects in - // EC2 VPC when referring to groups by id { ownerId: aws.String("user1234"), pairs: []*ec2.UserIdGroupPair{ From 04f4a702553fedae5b170792a849975a7ac945ba Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 12:24:28 -0400 Subject: [PATCH 104/304] r/aws_security_group_rule: Remove support for non-VPC security groups. --- .changelog/30966.txt | 4 + .../service/ec2/vpc_security_group_rule.go | 128 ++++++------------ 2 files changed, 42 insertions(+), 90 deletions(-) diff --git a/.changelog/30966.txt b/.changelog/30966.txt index e6243dbe86ef..fd9cdecf2fe2 100644 --- a/.changelog/30966.txt +++ b/.changelog/30966.txt @@ -80,4 +80,8 @@ resource/aws_eip_association: With the retirement of EC2-Classic the `standard` ```release-note:breaking-change resource/aws_security_group: With the retirement of EC2-Classic non-VPC security groups are no longer supported +``` + +```release-note:breaking-change +resource/aws_security_group_rule: With the retirement of EC2-Classic non-VPC security groups are no longer supported ``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_security_group_rule.go b/internal/service/ec2/vpc_security_group_rule.go index 99d8c207b1a8..bdd14abe4bc4 100644 --- a/internal/service/ec2/vpc_security_group_rule.go +++ b/internal/service/ec2/vpc_security_group_rule.go @@ -163,22 +163,16 @@ func resourceSecurityGroupRuleCreate(ctx context.Context, d *schema.ResourceData ipPermission := expandIPPermission(d, sg) ruleType := d.Get("type").(string) - isVPC := aws.StringValue(sg.VpcId) != "" id := SecurityGroupRuleCreateID(securityGroupID, ruleType, ipPermission) switch ruleType { case securityGroupRuleTypeIngress: input := &ec2.AuthorizeSecurityGroupIngressInput{ + GroupId: sg.GroupId, IpPermissions: []*ec2.IpPermission{ipPermission}, } var output *ec2.AuthorizeSecurityGroupIngressOutput - if isVPC { - input.GroupId = sg.GroupId - } else { - input.GroupName = sg.GroupName - } - output, err = conn.AuthorizeSecurityGroupIngressWithContext(ctx, input) if err == nil { @@ -234,7 +228,7 @@ information and instructions for recovery. Error: %s`, securityGroupID, err) rules = sg.IpPermissionsEgress } - rule, _ := findRuleMatch(ipPermission, rules, isVPC) + rule, _ := findRuleMatch(ipPermission, rules) if rule == nil { return nil, &retry.NotFoundError{} @@ -270,7 +264,6 @@ func resourceSecurityGroupRuleRead(ctx context.Context, d *schema.ResourceData, } ipPermission := expandIPPermission(d, sg) - isVPC := aws.StringValue(sg.VpcId) != "" var rules []*ec2.IpPermission @@ -280,7 +273,7 @@ func resourceSecurityGroupRuleRead(ctx context.Context, d *schema.ResourceData, rules = sg.IpPermissionsEgress } - rule, description := findRuleMatch(ipPermission, rules, isVPC) + rule, description := findRuleMatch(ipPermission, rules) if rule == nil { if !d.IsNewResource() { @@ -293,7 +286,7 @@ func resourceSecurityGroupRuleRead(ctx context.Context, d *schema.ResourceData, return diag.Errorf("reading Security Group (%s) Rule (%s): %s", securityGroupID, d.Id(), &retry.NotFoundError{}) } - flattenIpPermission(d, ipPermission, isVPC) + flattenIpPermission(d, ipPermission) d.Set("description", description) d.Set("type", ruleType) @@ -303,17 +296,15 @@ func resourceSecurityGroupRuleRead(ctx context.Context, d *schema.ResourceData, d.SetId(id) } - if isVPC { - // Attempt to find the single matching AWS Security Group Rule resource ID. - securityGroupRules, err := FindSecurityGroupRulesBySecurityGroupID(ctx, conn, securityGroupID) + // Attempt to find the single matching AWS Security Group Rule resource ID. + securityGroupRules, err := FindSecurityGroupRulesBySecurityGroupID(ctx, conn, securityGroupID) - if err != nil { - return diag.Errorf("reading Security Group (%s) Rules: %s", securityGroupID, err) - } - - d.Set("security_group_rule_id", findSecurityGroupRuleMatch(ipPermission, securityGroupRules, ruleType)) + if err != nil { + return diag.Errorf("reading Security Group (%s) Rules: %s", securityGroupID, err) } + d.Set("security_group_rule_id", findSecurityGroupRuleMatch(ipPermission, securityGroupRules, ruleType)) + return nil } @@ -334,20 +325,14 @@ func resourceSecurityGroupRuleUpdate(ctx context.Context, d *schema.ResourceData ipPermission := expandIPPermission(d, sg) ruleType := d.Get("type").(string) - isVPC := aws.StringValue(sg.VpcId) != "" switch ruleType { case securityGroupRuleTypeIngress: input := &ec2.UpdateSecurityGroupRuleDescriptionsIngressInput{ + GroupId: sg.GroupId, IpPermissions: []*ec2.IpPermission{ipPermission}, } - if isVPC { - input.GroupId = sg.GroupId - } else { - input.GroupName = sg.GroupName - } - _, err = conn.UpdateSecurityGroupRuleDescriptionsIngressWithContext(ctx, input) case securityGroupRuleTypeEgress: @@ -382,20 +367,14 @@ func resourceSecurityGroupRuleDelete(ctx context.Context, d *schema.ResourceData ipPermission := expandIPPermission(d, sg) ruleType := d.Get("type").(string) - isVPC := aws.StringValue(sg.VpcId) != "" switch ruleType { case securityGroupRuleTypeIngress: input := &ec2.RevokeSecurityGroupIngressInput{ + GroupId: sg.GroupId, IpPermissions: []*ec2.IpPermission{ipPermission}, } - if isVPC { - input.GroupId = sg.GroupId - } else { - input.GroupName = sg.GroupName - } - _, err = conn.RevokeSecurityGroupIngressWithContext(ctx, input) case securityGroupRuleTypeEgress: @@ -515,7 +494,7 @@ func resourceSecurityGroupRuleImport(_ context.Context, d *schema.ResourceData, return []*schema.ResourceData{d}, nil } -func findRuleMatch(p *ec2.IpPermission, rules []*ec2.IpPermission, isVPC bool) (*ec2.IpPermission, string) { +func findRuleMatch(p *ec2.IpPermission, rules []*ec2.IpPermission) (*ec2.IpPermission, string) { var rule *ec2.IpPermission var description string @@ -595,27 +574,14 @@ func findRuleMatch(p *ec2.IpPermission, rules []*ec2.IpPermission, isVPC bool) ( remaining = len(p.UserIdGroupPairs) for _, v1 := range p.UserIdGroupPairs { for _, v2 := range r.UserIdGroupPairs { - if isVPC { - if v1.GroupId == nil || v2.GroupId == nil { - continue - } - if aws.StringValue(v1.GroupId) == aws.StringValue(v2.GroupId) { - remaining-- - - if v := aws.StringValue(v2.Description); v != "" && description == "" { - description = v - } - } - } else { - if v1.GroupName == nil || v2.GroupName == nil { - continue - } - if aws.StringValue(v1.GroupName) == aws.StringValue(v2.GroupName) { - remaining-- + if v1.GroupId == nil || v2.GroupId == nil { + continue + } + if aws.StringValue(v1.GroupId) == aws.StringValue(v2.GroupId) { + remaining-- - if v := aws.StringValue(v2.Description); v != "" && description == "" { - description = v - } + if v := aws.StringValue(v2.Description); v != "" && description == "" { + description = v } } } @@ -808,39 +774,25 @@ func expandIPPermission(d *schema.ResourceData, sg *ec2.SecurityGroup) *ec2.IpPe } var self string - vpc := aws.StringValue(sg.VpcId) != "" if _, ok := d.GetOk("self"); ok { - if vpc { - self = aws.StringValue(sg.GroupId) - apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ - GroupId: aws.String(self), - }) - } else { - self = aws.StringValue(sg.GroupName) - apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ - GroupName: aws.String(self), - }) - } + self = aws.StringValue(sg.GroupId) + apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ + GroupId: aws.String(self), + }) } if v, ok := d.GetOk("source_security_group_id"); ok { if v := v.(string); v != self { - if vpc { - // [OwnerID/]SecurityGroupID. - if parts := strings.Split(v, "/"); len(parts) == 1 { - apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ - GroupId: aws.String(v), - }) - } else { - apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ - GroupId: aws.String(parts[1]), - UserId: aws.String(parts[0]), - }) - } + // [OwnerID/]SecurityGroupID. + if parts := strings.Split(v, "/"); len(parts) == 1 { + apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ + GroupId: aws.String(v), + }) } else { apiObject.UserIdGroupPairs = append(apiObject.UserIdGroupPairs, &ec2.UserIdGroupPair{ - GroupName: aws.String(v), + GroupId: aws.String(parts[1]), + UserId: aws.String(parts[0]), }) } } @@ -869,7 +821,7 @@ func expandIPPermission(d *schema.ResourceData, sg *ec2.SecurityGroup) *ec2.IpPe return apiObject } -func flattenIpPermission(d *schema.ResourceData, apiObject *ec2.IpPermission, isVPC bool) { // nosemgrep:ci.caps5-in-func-name +func flattenIpPermission(d *schema.ResourceData, apiObject *ec2.IpPermission) { // nosemgrep:ci.caps5-in-func-name if apiObject == nil { return } @@ -911,17 +863,13 @@ func flattenIpPermission(d *schema.ResourceData, apiObject *ec2.IpPermission, is if v := apiObject.UserIdGroupPairs; len(v) > 0 { v := v[0] - if isVPC { - if old, ok := d.GetOk("source_security_group_id"); ok { - // [OwnerID/]SecurityGroupID. - if parts := strings.Split(old.(string), "/"); len(parts) == 1 || aws.StringValue(v.UserId) == "" { - d.Set("source_security_group_id", v.GroupId) - } else { - d.Set("source_security_group_id", strings.Join([]string{aws.StringValue(v.UserId), aws.StringValue(v.GroupId)}, "/")) - } + if old, ok := d.GetOk("source_security_group_id"); ok { + // [OwnerID/]SecurityGroupID. + if parts := strings.Split(old.(string), "/"); len(parts) == 1 || aws.StringValue(v.UserId) == "" { + d.Set("source_security_group_id", v.GroupId) + } else { + d.Set("source_security_group_id", strings.Join([]string{aws.StringValue(v.UserId), aws.StringValue(v.GroupId)}, "/")) } - } else { - d.Set("source_security_group_id", v.GroupName) } } } From ea9eb1d9dad091ef0415789bd99d41169a883af4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 12:28:38 -0400 Subject: [PATCH 105/304] Remove 'TestExpandIPPerms_nonVPC'. --- .../service/ec2/vpc_security_group_test.go | 100 ------------------ 1 file changed, 100 deletions(-) diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index efde81ef986e..bd41547e1394 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -793,106 +793,6 @@ func TestExpandIPPerms_AllProtocol(t *testing.T) { } } -func TestExpandIPPerms_nonVPC(t *testing.T) { - t.Parallel() - - hash := schema.HashString - - expanded := []interface{}{ - map[string]interface{}{ - "protocol": "icmp", - "from_port": 1, - "to_port": -1, - "cidr_blocks": []interface{}{"0.0.0.0/0"}, - "security_groups": schema.NewSet(hash, []interface{}{ - "sg-11111", - "foo/sg-22222", - }), - }, - map[string]interface{}{ - "protocol": "icmp", - "from_port": 1, - "to_port": -1, - "self": true, - }, - } - group := &ec2.SecurityGroup{ - GroupName: aws.String("foo"), - } - perms, err := tfec2.ExpandIPPerms(group, expanded) - if err != nil { - t.Fatalf("error expanding perms: %v", err) - } - - expected := []ec2.IpPermission{ - { - IpProtocol: aws.String("icmp"), - FromPort: aws.Int64(1), - ToPort: aws.Int64(int64(-1)), - IpRanges: []*ec2.IpRange{{CidrIp: aws.String("0.0.0.0/0")}}, - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { - GroupName: aws.String("sg-22222"), - }, - { - GroupName: aws.String("sg-11111"), - }, - }, - }, - { - IpProtocol: aws.String("icmp"), - FromPort: aws.Int64(1), - ToPort: aws.Int64(int64(-1)), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { - GroupName: aws.String("foo"), - }, - }, - }, - } - - exp := expected[0] - perm := perms[0] - - if aws.Int64Value(exp.FromPort) != aws.Int64Value(perm.FromPort) { - t.Fatalf( - "Got:\n\n%#v\n\nExpected:\n\n%#v\n", - aws.Int64Value(perm.FromPort), - aws.Int64Value(exp.FromPort)) - } - - if aws.StringValue(exp.IpRanges[0].CidrIp) != aws.StringValue(perm.IpRanges[0].CidrIp) { - t.Fatalf( - "Got:\n\n%#v\n\nExpected:\n\n%#v\n", - aws.StringValue(perm.IpRanges[0].CidrIp), - aws.StringValue(exp.IpRanges[0].CidrIp)) - } - - if aws.StringValue(exp.UserIdGroupPairs[0].GroupName) != aws.StringValue(perm.UserIdGroupPairs[0].GroupName) { - t.Fatalf( - "Got:\n\n%#v\n\nExpected:\n\n%#v\n", - aws.StringValue(perm.UserIdGroupPairs[0].GroupName), - aws.StringValue(exp.UserIdGroupPairs[0].GroupName)) - } - - if aws.StringValue(exp.UserIdGroupPairs[1].GroupName) != aws.StringValue(perm.UserIdGroupPairs[1].GroupName) { - t.Fatalf( - "Got:\n\n%#v\n\nExpected:\n\n%#v\n", - aws.StringValue(perm.UserIdGroupPairs[1].GroupName), - aws.StringValue(exp.UserIdGroupPairs[1].GroupName)) - } - - exp = expected[1] - perm = perms[1] - - if aws.StringValue(exp.UserIdGroupPairs[0].GroupName) != aws.StringValue(perm.UserIdGroupPairs[0].GroupName) { - t.Fatalf( - "Got:\n\n%#v\n\nExpected:\n\n%#v\n", - aws.StringValue(perm.UserIdGroupPairs[0].GroupName), - aws.StringValue(exp.UserIdGroupPairs[0].GroupName)) - } -} - func TestFlattenSecurityGroups(t *testing.T) { t.Parallel() From acc0171afe76303620a7a57c87fca78f63a61000 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 14:02:12 -0400 Subject: [PATCH 106/304] r/aws_elastic_beanstalk_environment: Remove support for non-VPC security groups. --- .../service/elasticbeanstalk/environment.go | 51 +++++-------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/internal/service/elasticbeanstalk/environment.go b/internal/service/elasticbeanstalk/environment.go index 3018b701aeba..5079f51a9872 100644 --- a/internal/service/elasticbeanstalk/environment.go +++ b/internal/service/elasticbeanstalk/environment.go @@ -23,6 +23,7 @@ import ( // nosemgrep:ci.aws-sdk-go-multiple-service-imports "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" "github.com/hashicorp/terraform-provider-aws/internal/sdktypes" + tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -391,14 +392,14 @@ func resourceEnvironmentRead(ctx context.Context, d *schema.ResourceData, meta i m["resource"] = aws.StringValue(optionSetting.ResourceName) } - if optionSetting.Value != nil { + if value := aws.StringValue(optionSetting.Value); value != "" { switch aws.StringValue(optionSetting.OptionName) { case "SecurityGroups": - m["value"] = dropGeneratedSecurityGroup(ctx, aws.StringValue(optionSetting.Value), meta) + m["value"] = dropGeneratedSecurityGroup(ctx, meta.(*conns.AWSClient).EC2Conn(), value) case "Subnets", "ELBSubnets": - m["value"] = sortValues(aws.StringValue(optionSetting.Value)) + m["value"] = sortValues(value) default: - m["value"] = aws.StringValue(optionSetting.Value) + m["value"] = value } } @@ -825,49 +826,21 @@ func extractOptionSettings(s *schema.Set) []*elasticbeanstalk.ConfigurationOptio return settings } -func dropGeneratedSecurityGroup(ctx context.Context, settingValue string, meta interface{}) string { - conn := meta.(*conns.AWSClient).EC2Conn() - - groups := strings.Split(settingValue, ",") - - // Check to see if groups are ec2-classic or vpc security groups - ec2Classic := true - beanstalkSGRegexp := regexp.MustCompile("sg-[0-9a-fA-F]{8}") - for _, g := range groups { - if beanstalkSGRegexp.MatchString(g) { - ec2Classic = false - break - } +func dropGeneratedSecurityGroup(ctx context.Context, conn *ec2.EC2, settingValue string) string { + input := &ec2.DescribeSecurityGroupsInput{ + GroupIds: aws.StringSlice(strings.Split(settingValue, ",")), } - var resp *ec2.DescribeSecurityGroupsOutput - var err error - - if ec2Classic { - resp, err = conn.DescribeSecurityGroupsWithContext(ctx, &ec2.DescribeSecurityGroupsInput{ - GroupNames: aws.StringSlice(groups), - }) - } else { - resp, err = conn.DescribeSecurityGroupsWithContext(ctx, &ec2.DescribeSecurityGroupsInput{ - GroupIds: aws.StringSlice(groups), - }) - } + securityGroup, err := tfec2.FindSecurityGroups(ctx, conn, input) if err != nil { - log.Printf("[DEBUG] Elastic Beanstalk error describing SecurityGroups: %v", err) return settingValue } - log.Printf("[DEBUG] Elastic Beanstalk using ec2-classic security-groups: %t", ec2Classic) var legitGroups []string - for _, group := range resp.SecurityGroups { - log.Printf("[DEBUG] Elastic Beanstalk SecurityGroup: %v", *group.GroupName) - if !strings.HasPrefix(*group.GroupName, "awseb") { - if ec2Classic { - legitGroups = append(legitGroups, *group.GroupName) - } else { - legitGroups = append(legitGroups, *group.GroupId) - } + for _, group := range securityGroup { + if !strings.HasPrefix(aws.StringValue(group.GroupName), "awseb") { + legitGroups = append(legitGroups, aws.StringValue(group.GroupId)) } } From 307a934ebd643673a4a03ce6fd94da301cfae7cf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 14:49:11 -0400 Subject: [PATCH 107/304] Tweak documentation for 'aws_autoscaling_group.availability_zones'. --- website/docs/r/autoscaling_group.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/autoscaling_group.html.markdown b/website/docs/r/autoscaling_group.html.markdown index 7291e77a0954..dd356c295b44 100644 --- a/website/docs/r/autoscaling_group.html.markdown +++ b/website/docs/r/autoscaling_group.html.markdown @@ -383,7 +383,7 @@ The following arguments are supported: * `max_size` - (Required) Maximum size of the Auto Scaling Group. * `min_size` - (Required) Minimum size of the Auto Scaling Group. (See also [Waiting for Capacity](#waiting-for-capacity) below.) -* `availability_zones` - (Optional) List of one or more availability zones for the group. Used for EC2-Classic, attaching a network interface via id from a launch template and default subnets when not specified with `vpc_zone_identifier` argument. Conflicts with `vpc_zone_identifier`. +* `availability_zones` - (Optional) A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the `vpc_zone_identifier` attribute, or for attaching a network interface when an existing network interface ID is specified in a launch template. Conflicts with `vpc_zone_identifier`. * `capacity_rebalance` - (Optional) Whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. * `context` - (Optional) Reserved. * `default_cooldown` - (Optional) Amount of time, in seconds, after a scaling activity completes before another scaling activity can start. From 86b393afcd497b500d7d84cd100dfb45e887aa57 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 15:34:59 -0400 Subject: [PATCH 108/304] d/aws_redshift_service_account: Deprecation notice. --- .changelog/#####.txt | 3 + .../redshift/service_account_data_source.go | 2 + .../service_account_data_source_test.go | 66 ------------------- .../d/redshift_service_account.html.markdown | 2 +- 4 files changed, 6 insertions(+), 67 deletions(-) create mode 100644 .changelog/#####.txt delete mode 100644 internal/service/redshift/service_account_data_source_test.go diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..694bab7f76c7 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy +``` \ No newline at end of file diff --git a/internal/service/redshift/service_account_data_source.go b/internal/service/redshift/service_account_data_source.go index 0874f396d7ad..28cc354fbf0e 100644 --- a/internal/service/redshift/service_account_data_source.go +++ b/internal/service/redshift/service_account_data_source.go @@ -59,6 +59,8 @@ func DataSourceServiceAccount() *schema.Resource { Computed: true, }, }, + + DeprecationMessage: `The aws_redshift_service_account data source has been deprecated and will be removed in a future version. Use a service principal name instead of AWS account ID in any relevant IAM policy.`, } } diff --git a/internal/service/redshift/service_account_data_source_test.go b/internal/service/redshift/service_account_data_source_test.go deleted file mode 100644 index b19e8e64fa18..000000000000 --- a/internal/service/redshift/service_account_data_source_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package redshift_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" -) - -func TestAccRedshiftServiceAccountDataSource_basic(t *testing.T) { - ctx := acctest.Context(t) - expectedAccountID := tfredshift.ServiceAccountPerRegionMap[acctest.Region()] - - dataSourceName := "data.aws_redshift_service_account.main" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccServiceAccountDataSourceConfig_basic, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "id", expectedAccountID), - acctest.CheckResourceAttrGlobalARNAccountID(dataSourceName, "arn", expectedAccountID, "iam", "user/logs"), - ), - }, - }, - }) -} - -func TestAccRedshiftServiceAccountDataSource_region(t *testing.T) { - ctx := acctest.Context(t) - expectedAccountID := tfredshift.ServiceAccountPerRegionMap[acctest.Region()] - - dataSourceName := "data.aws_redshift_service_account.regional" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccServiceAccountDataSourceConfig_explicitRegion, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "id", expectedAccountID), - acctest.CheckResourceAttrGlobalARNAccountID(dataSourceName, "arn", expectedAccountID, "iam", "user/logs"), - ), - }, - }, - }) -} - -const testAccServiceAccountDataSourceConfig_basic = ` -data "aws_redshift_service_account" "main" {} -` - -const testAccServiceAccountDataSourceConfig_explicitRegion = ` -data "aws_region" "current" {} - -data "aws_redshift_service_account" "regional" { - region = data.aws_region.current.name -} -` diff --git a/website/docs/d/redshift_service_account.html.markdown b/website/docs/d/redshift_service_account.html.markdown index 0fa5cf44556c..02c009f7ef99 100644 --- a/website/docs/d/redshift_service_account.html.markdown +++ b/website/docs/d/redshift_service_account.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the Account ID of the [AWS Redshift Service Account] in a given region for the purpose of allowing Redshift to store audit data in S3. ~> **Note:** AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy. -The `aws_redshift_service_account` data source should now be considered deprecated and will be removed in a future version. +The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. ## Example Usage From 4a26408e6960dfafce824f2c212e16c2e115ffa3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 15:44:50 -0400 Subject: [PATCH 109/304] d/aws_redshift_service_account: Remove from acceptance test configurations. --- internal/service/redshift/cluster_data_source_test.go | 10 ++++------ internal/service/redshift/cluster_test.go | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/internal/service/redshift/cluster_data_source_test.go b/internal/service/redshift/cluster_data_source_test.go index da798fcebb6f..bb0cacb9e592 100644 --- a/internal/service/redshift/cluster_data_source_test.go +++ b/internal/service/redshift/cluster_data_source_test.go @@ -180,8 +180,6 @@ data "aws_redshift_cluster" "test" { func testAccClusterDataSourceConfig_logging(rName string) string { return fmt.Sprintf(` -data "aws_redshift_service_account" "test" {} - resource "aws_s3_bucket" "test" { bucket = %[1]q force_destroy = true @@ -193,8 +191,8 @@ data "aws_iam_policy_document" "test" { resources = ["${aws_s3_bucket.test.arn}/*"] principals { - identifiers = [data.aws_redshift_service_account.test.arn] - type = "AWS" + type = "Service" + identifiers = ["redshift.amazonaws.com"] } } @@ -203,8 +201,8 @@ data "aws_iam_policy_document" "test" { resources = [aws_s3_bucket.test.arn] principals { - identifiers = [data.aws_redshift_service_account.test.arn] - type = "AWS" + type = "Service" + identifiers = ["redshift.amazonaws.com"] } } } diff --git a/internal/service/redshift/cluster_test.go b/internal/service/redshift/cluster_test.go index c0519fd95916..4064c406e38b 100644 --- a/internal/service/redshift/cluster_test.go +++ b/internal/service/redshift/cluster_test.go @@ -1198,8 +1198,6 @@ func testAccClusterConfig_loggingEnabled(rName string) string { return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptInExclude("usw2-az2"), fmt.Sprintf(` data "aws_partition" "current" {} -data "aws_redshift_service_account" "main" {} - resource "aws_s3_bucket" "test" { bucket = %[1]q force_destroy = true @@ -1215,7 +1213,7 @@ resource "aws_s3_bucket_policy" "test" { "Sid": "Stmt1376526643067", "Effect": "Allow", "Principal": { - "AWS": "${data.aws_redshift_service_account.main.arn}" + "Service": "redshift.${data.aws_partition.current.dns_suffix}" }, "Action": "s3:PutObject", "Resource": "arn:${data.aws_partition.current.partition}:s3:::%[1]s/*" @@ -1224,7 +1222,7 @@ resource "aws_s3_bucket_policy" "test" { "Sid": "Stmt137652664067", "Effect": "Allow", "Principal": { - "AWS": "${data.aws_redshift_service_account.main.arn}" + "Service": "redshift.${data.aws_partition.current.dns_suffix}" }, "Action": "s3:GetBucketAcl", "Resource": "arn:${data.aws_partition.current.partition}:s3:::%[1]s" From 68c6c124e142ff5b6b7ebc17b22422107e5995a9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 16:12:47 -0400 Subject: [PATCH 110/304] Correct name for CHANGELOG entry file. --- .changelog/{#####.txt => 31006.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31006.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31006.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31006.txt From 6c385fff13b4f222fc3c14ae71d2b8e122061bdb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 16:48:40 -0400 Subject: [PATCH 111/304] r/aws_macie_member_account_association: Rebrand to 'Macie Classic'. --- .../macie/member_account_association.go | 95 ++++++++++++------- .../macie/member_account_association_test.go | 78 ++++++--------- ...e_member_account_association.html.markdown | 8 +- 3 files changed, 92 insertions(+), 89 deletions(-) diff --git a/internal/service/macie/member_account_association.go b/internal/service/macie/member_account_association.go index f85e1b5e76c9..381d3e1b4a51 100644 --- a/internal/service/macie/member_account_association.go +++ b/internal/service/macie/member_account_association.go @@ -8,9 +8,11 @@ import ( "github.com/aws/aws-sdk-go/service/macie" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -36,18 +38,19 @@ func resourceMemberAccountAssociationCreate(ctx context.Context, d *schema.Resou var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - memberAccountId := d.Get("member_account_id").(string) - req := &macie.AssociateMemberAccountInput{ - MemberAccountId: aws.String(memberAccountId), + memberAccountID := d.Get("member_account_id").(string) + input := &macie.AssociateMemberAccountInput{ + MemberAccountId: aws.String(memberAccountID), } - log.Printf("[DEBUG] Creating Macie member account association: %#v", req) - _, err := conn.AssociateMemberAccountWithContext(ctx, req) + _, err := conn.AssociateMemberAccountWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "creating Macie member account association: %s", err) + return sdkdiag.AppendErrorf(diags, "creating Macie Classic Member Account Association (%s): %s", memberAccountID, err) } - d.SetId(memberAccountId) + d.SetId(memberAccountID) + return append(diags, resourceMemberAccountAssociationRead(ctx, d, meta)...) } @@ -55,28 +58,19 @@ func resourceMemberAccountAssociationRead(ctx context.Context, d *schema.Resourc var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - req := &macie.ListMemberAccountsInput{} + memberAccount, err := FindMemberAccountByID(ctx, conn, d.Id()) - var res *macie.MemberAccount - err := conn.ListMemberAccountsPagesWithContext(ctx, req, func(page *macie.ListMemberAccountsOutput, lastPage bool) bool { - for _, v := range page.MemberAccounts { - if aws.StringValue(v.AccountId) == d.Get("member_account_id").(string) { - res = v - return false - } - } + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Macie Classic Member Account Association (%s) not found, removing from state", d.Id()) + d.SetId("") + return diags + } - return true - }) if err != nil { - return sdkdiag.AppendErrorf(diags, "listing Macie member account associations: %s", err) + return diag.Errorf("reading Macie Classic Member Account Association (%s): %s", d.Id(), err) } - if res == nil { - log.Printf("[WARN] Macie member account association (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags - } + d.Set("member_account_id", memberAccount.AccountId) return diags } @@ -85,21 +79,52 @@ func resourceMemberAccountAssociationDelete(ctx context.Context, d *schema.Resou var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - log.Printf("[DEBUG] Deleting Macie member account association: %s", d.Id()) - + log.Printf("[DEBUG] Deleting Macie Classic Member Account Association: %s", d.Id()) _, err := conn.DisassociateMemberAccountWithContext(ctx, &macie.DisassociateMemberAccountInput{ - MemberAccountId: aws.String(d.Get("member_account_id").(string)), + MemberAccountId: aws.String(d.Id()), }) + + if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is a master Macie account and cannot be disassociated") { + return diags + } + + if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is not yet associated with Macie") { + return diags + } + if err != nil { - if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is a master Macie account and cannot be disassociated") { - log.Printf("[INFO] Macie master account (%s) cannot be disassociated, removing from state", d.Id()) - return diags - } else if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is not yet associated with Macie") { - return diags - } else { - return sdkdiag.AppendErrorf(diags, "deleting Macie member account association: %s", err) - } + return sdkdiag.AppendErrorf(diags, "deleting Macie Classic Member Account Association (%s): %s", d.Id(), err) } return diags } + +func FindMemberAccountByID(ctx context.Context, conn *macie.Macie, id string) (*macie.MemberAccount, error) { + input := &macie.ListMemberAccountsInput{} + var output *macie.MemberAccount + + err := conn.ListMemberAccountsPagesWithContext(ctx, input, func(page *macie.ListMemberAccountsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.MemberAccounts { + if v != nil && aws.StringValue(v.AccountId) == id { + output = v + return false + } + } + + return !lastPage + }) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, &retry.NotFoundError{} + } + + return output, nil +} diff --git a/internal/service/macie/member_account_association_test.go b/internal/service/macie/member_account_association_test.go index 07c12f5611ea..9da2302ed2e8 100644 --- a/internal/service/macie/member_account_association_test.go +++ b/internal/service/macie/member_account_association_test.go @@ -6,21 +6,23 @@ import ( "os" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfmacie "github.com/hashicorp/terraform-provider-aws/internal/service/macie" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { ctx := acctest.Context(t) key := "MACIE_MEMBER_ACCOUNT_ID" - memberAcctId := os.Getenv(key) - if memberAcctId == "" { + memberAccountID := os.Getenv(key) + if memberAccountID == "" { t.Skipf("Environment variable %s is not set", key) } + resourceName := "aws_macie_member_account_association.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, @@ -29,9 +31,9 @@ func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { CheckDestroy: testAccCheckMemberAccountAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccMemberAccountAssociationConfig_basic(memberAcctId), + Config: testAccMemberAccountAssociationConfig_basic(memberAccountID), Check: resource.ComposeTestCheckFunc( - testAccCheckMemberAccountAssociationExists(ctx, "aws_macie_member_account_association.test"), + testAccCheckMemberAccountAssociationExists(ctx, resourceName), ), }, }, @@ -40,17 +42,18 @@ func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { func TestAccMacieMemberAccountAssociation_self(t *testing.T) { ctx := acctest.Context(t) + resourceName := "aws_macie_member_account_association.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // master account associated with Macie it can't be disassociated. - CheckDestroy: nil, + CheckDestroy: acctest.CheckDestroyNoop, Steps: []resource.TestStep{ { Config: testAccMemberAccountAssociationConfig_self, Check: resource.ComposeTestCheckFunc( - testAccCheckMemberAccountAssociationExists(ctx, "aws_macie_member_account_association.test"), + testAccCheckMemberAccountAssociationExists(ctx, resourceName), ), }, }, @@ -66,71 +69,48 @@ func testAccCheckMemberAccountAssociationDestroy(ctx context.Context) resource.T continue } - req := &macie.ListMemberAccountsInput{} + _, err := tfmacie.FindMemberAccountByID(ctx, conn, rs.Primary.ID) - dissociated := true - err := conn.ListMemberAccountsPagesWithContext(ctx, req, func(page *macie.ListMemberAccountsOutput, lastPage bool) bool { - for _, v := range page.MemberAccounts { - if aws.StringValue(v.AccountId) == rs.Primary.Attributes["member_account_id"] { - dissociated = false - return false - } - } + if tfresource.NotFound(err) { + continue + } - return true - }) if err != nil { return err } - if !dissociated { - return fmt.Errorf("Member account %s is not dissociated from Macie", rs.Primary.Attributes["member_account_id"]) - } + return fmt.Errorf("Macie Classic Member Account Association %s still exists", rs.Primary.ID) } + return nil } } -func testAccCheckMemberAccountAssociationExists(ctx context.Context, name string) resource.TestCheckFunc { +func testAccCheckMemberAccountAssociationExists(ctx context.Context, n string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - rs, ok := s.RootModule().Resources[name] + rs, ok := s.RootModule().Resources[n] if !ok { - return fmt.Errorf("Not found: %s", name) + return fmt.Errorf("Not found: %s", n) } - req := &macie.ListMemberAccountsInput{} - - exists := false - err := conn.ListMemberAccountsPagesWithContext(ctx, req, func(page *macie.ListMemberAccountsOutput, lastPage bool) bool { - for _, v := range page.MemberAccounts { - if aws.StringValue(v.AccountId) == rs.Primary.Attributes["member_account_id"] { - exists = true - return false - } - } - - return true - }) - if err != nil { - return err + if rs.Primary.ID == "" { + return fmt.Errorf("No Macie Classic Member Account Association ID is set") } - if !exists { - return fmt.Errorf("Member account %s is not associated with Macie", rs.Primary.Attributes["member_account_id"]) - } + conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - return nil + _, err := tfmacie.FindMemberAccountByID(ctx, conn, rs.Primary.ID) + + return err } } -func testAccMemberAccountAssociationConfig_basic(memberAcctId string) string { +func testAccMemberAccountAssociationConfig_basic(accountID string) string { return fmt.Sprintf(` resource "aws_macie_member_account_association" "test" { - member_account_id = "%s" + member_account_id = %[1]q } -`, memberAcctId) +`, accountID) } const testAccMemberAccountAssociationConfig_self = ` diff --git a/website/docs/r/macie_member_account_association.html.markdown b/website/docs/r/macie_member_account_association.html.markdown index b22b4ea39853..b4ef31a2ee3a 100644 --- a/website/docs/r/macie_member_account_association.html.markdown +++ b/website/docs/r/macie_member_account_association.html.markdown @@ -3,16 +3,14 @@ subcategory: "Macie Classic" layout: "aws" page_title: "AWS: aws_macie_member_account_association" description: |- - Associates an AWS account with Amazon Macie as a member account. + Associates an AWS account with Amazon Macie Classic as a member account. --- # Resource: aws_macie_member_account_association ~> **NOTE:** This resource interacts with [Amazon Macie Classic](https://docs.aws.amazon.com/macie/latest/userguide/what-is-macie.html). Macie Classic cannot be activated in new accounts. See the [FAQ](https://aws.amazon.com/macie/classic-faqs/) for more details. -Associates an AWS account with Amazon Macie as a member account. - -~> **NOTE:** Before using Amazon Macie for the first time it must be enabled manually. Instructions are [here](https://docs.aws.amazon.com/macie/latest/userguide/macie-setting-up.html#macie-setting-up-enable). +Associates an AWS account with Amazon Macie Classic as a member account. ## Example Usage @@ -26,7 +24,7 @@ resource "aws_macie_member_account_association" "example" { The following arguments are supported: -* `member_account_id` - (Required) The ID of the AWS account that you want to associate with Amazon Macie as a member account. +* `member_account_id` - (Required) The ID of the AWS account that you want to associate with Amazon Macie Classic as a member account. ## Attributes Reference From ed3910ad528fe2be5dd5f5c5941818a489a1c578 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 17:03:25 -0400 Subject: [PATCH 112/304] Fix golangci-lint 'whitespace'. --- internal/service/ec2/vpc_security_group.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/ec2/vpc_security_group.go b/internal/service/ec2/vpc_security_group.go index c41a17e2e9d8..2d7d00102ec6 100644 --- a/internal/service/ec2/vpc_security_group.go +++ b/internal/service/ec2/vpc_security_group.go @@ -803,7 +803,6 @@ func updateSecurityGroupRules(ctx context.Context, conn *ec2.EC2, d *schema.Reso // if it finds invalid permissions input, namely a protocol of "-1" with either // to_port or from_port set to a non-zero value. func ExpandIPPerms(group *ec2.SecurityGroup, configured []interface{}) ([]*ec2.IpPermission, error) { - perms := make([]*ec2.IpPermission, len(configured)) for i, mRaw := range configured { var perm ec2.IpPermission From 77c50a2fd2540e505c4ac7b4a7e00a7f6d6d9e59 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 17:05:15 -0400 Subject: [PATCH 113/304] Fix golangci-lint 'staticcheck'. --- internal/service/rds/instance.go | 4 ---- internal/service/rds/instance_data_source.go | 4 ---- 2 files changed, 8 deletions(-) diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 859b397c4bd2..da375537a91d 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -1690,10 +1690,6 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("replicas", aws.StringValueSlice(v.ReadReplicaDBInstanceIdentifiers)) d.Set("replicate_source_db", v.ReadReplicaSourceDBInstanceIdentifier) d.Set("resource_id", v.DbiResourceId) - var securityGroupNames []string - for _, v := range v.DBSecurityGroups { - securityGroupNames = append(securityGroupNames, aws.StringValue(v.DBSecurityGroupName)) - } d.Set("status", v.DBInstanceStatus) d.Set("storage_encrypted", v.StorageEncrypted) d.Set("storage_throughput", v.StorageThroughput) diff --git a/internal/service/rds/instance_data_source.go b/internal/service/rds/instance_data_source.go index e601bb5de59b..66c07689db1e 100644 --- a/internal/service/rds/instance_data_source.go +++ b/internal/service/rds/instance_data_source.go @@ -232,10 +232,6 @@ func dataSourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta in parameterGroupNames = append(parameterGroupNames, aws.StringValue(v.DBParameterGroupName)) } d.Set("db_parameter_groups", parameterGroupNames) - var securityGroupNames []string - for _, v := range v.DBSecurityGroups { - securityGroupNames = append(securityGroupNames, aws.StringValue(v.DBSecurityGroupName)) - } if v.DBSubnetGroup != nil { d.Set("db_subnet_group", v.DBSubnetGroup.DBSubnetGroupName) } else { From fe9a5c2c5c3d1e7be3e1df3ad11f259bdb644f35 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 26 Apr 2023 17:29:24 -0400 Subject: [PATCH 114/304] r/aws_macie_s3_bucket_association: Rebrand to 'Macie Classic'. --- .../service/macie/s3_bucket_association.go | 155 +++++++++++------- .../macie/s3_bucket_association_test.go | 127 ++++++-------- .../macie_s3_bucket_association.html.markdown | 12 +- 3 files changed, 147 insertions(+), 147 deletions(-) diff --git a/internal/service/macie/s3_bucket_association.go b/internal/service/macie/s3_bucket_association.go index c30130a2f64e..0ee9b413ca41 100644 --- a/internal/service/macie/s3_bucket_association.go +++ b/internal/service/macie/s3_bucket_association.go @@ -9,10 +9,12 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -30,17 +32,6 @@ func ResourceS3BucketAssociation() *schema.Resource { Required: true, ForceNew: true, }, - "prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "member_account_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, "classification_type": { Type: schema.TypeList, Optional: true, @@ -63,6 +54,17 @@ func ResourceS3BucketAssociation() *schema.Resource { }, }, }, + "member_account_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: verify.ValidAccountID, + }, + "prefix": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, }, } } @@ -71,7 +73,7 @@ func resourceS3BucketAssociationCreate(ctx context.Context, d *schema.ResourceDa var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - req := &macie.AssociateS3ResourcesInput{ + input := &macie.AssociateS3ResourcesInput{ S3Resources: []*macie.S3ResourceClassification{ { BucketName: aws.String(d.Get("bucket_name").(string)), @@ -79,23 +81,27 @@ func resourceS3BucketAssociationCreate(ctx context.Context, d *schema.ResourceDa }, }, } + if v, ok := d.GetOk("member_account_id"); ok { - req.MemberAccountId = aws.String(v.(string)) + input.MemberAccountId = aws.String(v.(string)) } + if v, ok := d.GetOk("prefix"); ok { - req.S3Resources[0].Prefix = aws.String(v.(string)) + input.S3Resources[0].Prefix = aws.String(v.(string)) } - log.Printf("[DEBUG] Creating Macie S3 bucket association: %#v", req) - resp, err := conn.AssociateS3ResourcesWithContext(ctx, req) + output, err := conn.AssociateS3ResourcesWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "creating Macie S3 bucket association: %s", err) + return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association: %s", err) } - if len(resp.FailedS3Resources) > 0 { - return sdkdiag.AppendErrorf(diags, "creating Macie S3 bucket association: %s", resp.FailedS3Resources[0]) + + if len(output.FailedS3Resources) > 0 { + return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association: %s", output.FailedS3Resources[0]) } d.SetId(fmt.Sprintf("%s/%s", d.Get("bucket_name"), d.Get("prefix"))) + return append(diags, resourceS3BucketAssociationRead(ctx, d, meta)...) } @@ -103,38 +109,23 @@ func resourceS3BucketAssociationRead(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - req := &macie.ListS3ResourcesInput{} - if v, ok := d.GetOk("member_account_id"); ok { - req.MemberAccountId = aws.String(v.(string)) - } - - bucketName := d.Get("bucket_name").(string) - prefix := d.Get("prefix") - - var res *macie.S3ResourceClassification - err := conn.ListS3ResourcesPagesWithContext(ctx, req, func(page *macie.ListS3ResourcesOutput, lastPage bool) bool { - for _, v := range page.S3Resources { - if aws.StringValue(v.BucketName) == bucketName && aws.StringValue(v.Prefix) == prefix { - res = v - return false - } - } - - return true - }) - if err != nil { - return sdkdiag.AppendErrorf(diags, "listing Macie S3 bucket associations: %s", err) - } + output, err := FindS3ResourceClassificationByThreePartKey(ctx, conn, d.Get("member_account_id").(string), d.Get("bucket_name").(string), d.Get("prefix").(string)) - if res == nil { - log.Printf("[WARN] Macie S3 bucket association (%s) not found, removing from state", d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Macie Classic S3 Bucket Association (%s) not found, removing from state", d.Id()) d.SetId("") return diags } - if err := d.Set("classification_type", flattenClassificationType(res.ClassificationType)); err != nil { + if err != nil { + return diag.Errorf("reading Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) + } + + d.Set("bucket_name", output.BucketName) + if err := d.Set("classification_type", flattenClassificationType(output.ClassificationType)); err != nil { return sdkdiag.AppendErrorf(diags, "setting classification_type: %s", err) } + d.Set("prefix", output.Prefix) return diags } @@ -144,7 +135,7 @@ func resourceS3BucketAssociationUpdate(ctx context.Context, d *schema.ResourceDa conn := meta.(*conns.AWSClient).MacieConn() if d.HasChange("classification_type") { - req := &macie.UpdateS3ResourcesInput{ + input := &macie.UpdateS3ResourcesInput{ S3ResourcesUpdate: []*macie.S3ResourceClassificationUpdate{ { BucketName: aws.String(d.Get("bucket_name").(string)), @@ -152,20 +143,23 @@ func resourceS3BucketAssociationUpdate(ctx context.Context, d *schema.ResourceDa }, }, } + if v, ok := d.GetOk("member_account_id"); ok { - req.MemberAccountId = aws.String(v.(string)) + input.MemberAccountId = aws.String(v.(string)) } + if v, ok := d.GetOk("prefix"); ok { - req.S3ResourcesUpdate[0].Prefix = aws.String(v.(string)) + input.S3ResourcesUpdate[0].Prefix = aws.String(v.(string)) } - log.Printf("[DEBUG] Updating Macie S3 bucket association: %#v", req) - resp, err := conn.UpdateS3ResourcesWithContext(ctx, req) + output, err := conn.UpdateS3ResourcesWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Macie S3 bucket association: %s", err) + return sdkdiag.AppendErrorf(diags, "updating Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) } - if len(resp.FailedS3Resources) > 0 { - return sdkdiag.AppendErrorf(diags, "updating Macie S3 bucket association: %s", resp.FailedS3Resources[0]) + + if len(output.FailedS3Resources) > 0 { + return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association (%s): %s", d.Id(), output.FailedS3Resources[0]) } } @@ -176,28 +170,31 @@ func resourceS3BucketAssociationDelete(ctx context.Context, d *schema.ResourceDa var diags diag.Diagnostics conn := meta.(*conns.AWSClient).MacieConn() - log.Printf("[DEBUG] Deleting Macie S3 bucket association: %s", d.Id()) - - req := &macie.DisassociateS3ResourcesInput{ + input := &macie.DisassociateS3ResourcesInput{ AssociatedS3Resources: []*macie.S3Resource{ { BucketName: aws.String(d.Get("bucket_name").(string)), }, }, } + if v, ok := d.GetOk("member_account_id"); ok { - req.MemberAccountId = aws.String(v.(string)) + input.MemberAccountId = aws.String(v.(string)) } + if v, ok := d.GetOk("prefix"); ok { - req.AssociatedS3Resources[0].Prefix = aws.String(v.(string)) + input.AssociatedS3Resources[0].Prefix = aws.String(v.(string)) } - resp, err := conn.DisassociateS3ResourcesWithContext(ctx, req) + log.Printf("[DEBUG] Deleting Macie Classic S3 Bucket Association: %s", d.Id()) + output, err := conn.DisassociateS3ResourcesWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting Macie S3 bucket association: %s", err) + return sdkdiag.AppendErrorf(diags, "deleting Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) } - if len(resp.FailedS3Resources) > 0 { - failed := resp.FailedS3Resources[0] + + if len(output.FailedS3Resources) > 0 { + failed := output.FailedS3Resources[0] // { // ErrorCode: "InvalidInputException", // ErrorMessage: "The request was rejected. The specified S3 resource (bucket or prefix) is not associated with Macie.", @@ -209,8 +206,42 @@ func resourceS3BucketAssociationDelete(ctx context.Context, d *schema.ResourceDa strings.Contains(aws.StringValue(failed.ErrorMessage), "is not associated with Macie") { return diags } - return sdkdiag.AppendErrorf(diags, "deleting Macie S3 bucket association: %s", failed) + + return sdkdiag.AppendErrorf(diags, "deleting Macie Classic S3 Bucket Association (%s): %s", d.Id(), failed) } return diags } + +func FindS3ResourceClassificationByThreePartKey(ctx context.Context, conn *macie.Macie, memberAccountID, bucketName, prefix string) (*macie.S3ResourceClassification, error) { + input := &macie.ListS3ResourcesInput{} + if memberAccountID != "" { + input.MemberAccountId = aws.String(memberAccountID) + } + var output *macie.S3ResourceClassification + + err := conn.ListS3ResourcesPagesWithContext(ctx, input, func(page *macie.ListS3ResourcesOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.S3Resources { + if v != nil && aws.StringValue(v.BucketName) == bucketName && aws.StringValue(v.Prefix) == prefix { + output = v + return false + } + } + + return !lastPage + }) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, &retry.NotFoundError{} + } + + return output, nil +} diff --git a/internal/service/macie/s3_bucket_association_test.go b/internal/service/macie/s3_bucket_association_test.go index 4b3972e56a61..f62c3279b12d 100644 --- a/internal/service/macie/s3_bucket_association_test.go +++ b/internal/service/macie/s3_bucket_association_test.go @@ -5,19 +5,20 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfmacie "github.com/hashicorp/terraform-provider-aws/internal/service/macie" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccMacieS3BucketAssociation_basic(t *testing.T) { ctx := acctest.Context(t) - rInt := sdkacctest.RandInt() + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + resourceName := "aws_macie_s3_bucket_association.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, @@ -26,28 +27,29 @@ func TestAccMacieS3BucketAssociation_basic(t *testing.T) { CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccS3BucketAssociationConfig_basic(rInt), + Config: testAccS3BucketAssociationConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, "aws_macie_s3_bucket_association.test"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.one_time", "NONE"), + testAccCheckS3BucketAssociationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "NONE"), ), }, { - Config: testAccS3BucketAssociationConfig_basicOneTime(rInt), + Config: testAccS3BucketAssociationConfig_basicOneTime(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, "aws_macie_s3_bucket_association.test"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.one_time", "FULL"), + testAccCheckS3BucketAssociationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "FULL"), ), }, }, }) } -func TestAccMacieS3BucketAssociation_accountIdAndPrefix(t *testing.T) { +func TestAccMacieS3BucketAssociation_accountIDAndPrefix(t *testing.T) { ctx := acctest.Context(t) - rInt := sdkacctest.RandInt() + rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) + resourceName := "aws_macie_s3_bucket_association.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, @@ -56,19 +58,19 @@ func TestAccMacieS3BucketAssociation_accountIdAndPrefix(t *testing.T) { CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccS3BucketAssociationConfig_accountIdAndPrefix(rInt), + Config: testAccS3BucketAssociationConfig_accountIDAndPrefix(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, "aws_macie_s3_bucket_association.test"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.one_time", "NONE"), + testAccCheckS3BucketAssociationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "NONE"), ), }, { - Config: testAccS3BucketAssociationConfig_accountIdAndPrefixOneTime(rInt), + Config: testAccS3BucketAssociationConfig_accountIDAndPrefixOneTime(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, "aws_macie_s3_bucket_association.test"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr("aws_macie_s3_bucket_association.test", "classification_type.0.one_time", "FULL"), + testAccCheckS3BucketAssociationExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), + resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "FULL"), ), }, }, @@ -84,70 +86,39 @@ func testAccCheckS3BucketAssociationDestroy(ctx context.Context) resource.TestCh continue } - req := &macie.ListS3ResourcesInput{} - acctId := rs.Primary.Attributes["member_account_id"] - if acctId != "" { - req.MemberAccountId = aws.String(acctId) + _, err := tfmacie.FindS3ResourceClassificationByThreePartKey(ctx, conn, rs.Primary.Attributes["member_account_id"], rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) + + if tfresource.NotFound(err) { + continue } - dissociated := true - err := conn.ListS3ResourcesPagesWithContext(ctx, req, func(page *macie.ListS3ResourcesOutput, lastPage bool) bool { - for _, v := range page.S3Resources { - if aws.StringValue(v.BucketName) == rs.Primary.Attributes["bucket_name"] && aws.StringValue(v.Prefix) == rs.Primary.Attributes["prefix"] { - dissociated = false - return false - } - } - - return true - }) if err != nil { return err } - if !dissociated { - return fmt.Errorf("S3 resource %s/%s is not dissociated from Macie", rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) - } + return fmt.Errorf(" Macie Classic S3 Bucket Association %s still exists", rs.Primary.ID) } + return nil } } -func testAccCheckS3BucketAssociationExists(ctx context.Context, name string) resource.TestCheckFunc { +func testAccCheckS3BucketAssociationExists(ctx context.Context, n string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - rs, ok := s.RootModule().Resources[name] + rs, ok := s.RootModule().Resources[n] if !ok { - return fmt.Errorf("Not found: %s", name) + return fmt.Errorf("Not found: %s", n) } - req := &macie.ListS3ResourcesInput{} - acctId := rs.Primary.Attributes["member_account_id"] - if acctId != "" { - req.MemberAccountId = aws.String(acctId) + if rs.Primary.ID == "" { + return fmt.Errorf("No Macie Classic S3 Bucket Association ID is set") } - exists := false - err := conn.ListS3ResourcesPagesWithContext(ctx, req, func(page *macie.ListS3ResourcesOutput, lastPage bool) bool { - for _, v := range page.S3Resources { - if aws.StringValue(v.BucketName) == rs.Primary.Attributes["bucket_name"] && aws.StringValue(v.Prefix) == rs.Primary.Attributes["prefix"] { - exists = true - return false - } - } - - return true - }) - if err != nil { - return err - } + conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - if !exists { - return fmt.Errorf("S3 resource %s/%s is not associated with Macie", rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) - } + _, err := tfmacie.FindS3ResourceClassificationByThreePartKey(ctx, conn, rs.Primary.Attributes["member_account_id"], rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) - return nil + return err } } @@ -171,22 +142,22 @@ func testAccPreCheck(ctx context.Context, t *testing.T) { } } -func testAccS3BucketAssociationConfig_basic(randInt int) string { +func testAccS3BucketAssociationConfig_basic(rName string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-test-macie-bucket-%d" + bucket = %[1]q } resource "aws_macie_s3_bucket_association" "test" { bucket_name = aws_s3_bucket.test.id } -`, randInt) +`, rName) } -func testAccS3BucketAssociationConfig_basicOneTime(randInt int) string { +func testAccS3BucketAssociationConfig_basicOneTime(rName string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-test-macie-bucket-%d" + bucket = %[1]q } resource "aws_macie_s3_bucket_association" "test" { @@ -196,13 +167,13 @@ resource "aws_macie_s3_bucket_association" "test" { one_time = "FULL" } } -`, randInt) +`, rName) } -func testAccS3BucketAssociationConfig_accountIdAndPrefix(randInt int) string { +func testAccS3BucketAssociationConfig_accountIDAndPrefix(rName string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-test-macie-bucket-%d" + bucket = %[1]q } data "aws_caller_identity" "current" {} @@ -212,13 +183,13 @@ resource "aws_macie_s3_bucket_association" "test" { member_account_id = data.aws_caller_identity.current.account_id prefix = "data" } -`, randInt) +`, rName) } -func testAccS3BucketAssociationConfig_accountIdAndPrefixOneTime(randInt int) string { +func testAccS3BucketAssociationConfig_accountIDAndPrefixOneTime(rName string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-test-macie-bucket-%d" + bucket = %[1]q } data "aws_caller_identity" "current" {} @@ -232,5 +203,5 @@ resource "aws_macie_s3_bucket_association" "test" { one_time = "FULL" } } -`, randInt) +`, rName) } diff --git a/website/docs/r/macie_s3_bucket_association.html.markdown b/website/docs/r/macie_s3_bucket_association.html.markdown index 513ad15d4cb8..617406423622 100644 --- a/website/docs/r/macie_s3_bucket_association.html.markdown +++ b/website/docs/r/macie_s3_bucket_association.html.markdown @@ -3,16 +3,14 @@ subcategory: "Macie Classic" layout: "aws" page_title: "AWS: aws_macie_s3_bucket_association" description: |- - Associates an S3 resource with Amazon Macie for monitoring and data classification. + Associates an S3 resource with Amazon Macie Classic for monitoring and data classification. --- # Resource: aws_macie_s3_bucket_association ~> **NOTE:** This resource interacts with [Amazon Macie Classic](https://docs.aws.amazon.com/macie/latest/userguide/what-is-macie.html). Macie Classic cannot be activated in new accounts. See the [FAQ](https://aws.amazon.com/macie/classic-faqs/) for more details. -Associates an S3 resource with Amazon Macie for monitoring and data classification. - -~> **NOTE:** Before using Amazon Macie for the first time it must be enabled manually. Instructions are [here](https://docs.aws.amazon.com/macie/latest/userguide/macie-setting-up.html#macie-setting-up-enable). +Associates an S3 resource with Amazon Macie Classic for monitoring and data classification. ## Example Usage @@ -31,9 +29,9 @@ resource "aws_macie_s3_bucket_association" "example" { The following arguments are supported: -* `bucket_name` - (Required) The name of the S3 bucket that you want to associate with Amazon Macie. -* `classification_type` - (Optional) The configuration of how Amazon Macie classifies the S3 objects. -* `member_account_id` - (Optional) The ID of the Amazon Macie member account whose S3 resources you want to associate with Macie. If `member_account_id` isn't specified, the action associates specified S3 resources with Macie for the current master account. +* `bucket_name` - (Required) The name of the S3 bucket that you want to associate with Amazon Macie Classic. +* `classification_type` - (Optional) The configuration of how Amazon Macie Classic classifies the S3 objects. +* `member_account_id` - (Optional) The ID of the Amazon Macie Classic member account whose S3 resources you want to associate with Macie. If `member_account_id` isn't specified, the action associates specified S3 resources with Macie for the current master account. * `prefix` - (Optional) Object key prefix identifying one or more S3 objects to which the association applies. The `classification_type` object supports the following: From 8195bc1dba4f0157cfb0021501969ddc6515be5f Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 26 Apr 2023 21:35:18 +0000 Subject: [PATCH 115/304] Update CHANGELOG.md for #31006 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85876529b80d..94d7724d145f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BREAKING CHANGES: NOTES: +* data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From 6584e46935cde4d17efb44eface23b2feb2c9974 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 26 Apr 2023 21:38:25 +0000 Subject: [PATCH 116/304] Update CHANGELOG.md for #30966 --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d7724d145f..7cb591fd9fbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,33 @@ BREAKING CHANGES: +* data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) +* resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) +* resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_security_group: With the retirement of EC2-Classic non-VPC security groups are no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_security_group_rule: With the retirement of EC2-Classic non-VPC security groups are no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) NOTES: @@ -26,6 +47,10 @@ ENHANCEMENTS: * resource/aws_db_subnet_group: Add `vpc_id` attribute ([#30775](https://github.com/hashicorp/terraform-provider-aws/issues/30775)) +BUG FIXES: + +* resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) + ## 4.64.0 (April 20, 2023) BREAKING CHANGES: From d56cc7b79e703527d44761fa01e78bb5e2e8ed69 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 26 Apr 2023 18:01:37 -0400 Subject: [PATCH 117/304] elasticache/rep_group: Remove availability zones --- .../service/elasticache/replication_group.go | 18 +-- .../elasticache/replication_group_test.go | 137 +----------------- ...lasticache_replication_group.html.markdown | 1 - 3 files changed, 8 insertions(+), 148 deletions(-) diff --git a/internal/service/elasticache/replication_group.go b/internal/service/elasticache/replication_group.go index eb9667e95eac..3df16b5ba282 100644 --- a/internal/service/elasticache/replication_group.go +++ b/internal/service/elasticache/replication_group.go @@ -74,14 +74,6 @@ func ResourceReplicationGroup() *schema.Resource { Optional: true, Default: false, }, - "availability_zones": { - Type: schema.TypeSet, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - ConflictsWith: []string{"preferred_cache_cluster_azs"}, - }, "cluster_enabled": { Type: schema.TypeBool, Computed: true, @@ -264,10 +256,9 @@ func ResourceReplicationGroup() *schema.Resource { }, }, "preferred_cache_cluster_azs": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - ConflictsWith: []string{"availability_zones"}, + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "primary_endpoint_address": { Type: schema.TypeString, @@ -453,9 +444,6 @@ func resourceReplicationGroupCreate(ctx context.Context, d *schema.ResourceData, if preferredAZs, ok := d.GetOk("preferred_cache_cluster_azs"); ok { input.PreferredCacheClusterAZs = flex.ExpandStringList(preferredAZs.([]interface{})) } - if availabilityZones := d.Get("availability_zones").(*schema.Set); availabilityZones.Len() > 0 { - input.PreferredCacheClusterAZs = flex.ExpandStringSet(availabilityZones) - } if v, ok := d.GetOk("parameter_group_name"); ok { input.CacheParameterGroupName = aws.String(v.(string)) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 6b1a39b29611..b0885e12b670 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -554,40 +554,6 @@ func TestAccElastiCacheReplicationGroup_vpc(t *testing.T) { }) } -func TestAccElastiCacheReplicationGroup_depecatedAvailabilityZones_vpc(t *testing.T) { - ctx := acctest.Context(t) - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } - - var rg elasticache.ReplicationGroup - resourceName := "aws_elasticache_replication_group.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccReplicationGroupConfig_inVPCDeprecatedAvailabilityZones(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), - resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, - }, - }, - }) -} - func TestAccElastiCacheReplicationGroup_multiAzNotInVPC(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -614,7 +580,6 @@ func TestAccElastiCacheReplicationGroup_multiAzNotInVPC(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "preferred_cache_cluster_azs.#", "2"), resource.TestCheckResourceAttrPair(resourceName, "preferred_cache_cluster_azs.0", "data.aws_availability_zones.available", "names.0"), resource.TestCheckResourceAttrPair(resourceName, "preferred_cache_cluster_azs.1", "data.aws_availability_zones.available", "names.1"), - resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "0"), ), }, { @@ -655,7 +620,6 @@ func TestAccElastiCacheReplicationGroup_multiAzNotInVPC_repeated(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "preferred_cache_cluster_azs.1", "data.aws_availability_zones.available", "names.1"), resource.TestCheckResourceAttrPair(resourceName, "preferred_cache_cluster_azs.2", "data.aws_availability_zones.available", "names.0"), resource.TestCheckResourceAttrPair(resourceName, "preferred_cache_cluster_azs.3", "data.aws_availability_zones.available", "names.1"), - resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "0"), ), }, { @@ -668,61 +632,6 @@ func TestAccElastiCacheReplicationGroup_multiAzNotInVPC_repeated(t *testing.T) { }) } -func TestAccElastiCacheReplicationGroup_deprecatedAvailabilityZones_multiAzNotInVPC(t *testing.T) { - ctx := acctest.Context(t) - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } - - var rg1, rg2 elasticache.ReplicationGroup - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_elasticache_replication_group.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccReplicationGroupConfig_multiAZNotInVPCBasic(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckReplicationGroupExists(ctx, resourceName, &rg1), - resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), - resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately"}, - }, - { - Config: testAccReplicationGroupConfig_multiAZNotInVPCDeprecatedAvailabilityZones(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckReplicationGroupExists(ctx, resourceName, &rg2), - testAccCheckReplicationGroupRecreated(&rg1, &rg2), - resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), - resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "2"), - resource.TestCheckResourceAttrPair(resourceName, "availability_zones.0", "data.aws_availability_zones.available", "names.0"), - resource.TestCheckResourceAttrPair(resourceName, "availability_zones.1", "data.aws_availability_zones.available", "names.1"), - resource.TestCheckResourceAttr(resourceName, "preferred_cache_cluster_azs.#", "0"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, - }, - }, - }) -} - func TestAccElastiCacheReplicationGroup_multiAzInVPC(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -762,7 +671,7 @@ func TestAccElastiCacheReplicationGroup_multiAzInVPC(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + ImportStateVerifyIgnore: []string{"apply_immediately", "preferred_cache_cluster_azs"}, }, }, }) @@ -807,7 +716,7 @@ func TestAccElastiCacheReplicationGroup_deprecatedAvailabilityZones_multiAzInVPC ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + ImportStateVerifyIgnore: []string{"apply_immediately", "preferred_cache_cluster_azs"}, }, }, }) @@ -1296,7 +1205,7 @@ func TestAccElastiCacheReplicationGroup_enableAuthTokenTransitEncryption(t *test ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately", "auth_token", "availability_zones"}, + ImportStateVerifyIgnore: []string{"apply_immediately", "auth_token", "preferred_cache_cluster_azs"}, }, }, }) @@ -2992,42 +2901,6 @@ resource "aws_security_group" "test" { ) } -func testAccReplicationGroupConfig_inVPCDeprecatedAvailabilityZones(rName string) string { - return acctest.ConfigCompose( - acctest.ConfigVPCWithSubnets(rName, 1), - fmt.Sprintf(` -resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 1 - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - availability_zones = [data.aws_availability_zones.available.names[0]] -} - -resource "aws_elasticache_subnet_group" "test" { - name = %[1]q - subnet_ids = aws_subnet.test[*].id -} - -resource "aws_security_group" "test" { - name = %[1]q - description = "tf-test-security-group-descr" - vpc_id = aws_vpc.test.id - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} -`, rName), - ) -} - func testAccReplicationGroupConfig_multiAZNotInVPCBasic(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { @@ -3086,7 +2959,7 @@ resource "aws_elasticache_replication_group" "test" { node_type = "cache.t3.small" automatic_failover_enabled = true multi_az_enabled = true - availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] + preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] } `, rName), ) @@ -3104,7 +2977,7 @@ resource "aws_elasticache_replication_group" "test" { port = 6379 subnet_group_name = aws_elasticache_subnet_group.test.name security_group_ids = [aws_security_group.test.id] - availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] + preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] automatic_failover_enabled = true multi_az_enabled = true snapshot_window = "02:00-03:00" diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 25d3c9a3019a..8f6beac3e810 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -179,7 +179,6 @@ The following arguments are optional: Only supported for engine type `"redis"` and if the engine version is 6 or higher. Defaults to `true`. * `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, `num_cache_clusters` must be greater than 1. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. -* `availability_zones` - (Optional, **Deprecated** use `preferred_cache_cluster_azs` instead) List of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not considered. * `cluster_mode` - (Optional, **Deprecated** use root-level `num_node_groups` and `replicas_per_node_group` instead) Create a native Redis cluster. `automatic_failover_enabled` must be set to true. Cluster Mode documented below. Only 1 `cluster_mode` block is allowed. Note that configuring this block does not enable cluster mode, i.e., data sharding, this requires using a parameter group that has the parameter `cluster-enabled` set to true. * `data_tiering_enabled` - (Optional) Enables data tiering. Data tiering is only supported for replication groups using the r6gd node type. This parameter must be set to `true` when using r6gd nodes. * `engine` - (Optional) Name of the cache engine to be used for the clusters in this replication group. The only valid value is `redis`. From a81569e18f585aa95e18a0bee5abea192577e163 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 26 Apr 2023 18:08:31 -0400 Subject: [PATCH 118/304] Add changelog --- .changelog/31008.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/31008.txt diff --git a/.changelog/31008.txt b/.changelog/31008.txt new file mode 100644 index 000000000000..e7c4dfd34d3a --- /dev/null +++ b/.changelog/31008.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change +resource/aws_elasticache_replication_group: Removed `availability_zones` argument -- use `preferred_cache_cluster_azs` instead +``` + +```release-note:note +resource/aws_elasticache_replication_group: Update configurations to use the `preferred_cache_cluster_azs` instead of the `availability_zones` argument +``` \ No newline at end of file From a00ceec58405fb4f1ed0989f815e51b72d05b179 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 27 Apr 2023 15:33:36 -0400 Subject: [PATCH 119/304] elasticache/replication_group: Remove deprecated arguments --- .../service/elasticache/replication_group.go | 111 +-- .../replication_group_data_source.go | 12 - .../replication_group_data_source_test.go | 46 +- .../elasticache/replication_group_test.go | 861 ++++++++---------- 4 files changed, 404 insertions(+), 626 deletions(-) diff --git a/internal/service/elasticache/replication_group.go b/internal/service/elasticache/replication_group.go index 3df16b5ba282..ad8c396a0e96 100644 --- a/internal/service/elasticache/replication_group.go +++ b/internal/service/elasticache/replication_group.go @@ -78,32 +78,6 @@ func ResourceReplicationGroup() *schema.Resource { Type: schema.TypeBool, Computed: true, }, - "cluster_mode": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - ConflictsWith: []string{"num_node_groups", "replicas_per_node_group"}, - Deprecated: "Use num_node_groups and replicas_per_node_group instead", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "num_node_groups": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"num_node_groups", "number_cache_clusters", "num_cache_clusters", "global_replication_group_id"}, - Deprecated: "Use root-level num_node_groups instead", - }, - "replicas_per_node_group": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"replicas_per_node_group"}, - Deprecated: "Use root-level replicas_per_node_group instead", - }, - }, - }, - }, "configuration_endpoint_address": { Type: schema.TypeString, Computed: true, @@ -118,7 +92,6 @@ func ResourceReplicationGroup() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ExactlyOneOf: []string{"description", "replication_group_description"}, ValidateFunc: validation.StringIsNotEmpty, }, "engine": { @@ -144,7 +117,6 @@ func ResourceReplicationGroup() *schema.Resource { ForceNew: true, Computed: true, ConflictsWith: []string{ - "cluster_mode.0.num_node_groups", "num_node_groups", "parameter_group_name", "engine", @@ -220,20 +192,13 @@ func ResourceReplicationGroup() *schema.Resource { Type: schema.TypeInt, Computed: true, Optional: true, - ConflictsWith: []string{"cluster_mode.0.num_node_groups", "num_node_groups", "number_cache_clusters"}, + ConflictsWith: []string{"num_node_groups"}, }, "num_node_groups": { Type: schema.TypeInt, Optional: true, Computed: true, - ConflictsWith: []string{"cluster_mode", "number_cache_clusters", "num_cache_clusters", "global_replication_group_id"}, - }, - "number_cache_clusters": { - Type: schema.TypeInt, - Computed: true, - Optional: true, - ConflictsWith: []string{"cluster_mode.0.num_node_groups", "num_cache_clusters", "num_node_groups"}, - Deprecated: "Use num_cache_clusters instead", + ConflictsWith: []string{"num_cache_clusters", "global_replication_group_id"}, }, "parameter_group_name": { Type: schema.TypeString, @@ -269,18 +234,9 @@ func ResourceReplicationGroup() *schema.Resource { Computed: true, }, "replicas_per_node_group": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ConflictsWith: []string{"cluster_mode"}, - }, - "replication_group_description": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ExactlyOneOf: []string{"description", "replication_group_description"}, - Deprecated: "Use description instead", - ValidateFunc: validation.StringIsNotEmpty, + Type: schema.TypeInt, + Optional: true, + Computed: true, }, "replication_group_id": { Type: schema.TypeString, @@ -386,10 +342,7 @@ func ResourceReplicationGroup() *schema.Resource { CustomizeDiffValidateReplicationGroupAutomaticFailover, customizeDiffEngineVersionForceNewOnDowngrade, customdiff.ComputedIf("member_clusters", func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) bool { - return diff.HasChange("number_cache_clusters") || - diff.HasChange("num_cache_clusters") || - diff.HasChange("cluster_mode.0.num_node_groups") || - diff.HasChange("cluster_mode.0.replicas_per_node_group") || + return diff.HasChange("num_cache_clusters") || diff.HasChange("num_node_groups") || diff.HasChange("replicas_per_node_group") }), @@ -410,9 +363,6 @@ func resourceReplicationGroupCreate(ctx context.Context, d *schema.ResourceData, if v, ok := d.GetOk("description"); ok { input.ReplicationGroupDescription = aws.String(v.(string)) } - if v, ok := d.GetOk("replication_group_description"); ok { - input.ReplicationGroupDescription = aws.String(v.(string)) - } if v, ok := d.GetOk("data_tiering_enabled"); ok { input.DataTieringEnabled = aws.Bool(v.(bool)) @@ -518,19 +468,6 @@ func resourceReplicationGroupCreate(ctx context.Context, d *schema.ResourceData, input.AuthToken = aws.String(v.(string)) } - if clusterMode, ok := d.GetOk("cluster_mode"); ok { - clusterModeList := clusterMode.([]interface{}) - attributes := clusterModeList[0].(map[string]interface{}) - - if v, ok := attributes["num_node_groups"]; ok && v != 0 { - input.NumNodeGroups = aws.Int64(int64(v.(int))) - } - - if v, ok := attributes["replicas_per_node_group"]; ok { - input.ReplicasPerNodeGroup = aws.Int64(int64(v.(int))) - } - } - if v, ok := d.GetOk("num_node_groups"); ok && v != 0 { input.NumNodeGroups = aws.Int64(int64(v.(int))) } @@ -539,10 +476,6 @@ func resourceReplicationGroupCreate(ctx context.Context, d *schema.ResourceData, input.ReplicasPerNodeGroup = aws.Int64(int64(v.(int))) } - if cacheClusters, ok := d.GetOk("number_cache_clusters"); ok { - input.NumCacheClusters = aws.Int64(int64(cacheClusters.(int))) - } - if numCacheClusters, ok := d.GetOk("num_cache_clusters"); ok { input.NumCacheClusters = aws.Int64(int64(numCacheClusters.(int))) } @@ -646,15 +579,10 @@ func resourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, m d.Set("kms_key_id", rgp.KmsKeyId) d.Set("description", rgp.Description) - d.Set("replication_group_description", rgp.Description) - d.Set("number_cache_clusters", len(rgp.MemberClusters)) d.Set("num_cache_clusters", len(rgp.MemberClusters)) if err := d.Set("member_clusters", flex.FlattenStringSet(rgp.MemberClusters)); err != nil { return sdkdiag.AppendErrorf(diags, "setting member_clusters: %s", err) } - if err := d.Set("cluster_mode", flattenNodeGroupsToClusterMode(rgp.NodeGroups)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting cluster_mode attribute: %s", err) - } d.Set("num_node_groups", len(rgp.NodeGroups)) d.Set("replicas_per_node_group", len(rgp.NodeGroups[0].NodeGroupMembers)-1) @@ -735,8 +663,6 @@ func resourceReplicationGroupUpdate(ctx context.Context, d *schema.ResourceData, conn := meta.(*conns.AWSClient).ElastiCacheConn() if d.HasChanges( - "cluster_mode.0.num_node_groups", - "cluster_mode.0.replicas_per_node_group", "num_node_groups", "replicas_per_node_group", ) { @@ -744,12 +670,6 @@ func resourceReplicationGroupUpdate(ctx context.Context, d *schema.ResourceData, if err != nil { return sdkdiag.AppendErrorf(diags, "modifying ElastiCache Replication Group (%s) shard configuration: %s", d.Id(), err) } - } else if d.HasChange("number_cache_clusters") { - // TODO: remove when number_cache_clusters is removed from resource schema - err := modifyReplicationGroupNumCacheClusters(ctx, conn, d, "number_cache_clusters") - if err != nil { - return sdkdiag.AppendErrorf(diags, "modifying ElastiCache Replication Group (%s) clusters: %s", d.Id(), err) - } } else if d.HasChange("num_cache_clusters") { err := modifyReplicationGroupNumCacheClusters(ctx, conn, d, "num_cache_clusters") if err != nil { @@ -768,11 +688,6 @@ func resourceReplicationGroupUpdate(ctx context.Context, d *schema.ResourceData, requestUpdate = true } - if d.HasChange("replication_group_description") { - params.ReplicationGroupDescription = aws.String(d.Get("replication_group_description").(string)) - requestUpdate = true - } - if d.HasChange("automatic_failover_enabled") { params.AutomaticFailoverEnabled = aws.Bool(d.Get("automatic_failover_enabled").(bool)) requestUpdate = true @@ -1052,20 +967,6 @@ func flattenNodeGroupsToClusterMode(nodeGroups []*elasticache.NodeGroup) []map[s } func modifyReplicationGroupShardConfiguration(ctx context.Context, conn *elasticache.ElastiCache, d *schema.ResourceData) error { - if d.HasChange("cluster_mode.0.num_node_groups") { - err := modifyReplicationGroupShardConfigurationNumNodeGroups(ctx, conn, d, "cluster_mode.0.num_node_groups") - if err != nil { - return err - } - } - - if d.HasChange("cluster_mode.0.replicas_per_node_group") { - err := modifyReplicationGroupShardConfigurationReplicasPerNodeGroup(ctx, conn, d, "cluster_mode.0.replicas_per_node_group") - if err != nil { - return err - } - } - if d.HasChange("num_node_groups") { err := modifyReplicationGroupShardConfigurationNumNodeGroups(ctx, conn, d, "num_node_groups") if err != nil { diff --git a/internal/service/elasticache/replication_group_data_source.go b/internal/service/elasticache/replication_group_data_source.go index da5ba8c39390..e3ac2acdfe97 100644 --- a/internal/service/elasticache/replication_group_data_source.go +++ b/internal/service/elasticache/replication_group_data_source.go @@ -24,11 +24,6 @@ func DataSourceReplicationGroup() *schema.Resource { Required: true, ValidateFunc: validateReplicationGroupID, }, - "replication_group_description": { - Type: schema.TypeString, - Computed: true, - Deprecated: "Use description instead", - }, "arn": { Type: schema.TypeString, Computed: true, @@ -69,11 +64,6 @@ func DataSourceReplicationGroup() *schema.Resource { Type: schema.TypeInt, Computed: true, }, - "number_cache_clusters": { - Type: schema.TypeInt, - Computed: true, - Deprecated: "Use num_cache_clusters instead", - }, "member_clusters": { Type: schema.TypeSet, Computed: true, @@ -140,7 +130,6 @@ func dataSourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, d.SetId(aws.StringValue(rg.ReplicationGroupId)) d.Set("description", rg.Description) - d.Set("replication_group_description", rg.Description) d.Set("arn", rg.ARN) d.Set("auth_token_enabled", rg.AuthTokenEnabled) @@ -178,7 +167,6 @@ func dataSourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, } d.Set("num_cache_clusters", len(rg.MemberClusters)) - d.Set("number_cache_clusters", len(rg.MemberClusters)) if err := d.Set("member_clusters", flex.FlattenStringList(rg.MemberClusters)); err != nil { return sdkdiag.AppendErrorf(diags, "setting member_clusters: %s", err) } diff --git a/internal/service/elasticache/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index 6942749851c1..c53151fcd181 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -35,13 +35,11 @@ func TestAccElastiCacheReplicationGroupDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceName, "multi_az_enabled", resourceName, "multi_az_enabled"), resource.TestCheckResourceAttrPair(dataSourceName, "member_clusters.#", resourceName, "member_clusters.#"), resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), - resource.TestCheckResourceAttrPair(dataSourceName, "num_cache_clusters", resourceName, "number_cache_clusters"), - resource.TestCheckResourceAttrPair(dataSourceName, "number_cache_clusters", resourceName, "number_cache_clusters"), + resource.TestCheckResourceAttrPair(dataSourceName, "num_cache_clusters", resourceName, "num_cache_clusters"), resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"), resource.TestCheckResourceAttrPair(dataSourceName, "primary_endpoint_address", resourceName, "primary_endpoint_address"), resource.TestCheckResourceAttrPair(dataSourceName, "reader_endpoint_address", resourceName, "reader_endpoint_address"), - resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "replication_group_description"), - resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_description", resourceName, "replication_group_description"), + resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_id", resourceName, "replication_group_id"), resource.TestCheckResourceAttrPair(dataSourceName, "snapshot_window", resourceName, "snapshot_window"), ), @@ -76,7 +74,7 @@ func TestAccElastiCacheReplicationGroupDataSource_clusterMode(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceName, "num_node_groups", resourceName, "cluster_mode.0.num_node_groups"), resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"), resource.TestCheckResourceAttrPair(dataSourceName, "replicas_per_node_group", resourceName, "cluster_mode.0.replicas_per_node_group"), - resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_description", resourceName, "replication_group_description"), + resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_id", resourceName, "replication_group_id"), ), }, @@ -159,14 +157,14 @@ func TestAccElastiCacheReplicationGroupDataSource_Engine_Redis_LogDeliveryConfig func testAccReplicationGroupDataSourceConfig_basic(rName string) string { return acctest.ConfigAvailableAZsNoOptIn() + fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 2 - port = 6379 - availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] - automatic_failover_enabled = true - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 2 + port = 6379 + availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] + automatic_failover_enabled = true + snapshot_window = "01:00-02:00" } data "aws_elasticache_replication_group" "test" { @@ -178,11 +176,11 @@ data "aws_elasticache_replication_group" "test" { func testAccReplicationGroupDataSourceConfig_clusterMode(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - port = 6379 - automatic_failover_enabled = true + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + port = 6379 + automatic_failover_enabled = true cluster_mode { replicas_per_node_group = 1 @@ -199,12 +197,12 @@ data "aws_elasticache_replication_group" "test" { func testAccReplicationGroupDataSourceConfig_multiAZ(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 2 - automatic_failover_enabled = true - multi_az_enabled = true + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 2 + automatic_failover_enabled = true + multi_az_enabled = true } data "aws_elasticache_replication_group" "test" { diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index b0885e12b670..accf5fb02653 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -43,13 +43,12 @@ func TestAccElastiCacheReplicationGroup_basic(t *testing.T) { testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "engine", "redis"), acctest.CheckResourceAttrRegionalARN(resourceName, "arn", "elasticache", fmt.Sprintf("replicationgroup:%s", rName)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "0"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "1"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "0"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "false"), testCheckEngineStuffDefault(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "auto_minor_version_upgrade", "true"), @@ -287,8 +286,8 @@ func TestAccElastiCacheReplicationGroup_updateDescription(t *testing.T) { Config: testAccReplicationGroupConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), - resource.TestCheckResourceAttr(resourceName, "replication_group_description", "test description"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "description", "test description"), ), }, { @@ -301,8 +300,8 @@ func TestAccElastiCacheReplicationGroup_updateDescription(t *testing.T) { Config: testAccReplicationGroupConfig_updatedDescription(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), - resource.TestCheckResourceAttr(resourceName, "replication_group_description", "updated description"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "description", "updated description"), ), }, }, @@ -413,7 +412,7 @@ func TestAccElastiCacheReplicationGroup_updateNodeSize(t *testing.T) { Config: testAccReplicationGroupConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), resource.TestCheckResourceAttr(resourceName, "node_type", "cache.t3.small"), ), }, @@ -427,7 +426,7 @@ func TestAccElastiCacheReplicationGroup_updateNodeSize(t *testing.T) { Config: testAccReplicationGroupConfig_updatedNodeSize(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), resource.TestCheckResourceAttr(resourceName, "node_type", "cache.t3.medium"), ), }, @@ -540,7 +539,7 @@ func TestAccElastiCacheReplicationGroup_vpc(t *testing.T) { Config: testAccReplicationGroupConfig_inVPC(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), resource.TestCheckResourceAttr(resourceName, "preferred_cache_cluster_azs.#", "1"), ), }, @@ -652,7 +651,7 @@ func TestAccElastiCacheReplicationGroup_multiAzInVPC(t *testing.T) { Config: testAccReplicationGroupConfig_multiAZInVPC(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "snapshot_window", "02:00-03:00"), @@ -697,7 +696,7 @@ func TestAccElastiCacheReplicationGroup_deprecatedAvailabilityZones_multiAzInVPC Config: testAccReplicationGroupConfig_multiAZInVPC(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "snapshot_window", "02:00-03:00"), @@ -761,14 +760,13 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), resource.TestCheckResourceAttr(resourceName, "port", "6379"), resource.TestCheckResourceAttrSet(resourceName, "configuration_endpoint_address"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -805,12 +803,11 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_nonClusteredParameterGroup(t testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "parameter_group_name", "default.redis6.x"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "1"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), resource.TestMatchResourceAttr(resourceName, "primary_endpoint_address", regexp.MustCompile(fmt.Sprintf("%s\\..+\\.%s", rName, acctest.PartitionDNSSuffix()))), resource.TestCheckNoResourceAttr(resourceName, "configuration_endpoint_address"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -848,11 +845,10 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleUp(t Config: testAccReplicationGroupConfig_nativeRedisCluster(rName, 2, 1), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), testAccReplicationGroupCheckMemberClusterTags(resourceName, clusterDataSourcePrefix, 4, []kvp{ {"key", "value"}, }), @@ -864,10 +860,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleUp(t Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "3"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "6"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "3"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "6"), testAccReplicationGroupCheckMemberClusterTags(resourceName, clusterDataSourcePrefix, 6, []kvp{ {"key", "value"}, @@ -900,10 +895,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleDown Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "3"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "6"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "3"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "6"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -913,10 +907,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleDown Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -946,10 +939,9 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateReplicasPerNodeGroup(t Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -959,10 +951,9 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateReplicasPerNodeGroup(t Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "3"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "8"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "8"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "8"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -972,10 +963,9 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateReplicasPerNodeGroup(t Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "2"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "6"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "6"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -1005,10 +995,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -1018,10 +1007,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "3"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "2"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "9"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "3"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "9"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "9"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -1051,10 +1039,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "3"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "2"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "9"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "3"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "9"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "9"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -1064,10 +1051,9 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testCheckEngineStuffClusterEnabledDefault(ctx, resourceName), ), @@ -1098,12 +1084,11 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_singleNode(t *testing.T) { testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "parameter_group_name", "default.redis6.x.cluster.on"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "0"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "1"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "0"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "1"), ), }, @@ -1132,7 +1117,7 @@ func TestAccElastiCacheReplicationGroup_clusteringAndCacheNodesCausesError(t *te Steps: []resource.TestStep{ { Config: testAccReplicationGroupConfig_nativeRedisClusterError(rName), - ExpectError: regexp.MustCompile(`"cluster_mode.0.num_node_groups": conflicts with number_cache_clusters`), + ExpectError: regexp.MustCompile(`"num_node_groups": conflicts with num_cache_clusters`), }, }, }) @@ -1293,7 +1278,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_basic(t *testing.T) testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), testAccReplicationGroupCheckMemberClusterTags(resourceName, clusterDataSourcePrefix, 2, []kvp{ {"key", "value"}, @@ -1312,7 +1297,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_basic(t *testing.T) testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), testAccReplicationGroupCheckMemberClusterTags(resourceName, clusterDataSourcePrefix, 4, []kvp{ {"key", "value"}, @@ -1325,7 +1310,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_basic(t *testing.T) testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), testAccReplicationGroupCheckMemberClusterTags(resourceName, clusterDataSourcePrefix, 2, []kvp{ {"key", "value"}, @@ -1361,7 +1346,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1386,7 +1371,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -1419,7 +1404,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1449,7 +1434,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -1482,7 +1467,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_multiAZEnabled(t *te testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1512,7 +1497,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_multiAZEnabled(t *te testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", strconv.FormatBool(autoFailoverEnabled)), resource.TestCheckResourceAttr(resourceName, "multi_az_enabled", strconv.FormatBool(multiAZEnabled)), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -1540,7 +1525,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 3), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1563,7 +1548,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 3), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1591,7 +1576,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 3), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1614,7 +1599,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 4), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), ), }, @@ -1642,7 +1627,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 3), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "3"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "3"), ), }, @@ -1665,7 +1650,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 2), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -1693,7 +1678,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 4), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "4"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "4"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "4"), ), }, @@ -1716,7 +1701,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea Config: testAccReplicationGroupConfig_numberCacheClusters(rName, 2), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &replicationGroup), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), ), }, @@ -1969,8 +1954,8 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_basic(t *testin resource.TestCheckResourceAttrPair(resourceName, "engine", primaryGroupResourceName, "engine"), resource.TestCheckResourceAttrPair(resourceName, "engine_version", primaryGroupResourceName, "engine_version"), resource.TestMatchResourceAttr(resourceName, "parameter_group_name", regexp.MustCompile(fmt.Sprintf("^global-datastore-%s-", rName))), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "1"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "number_cache_clusters", "2"), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "1"), + resource.TestCheckResourceAttr(primaryGroupResourceName, "num_cache_clusters", "2"), ), }, { @@ -2023,7 +2008,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_full(t *testing resource.TestCheckResourceAttrPair(resourceName, "engine_version", primaryGroupResourceName, "engine_version"), resource.TestMatchResourceAttr(resourceName, "parameter_group_name", regexp.MustCompile(fmt.Sprintf("^global-datastore-%s-", rName))), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", strconv.Itoa(initialNumCacheClusters)), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", strconv.Itoa(initialNumCacheClusters)), resource.TestCheckResourceAttrPair(resourceName, "multi_az_enabled", primaryGroupResourceName, "multi_az_enabled"), resource.TestCheckResourceAttrPair(resourceName, "automatic_failover_enabled", primaryGroupResourceName, "automatic_failover_enabled"), @@ -2045,7 +2030,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_full(t *testing Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg2), testAccCheckReplicationGroupParameterGroup(ctx, &rg2, &pg2), - resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", strconv.Itoa(updatedNumCacheClusters)), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", strconv.Itoa(updatedNumCacheClusters)), ), }, }, @@ -2115,15 +2100,13 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupIDClusterMode_basi Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg1), testAccCheckReplicationGroupParameterGroup(ctx, &rg1, &pg1), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "1"), resource.TestCheckResourceAttr(resourceName, "automatic_failover_enabled", "true"), resource.TestMatchResourceAttr(resourceName, "parameter_group_name", regexp.MustCompile(fmt.Sprintf("^global-datastore-%s-", rName))), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.0.replicas_per_node_group", "2"), + resource.TestCheckResourceAttr(primaryGroupResourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(primaryGroupResourceName, "replicas_per_node_group", "2"), ), }, { @@ -2138,13 +2121,11 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupIDClusterMode_basi Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg2), testAccCheckReplicationGroupParameterGroup(ctx, &rg2, &pg2), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "3"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", "3"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.#", "1"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.0.num_node_groups", "2"), - resource.TestCheckResourceAttr(primaryGroupResourceName, "cluster_mode.0.replicas_per_node_group", "1"), + resource.TestCheckResourceAttr(primaryGroupResourceName, "num_node_groups", "2"), + resource.TestCheckResourceAttr(primaryGroupResourceName, "replicas_per_node_group", "1"), ), }, }, @@ -2170,7 +2151,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupIDClusterModeValid Steps: []resource.TestStep{ { Config: testAccReplicationGroupConfig_globalIDClusterModeNumNodeOnSecondary(rName), - ExpectError: regexp.MustCompile(`"global_replication_group_id": conflicts with cluster_mode.0.num_node_groups`), + ExpectError: regexp.MustCompile(`"global_replication_group_id": conflicts with num_node_groups`), }, }, }) @@ -2340,7 +2321,6 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "engine", "redis"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), resource.TestCheckResourceAttr(resourceName, "parameter_group_name", "default.redis6.x.cluster.on"), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination", rName), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination_type", "cloudwatch-logs"), @@ -2367,7 +2347,6 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "engine", "redis"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), resource.TestCheckResourceAttr(resourceName, "parameter_group_name", "default.redis6.x.cluster.on"), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination", rName), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination_type", "cloudwatch-logs"), @@ -2385,7 +2364,6 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "engine", "redis"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), resource.TestCheckResourceAttr(resourceName, "parameter_group_name", "default.redis6.x.cluster.on"), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination", rName), resource.TestCheckResourceAttr(resourceName, "log_delivery_configuration.0.destination_type", "kinesis-firehose"), @@ -2403,7 +2381,6 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "engine", "redis"), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "cluster_mode.#", "1"), resource.TestCheckNoResourceAttr(resourceName, "log_delivery_configuration.0.destination"), resource.TestCheckNoResourceAttr(resourceName, "log_delivery_configuration.0.destination_type"), resource.TestCheckNoResourceAttr(resourceName, "log_delivery_configuration.0.log_format"), @@ -2689,13 +2666,13 @@ func testAccCheckResourceTags(resourceName string, kvs []kvp) []resource.TestChe func testAccReplicationGroupConfig_basic(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" } `, rName) } @@ -2703,10 +2680,10 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_v5(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - engine_version = "5.0.6" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + engine_version = "5.0.6" } `, rName) } @@ -2716,12 +2693,12 @@ func testAccReplicationGroupConfig_uppercase(rName string) string { acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - node_type = "cache.t2.micro" - number_cache_clusters = 1 - port = 6379 - replication_group_description = "test description" - replication_group_id = %[1]q - subnet_group_name = aws_elasticache_subnet_group.test.name + node_type = "cache.t2.micro" + num_cache_clusters = 1 + port = 6379 + description = "test description" + replication_group_id = %[1]q + subnet_group_name = aws_elasticache_subnet_group.test.name } resource "aws_elasticache_subnet_group" "test" { @@ -2735,16 +2712,14 @@ resource "aws_elasticache_subnet_group" "test" { func testAccReplicationGroupConfig_engineVersion(rName, engineVersion string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - - node_type = "cache.t3.small" - number_cache_clusters = 2 - - engine_version = %[2]q - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 2 + engine_version = %[2]q + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" } `, rName, engineVersion) } @@ -2752,14 +2727,14 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_enableSnapshotting(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" - snapshot_retention_limit = 2 + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" + snapshot_retention_limit = 2 } `, rName) } @@ -2782,13 +2757,13 @@ resource "aws_elasticache_parameter_group" "test" { } resource "aws_elasticache_replication_group" "test" { - apply_immediately = true - node_type = "cache.t3.small" - number_cache_clusters = 2 - engine_version = "6.x" - parameter_group_name = aws_elasticache_parameter_group.test[%[2]d].name - replication_group_description = "test description" - replication_group_id = %[1]q + apply_immediately = true + node_type = "cache.t3.small" + num_cache_clusters = 2 + engine_version = "6.x" + parameter_group_name = aws_elasticache_parameter_group.test[%[2]d].name + description = "test description" + replication_group_id = %[1]q } `, rName, parameterGroupNameIndex) } @@ -2796,11 +2771,11 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_updatedDescription(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "updated description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true + replication_group_id = %[1]q + description = "updated description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true } `, rName) } @@ -2808,13 +2783,13 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_updatedMaintenanceWindow(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "updated description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true - maintenance_window = "wed:03:00-wed:06:00" - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "updated description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true + maintenance_window = "wed:03:00-wed:06:00" + snapshot_window = "01:00-02:00" } `, rName) } @@ -2822,11 +2797,11 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_updatedNodeSize(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "updated description" - node_type = "cache.t3.medium" - port = 6379 - apply_immediately = true + replication_group_id = %[1]q + description = "updated description" + node_type = "cache.t3.medium" + port = 6379 + apply_immediately = true } `, rName) } @@ -2852,15 +2827,15 @@ resource "aws_elasticache_user_group" "test" { } resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" - transit_encryption_enabled = true - user_group_ids = [aws_elasticache_user_group.test[%[3]d].id] + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" + transit_encryption_enabled = true + user_group_ids = [aws_elasticache_user_group.test[%[3]d].id] } `, rName, userGroup, flag) } @@ -2870,14 +2845,14 @@ func testAccReplicationGroupConfig_inVPC(rName string) string { acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 1 - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0]] + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 1 + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0]] } resource "aws_elasticache_subnet_group" "test" { @@ -2901,19 +2876,6 @@ resource "aws_security_group" "test" { ) } -func testAccReplicationGroupConfig_multiAZNotInVPCBasic(rName string) string { - return fmt.Sprintf(` -resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - number_cache_clusters = 2 - node_type = "cache.t3.small" - automatic_failover_enabled = true - multi_az_enabled = true -} -`, rName) -} - func testAccReplicationGroupConfig_multiAZNotInVPCPreferredCacheClusterAZsNotRepeated(rName string) string { return acctest.ConfigCompose( acctest.ConfigAvailableAZsNoOptIn(), @@ -2948,40 +2910,23 @@ resource "aws_elasticache_replication_group" "test" { ) } -func testAccReplicationGroupConfig_multiAZNotInVPCDeprecatedAvailabilityZones(rName string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` -resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - number_cache_clusters = 2 - node_type = "cache.t3.small" - automatic_failover_enabled = true - multi_az_enabled = true - preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] -} -`, rName), - ) -} - func testAccReplicationGroupConfig_multiAZInVPC(rName string) string { return acctest.ConfigCompose( acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 2 - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] - automatic_failover_enabled = true - multi_az_enabled = true - snapshot_window = "02:00-03:00" - snapshot_retention_limit = 7 + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 2 + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] + automatic_failover_enabled = true + multi_az_enabled = true + snapshot_window = "02:00-03:00" + snapshot_retention_limit = 7 } resource "aws_elasticache_subnet_group" "test" { @@ -3008,12 +2953,12 @@ resource "aws_security_group" "test" { func testAccReplicationGroupConfig_multiAZNoAutomaticFailover(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - number_cache_clusters = 1 - node_type = "cache.t3.small" - automatic_failover_enabled = false - multi_az_enabled = true + replication_group_id = %[1]q + description = "test description" + num_cache_clusters = 1 + node_type = "cache.t3.small" + automatic_failover_enabled = false + multi_az_enabled = true } `, rName) } @@ -3023,20 +2968,16 @@ func testAccReplicationGroupConfig_nativeRedisClusterError(rName string) string acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.micro" - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - automatic_failover_enabled = true - - cluster_mode { - replicas_per_node_group = 1 - num_node_groups = 2 - } - - number_cache_clusters = 3 + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.micro" + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + automatic_failover_enabled = true + replicas_per_node_group = 1 + num_node_groups = 2 + num_cache_clusters = 3 } resource "aws_elasticache_subnet_group" "test" { @@ -3117,18 +3058,15 @@ resource "aws_security_group" "test" { } resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.micro" - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - automatic_failover_enabled = true - - cluster_mode { - num_node_groups = %[2]d - replicas_per_node_group = %[3]d - } + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.micro" + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + automatic_failover_enabled = true + num_node_groups = %[2]d + replicas_per_node_group = %[3]d tags = { key = "value" @@ -3143,17 +3081,14 @@ func testAccReplicationGroupConfig_nativeRedisClusterNonClusteredParameter(rName acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.medium" - automatic_failover_enabled = false - - engine_version = "6.x" - parameter_group_name = "default.redis6.x" - cluster_mode { - num_node_groups = 1 - replicas_per_node_group = 1 - } + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.medium" + automatic_failover_enabled = false + engine_version = "6.x" + parameter_group_name = "default.redis6.x" + num_node_groups = 1 + replicas_per_node_group = 1 } `, rName), ) @@ -3164,17 +3099,14 @@ func testAccReplicationGroupConfig_nativeRedisClusterSingleNode(rName string) st acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.medium" - automatic_failover_enabled = true - - engine_version = "6.x" - parameter_group_name = "default.redis6.x.cluster.on" - cluster_mode { - num_node_groups = 1 - replicas_per_node_group = 0 - } + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.medium" + automatic_failover_enabled = true + engine_version = "6.x" + parameter_group_name = "default.redis6.x.cluster.on" + num_node_groups = 1 + replicas_per_node_group = 0 } `, rName), ) @@ -3185,17 +3117,17 @@ func testAccReplicationGroupConfig_useCMKKMSKeyID(rName string) string { acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.micro" - number_cache_clusters = "1" - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - parameter_group_name = "default.redis3.2" - engine_version = "3.2.6" - at_rest_encryption_enabled = true - kms_key_id = aws_kms_key.test.arn + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.micro" + num_cache_clusters = "1" + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + parameter_group_name = "default.redis3.2" + engine_version = "3.2.6" + at_rest_encryption_enabled = true + kms_key_id = aws_kms_key.test.arn } resource "aws_elasticache_subnet_group" "test" { @@ -3228,16 +3160,16 @@ func testAccReplicationGroupConfig_enableAtRestEncryption(rName string) string { acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.micro" - number_cache_clusters = "1" - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - parameter_group_name = "default.redis3.2" - engine_version = "3.2.6" - at_rest_encryption_enabled = true + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.micro" + num_cache_clusters = "1" + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + parameter_group_name = "default.redis3.2" + engine_version = "3.2.6" + at_rest_encryption_enabled = true } resource "aws_elasticache_subnet_group" "test" { @@ -3266,17 +3198,17 @@ func testAccReplicationGroupConfig_enableAuthTokenTransitEncryption(rName string acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t2.micro" - number_cache_clusters = "1" - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] - parameter_group_name = "default.redis5.0" - engine_version = "5.0.6" - transit_encryption_enabled = true - auth_token = "%[2]s" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.micro" + num_cache_clusters = "1" + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] + parameter_group_name = "default.redis5.0" + engine_version = "5.0.6" + transit_encryption_enabled = true + auth_token = "%[2]s" } resource "aws_elasticache_subnet_group" "test" { @@ -3306,11 +3238,11 @@ func testAccReplicationGroupConfig_numberCacheClusters(rName string, numberCache testAccReplicationGroupClusterData(numberCacheClusters), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - node_type = "cache.t2.micro" - number_cache_clusters = %[2]d - replication_group_id = %[1]q - replication_group_description = "Terraform Acceptance Testing - number_cache_clusters" - subnet_group_name = aws_elasticache_subnet_group.test.name + node_type = "cache.t2.micro" + num_cache_clusters = %[2]d + replication_group_id = %[1]q + description = "Terraform Acceptance Testing - num_cache_clusters" + subnet_group_name = aws_elasticache_subnet_group.test.name tags = { key = "value" @@ -3331,13 +3263,13 @@ func testAccReplicationGroupConfig_failoverMultiAZ(rName string, numberCacheClus fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { # InvalidParameterCombination: Automatic failover is not supported for T1 and T2 cache node types. - automatic_failover_enabled = %[3]t - multi_az_enabled = %[4]t - node_type = "cache.t3.medium" - number_cache_clusters = %[2]d - replication_group_id = %[1]q - replication_group_description = "Terraform Acceptance Testing - number_cache_clusters" - subnet_group_name = aws_elasticache_subnet_group.test.name + automatic_failover_enabled = %[3]t + multi_az_enabled = %[4]t + node_type = "cache.t3.medium" + num_cache_clusters = %[2]d + replication_group_id = %[1]q + description = "Terraform Acceptance Testing - num_cache_clusters" + subnet_group_name = aws_elasticache_subnet_group.test.name } resource "aws_elasticache_subnet_group" "test" { @@ -3354,14 +3286,14 @@ func testAccReplicationGroupConfig_tags1(rName, tagKey1, tagValue1 string) strin testAccReplicationGroupClusterData(clusterCount), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = %[2]d - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = %[2]d + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" tags = { %[3]q = %[4]q @@ -3377,14 +3309,14 @@ func testAccReplicationGroupConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tag testAccReplicationGroupClusterData(clusterCount), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = %[2]d - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = %[2]d + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" tags = { %[3]q = %[4]q @@ -3401,12 +3333,12 @@ func testAccReplicationGroupConfig_versionAndTag(rName, version, tagKey1, tagVal testAccReplicationGroupClusterData(clusterCount), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = %[2]d - apply_immediately = true - engine_version = %[3]q + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = %[2]d + apply_immediately = true + engine_version = %[3]q tags = { %[4]q = %[5]q @@ -3429,10 +3361,10 @@ data "aws_elasticache_cluster" "test" { func testAccReplicationGroupConfig_finalSnapshot(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - number_cache_clusters = 1 + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 1 final_snapshot_identifier = %[1]q } @@ -3442,10 +3374,9 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_autoMinorVersionUpgrade(rName string, enable bool) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.t3.small" - + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" auto_minor_version_upgrade = %[2]t } `, rName, enable) @@ -3454,9 +3385,9 @@ resource "aws_elasticache_replication_group" "test" { func testAccReplicationGroupConfig_validationNoNodeType(rName string) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - number_cache_clusters = 1 + replication_group_id = %[1]q + description = "test description" + num_cache_clusters = 1 } `, rName) } @@ -3470,15 +3401,12 @@ func testAccReplicationGroupConfig_validationGlobalIdAndNodeType(rName string) s resource "aws_elasticache_replication_group" "test" { provider = aws - replication_group_id = "%[1]s-s" - replication_group_description = "secondary" - global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id - - subnet_group_name = aws_elasticache_subnet_group.test.name - - node_type = "cache.m5.large" - - number_cache_clusters = 1 + replication_group_id = "%[1]s-s" + description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + subnet_group_name = aws_elasticache_subnet_group.test.name + node_type = "cache.m5.large" + num_cache_clusters = 1 } resource "aws_elasticache_global_replication_group" "test" { @@ -3491,16 +3419,13 @@ resource "aws_elasticache_global_replication_group" "test" { resource "aws_elasticache_replication_group" "primary" { provider = awsalternate - replication_group_id = "%[1]s-p" - replication_group_description = "primary" - - subnet_group_name = aws_elasticache_subnet_group.primary.name - - node_type = "cache.m5.large" - - engine = "redis" - engine_version = "5.0.6" - number_cache_clusters = 1 + replication_group_id = "%[1]s-p" + description = "primary" + subnet_group_name = aws_elasticache_subnet_group.primary.name + node_type = "cache.m5.large" + engine = "redis" + engine_version = "5.0.6" + num_cache_clusters = 1 } `, rName), ) @@ -3513,11 +3438,10 @@ func testAccReplicationGroupConfig_globalIDBasic(rName string) string { testAccVPCBaseWithProvider(rName, "primary", acctest.ProviderNameAlternate, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = "%[1]s-s" - replication_group_description = "secondary" - global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id - - subnet_group_name = aws_elasticache_subnet_group.test.name + replication_group_id = "%[1]s-s" + description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + subnet_group_name = aws_elasticache_subnet_group.test.name } resource "aws_elasticache_global_replication_group" "test" { @@ -3530,16 +3454,13 @@ resource "aws_elasticache_global_replication_group" "test" { resource "aws_elasticache_replication_group" "primary" { provider = awsalternate - replication_group_id = "%[1]s-p" - replication_group_description = "primary" - - subnet_group_name = aws_elasticache_subnet_group.primary.name - - node_type = "cache.m5.large" - - engine = "redis" - engine_version = "5.0.6" - number_cache_clusters = 2 + replication_group_id = "%[1]s-p" + description = "primary" + subnet_group_name = aws_elasticache_subnet_group.primary.name + node_type = "cache.m5.large" + engine = "redis" + engine_version = "5.0.6" + num_cache_clusters = 2 } `, rName), ) @@ -3552,17 +3473,14 @@ func testAccReplicationGroupConfig_globalIDFull(rName string, numCacheClusters i testAccVPCBaseWithProvider(rName, "primary", acctest.ProviderNameAlternate, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = "%[1]s-s" - replication_group_description = "secondary" - global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id - - subnet_group_name = aws_elasticache_subnet_group.test.name - - number_cache_clusters = %[2]d - automatic_failover_enabled = true - multi_az_enabled = true - - port = 16379 + replication_group_id = "%[1]s-s" + description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + subnet_group_name = aws_elasticache_subnet_group.test.name + num_cache_clusters = %[2]d + automatic_failover_enabled = true + multi_az_enabled = true + port = 16379 } resource "aws_elasticache_global_replication_group" "test" { @@ -3575,16 +3493,13 @@ resource "aws_elasticache_global_replication_group" "test" { resource "aws_elasticache_replication_group" "primary" { provider = awsalternate - replication_group_id = "%[1]s-p" - replication_group_description = "primary" - - subnet_group_name = aws_elasticache_subnet_group.primary.name - - node_type = "cache.m5.large" - + replication_group_id = "%[1]s-p" + description = "primary" + subnet_group_name = aws_elasticache_subnet_group.primary.name + node_type = "cache.m5.large" engine = "redis" engine_version = "5.0.6" - number_cache_clusters = 2 + num_cache_clusters = 2 automatic_failover_enabled = true multi_az_enabled = true @@ -3604,16 +3519,12 @@ func testAccReplicationGroupConfig_globalIDClusterMode(rName string, primaryRepl testAccVPCBaseWithProvider(rName, "primary", acctest.ProviderNameAlternate, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = "%[1]s-s" - replication_group_description = "secondary" - global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id - - subnet_group_name = aws_elasticache_subnet_group.test.name - - automatic_failover_enabled = true - cluster_mode { - replicas_per_node_group = %[3]d - } + replication_group_id = "%[1]s-s" + description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + subnet_group_name = aws_elasticache_subnet_group.test.name + automatic_failover_enabled = true + replicas_per_node_group = %[3]d } resource "aws_elasticache_global_replication_group" "test" { @@ -3626,22 +3537,16 @@ resource "aws_elasticache_global_replication_group" "test" { resource "aws_elasticache_replication_group" "primary" { provider = awsalternate - replication_group_id = "%[1]s-p" - replication_group_description = "primary" - - subnet_group_name = aws_elasticache_subnet_group.primary.name - - engine = "redis" - engine_version = "6.2" - node_type = "cache.m5.large" - - parameter_group_name = "default.redis6.x.cluster.on" - + replication_group_id = "%[1]s-p" + description = "primary" + subnet_group_name = aws_elasticache_subnet_group.primary.name + engine = "redis" + engine_version = "6.2" + node_type = "cache.m5.large" + parameter_group_name = "default.redis6.x.cluster.on" automatic_failover_enabled = true - cluster_mode { - num_node_groups = 2 - replicas_per_node_group = %[2]d - } + num_node_groups = 2 + replicas_per_node_group = %[2]d } `, rName, primaryReplicaCount, secondaryReplicaCount), ) @@ -3654,17 +3559,13 @@ func testAccReplicationGroupConfig_globalIDClusterModeNumNodeOnSecondary(rName s testAccVPCBaseWithProvider(rName, "primary", acctest.ProviderNameAlternate, 2), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = "%[1]s-s" - replication_group_description = "secondary" - global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id - - subnet_group_name = aws_elasticache_subnet_group.test.name - - automatic_failover_enabled = true - cluster_mode { - num_node_groups = 2 - replicas_per_node_group = 1 - } + replication_group_id = "%[1]s-s" + description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + subnet_group_name = aws_elasticache_subnet_group.test.name + automatic_failover_enabled = true + num_node_groups = 2 + replicas_per_node_group = 1 } resource "aws_elasticache_global_replication_group" "test" { @@ -3677,22 +3578,16 @@ resource "aws_elasticache_global_replication_group" "test" { resource "aws_elasticache_replication_group" "primary" { provider = awsalternate - replication_group_id = "%[1]s-p" - replication_group_description = "primary" - - subnet_group_name = aws_elasticache_subnet_group.primary.name - - engine = "redis" - engine_version = "6.2" - node_type = "cache.m5.large" - - parameter_group_name = "default.redis6.x.cluster.on" - + replication_group_id = "%[1]s-p" + description = "primary" + subnet_group_name = aws_elasticache_subnet_group.primary.name + engine = "redis" + engine_version = "6.2" + node_type = "cache.m5.large" + parameter_group_name = "default.redis6.x.cluster.on" automatic_failover_enabled = true - cluster_mode { - num_node_groups = 2 - replicas_per_node_group = 1 - } + num_node_groups = 2 + replicas_per_node_group = 1 } `, rName), ) @@ -3703,13 +3598,13 @@ func testAccReplicationGroupConfig_dataTiering(rName string) string { acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - replication_group_description = "test description" - node_type = "cache.r6gd.xlarge" - data_tiering_enabled = true - port = 6379 - subnet_group_name = aws_elasticache_subnet_group.test.name - security_group_ids = [aws_security_group.test.id] + replication_group_id = %[1]q + description = "test description" + node_type = "cache.r6gd.xlarge" + data_tiering_enabled = true + port = 6379 + subnet_group_name = aws_elasticache_subnet_group.test.name + security_group_ids = [aws_security_group.test.id] } resource "aws_elasticache_subnet_group" "test" { @@ -3818,23 +3713,19 @@ resource "aws_kinesis_firehose_delivery_stream" "ds" { } resource "aws_elasticache_replication_group" "test" { - replication_group_id = "%[1]s" - replication_group_description = "test description" - node_type = "cache.t3.small" - port = 6379 - apply_immediately = true - maintenance_window = "tue:06:30-tue:07:30" - snapshot_window = "01:00-02:00" - engine_version = "6.x" - parameter_group_name = tobool("%[2]t") ? "default.redis6.x.cluster.on" : "default.redis6.x" - automatic_failover_enabled = tobool("%[2]t") - dynamic "cluster_mode" { - for_each = tobool("%[2]t") ? [""] : [] - content { - num_node_groups = 1 - replicas_per_node_group = 0 - } - } + replication_group_id = "%[1]s" + description = "test description" + node_type = "cache.t3.small" + port = 6379 + apply_immediately = true + maintenance_window = "tue:06:30-tue:07:30" + snapshot_window = "01:00-02:00" + engine_version = "6.x" + parameter_group_name = tobool("%[2]t") ? "default.redis6.x.cluster.on" : "default.redis6.x" + automatic_failover_enabled = tobool("%[2]t") + num_node_groups = tobool("%[2]t") ? 1 : null + replicas_per_node_group = tobool("%[2]t") ? 0 : null + dynamic "log_delivery_configuration" { for_each = tobool("%[3]t") ? [""] : [] content { From 2240456ab0f4658cc241e122d3c5efabe6a580da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 27 Apr 2023 15:41:57 -0400 Subject: [PATCH 120/304] Remove deprecated arguments in docs, tests --- .../replication_group_data_source_test.go | 16 ++++++++-------- .../elasticache_replication_group.html.markdown | 2 -- .../elasticache_replication_group.html.markdown | 12 ++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/internal/service/elasticache/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index c53151fcd181..245c6c1c8536 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -157,14 +157,14 @@ func TestAccElastiCacheReplicationGroupDataSource_Engine_Redis_LogDeliveryConfig func testAccReplicationGroupDataSourceConfig_basic(rName string) string { return acctest.ConfigAvailableAZsNoOptIn() + fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_id = %[1]q - description = "test description" - node_type = "cache.t3.small" - num_cache_clusters = 2 - port = 6379 - availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] - automatic_failover_enabled = true - snapshot_window = "01:00-02:00" + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t3.small" + num_cache_clusters = 2 + port = 6379 + preferred_cache_cluster_azs = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] + automatic_failover_enabled = true + snapshot_window = "01:00-02:00" } data "aws_elasticache_replication_group" "test" { diff --git a/website/docs/d/elasticache_replication_group.html.markdown b/website/docs/d/elasticache_replication_group.html.markdown index ffb714658bf3..75e52661600a 100644 --- a/website/docs/d/elasticache_replication_group.html.markdown +++ b/website/docs/d/elasticache_replication_group.html.markdown @@ -35,11 +35,9 @@ In addition to all arguments above, the following attributes are exported: * `node_type` – The cluster node type. * `num_cache_clusters` – The number of cache clusters that the replication group has. * `num_node_groups` - Number of node groups (shards) for the replication group. -* `number_cache_clusters` – (**Deprecated** use `num_cache_clusters` instead) Number of cache clusters that the replication group has. * `member_clusters` - Identifiers of all the nodes that are part of this replication group. * `multi_az_enabled` - Whether Multi-AZ Support is enabled for the replication group. * `replicas_per_node_group` - Number of replica nodes in each node group. -* `replication_group_description` - (**Deprecated** use `description` instead) Description of the replication group. * `log_delivery_configuration` - Redis [SLOWLOG](https://redis.io/commands/slowlog) or Redis [Engine Log](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log) delivery settings. * `snapshot_window` - Daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group (shard). * `snapshot_retention_limit` - The number of days for which ElastiCache retains automatic cache cluster snapshots before deleting them. diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 8f6beac3e810..76aa72689941 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -168,7 +168,6 @@ The following arguments are required: * `description` – (Required) User-created description for the replication group. Must not be empty. * `replication_group_id` – (Required) Replication group identifier. This parameter is stored as a lowercase string. -* `replication_group_description` – (**Deprecated** use `description` instead) User-created description for the replication group. Must not be empty. The following arguments are optional: @@ -179,7 +178,6 @@ The following arguments are optional: Only supported for engine type `"redis"` and if the engine version is 6 or higher. Defaults to `true`. * `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, `num_cache_clusters` must be greater than 1. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. -* `cluster_mode` - (Optional, **Deprecated** use root-level `num_node_groups` and `replicas_per_node_group` instead) Create a native Redis cluster. `automatic_failover_enabled` must be set to true. Cluster Mode documented below. Only 1 `cluster_mode` block is allowed. Note that configuring this block does not enable cluster mode, i.e., data sharding, this requires using a parameter group that has the parameter `cluster-enabled` set to true. * `data_tiering_enabled` - (Optional) Enables data tiering. Data tiering is only supported for replication groups using the r6gd node type. This parameter must be set to `true` when using r6gd nodes. * `engine` - (Optional) Name of the cache engine to be used for the clusters in this replication group. The only valid value is `redis`. * `engine_version` - (Optional) Version number of the cache engine to be used for the cache clusters in this replication group. @@ -188,15 +186,14 @@ The following arguments are optional: Otherwise, specify the full version desired, e.g., `5.0.6`. The actual engine version used is returned in the attribute `engine_version_actual`, see [Attributes Reference](#attributes-reference) below. * `final_snapshot_identifier` - (Optional) The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made. -* `global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. If `global_replication_group_id` is set, the `num_node_groups` parameter (or the `num_node_groups` parameter of the deprecated `cluster_mode` block) cannot be set. +* `global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. If `global_replication_group_id` is set, the `num_node_groups` parameter cannot be set. * `kms_key_id` - (Optional) The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true`. * `log_delivery_configuration` - (Optional, Redis only) Specifies the destination and format of Redis [SLOWLOG](https://redis.io/commands/slowlog) or Redis [Engine Log](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log). See the documentation on [Amazon ElastiCache](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log). See [Log Delivery Configuration](#log-delivery-configuration) below for more details. * `maintenance_window` – (Optional) Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example: `sun:05:00-sun:09:00` * `multi_az_enabled` - (Optional) Specifies whether to enable Multi-AZ Support for the replication group. If `true`, `automatic_failover_enabled` must also be enabled. Defaults to `false`. * `node_type` - (Optional) Instance class to be used. See AWS documentation for information on [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html) and [guidance on selecting node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes-select-size.html). Required unless `global_replication_group_id` is set. Cannot be set if `global_replication_group_id` is set. * `notification_topic_arn` – (Optional) ARN of an SNS topic to send ElastiCache notifications to. Example: `arn:aws:sns:us-east-1:012345678999:my_sns_topic` -* `number_cache_clusters` - (Optional, **Deprecated** use `num_cache_clusters` instead) Number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. Conflicts with `num_cache_clusters`, `num_node_groups`, or the deprecated `cluster_mode`. Defaults to `1`. -* `num_cache_clusters` - (Optional) Number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. Conflicts with `num_node_groups`, the deprecated`number_cache_clusters`, or the deprecated `cluster_mode`. Defaults to `1`. +* `num_cache_clusters` - (Optional) Number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. Conflicts with `num_node_groups`. Defaults to `1`. * `num_node_groups` - (Optional) Number of node groups (shards) for this Redis replication group. Changing this number will trigger a resizing operation before other settings modifications. * `parameter_group_name` - (Optional) Name of the parameter group to associate with this replication group. If this argument is omitted, the default cache parameter group for the specified engine is used. To enable "cluster mode", i.e., data sharding, use a parameter group that has the parameter `cluster-enabled` set to true. @@ -216,11 +213,6 @@ The following arguments are optional: * `transit_encryption_enabled` - (Optional) Whether to enable encryption in transit. * `user_group_ids` - (Optional) User Group ID to associate with the replication group. Only a maximum of one (1) user group ID is valid. **NOTE:** This argument _is_ a set because the AWS specification allows for multiple IDs. However, in practice, AWS only allows a maximum size of one. -### cluster_mode (**DEPRECATED**) - -* `num_node_groups` - (Optional, **Deprecated** use root-level `num_node_groups` instead) Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications. Required unless `global_replication_group_id` is set. -* `replicas_per_node_group` - (Optional, Required with `cluster_mode` `num_node_groups`, **Deprecated** use root-level `replicas_per_node_group` instead) Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will trigger an online resizing operation before other settings modifications. - ### Log Delivery Configuration The `log_delivery_configuration` block allows the streaming of Redis [SLOWLOG](https://redis.io/commands/slowlog) or Redis [Engine Log](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Log_Delivery.html#Log_contents-engine-log) to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks. From af5791892fb97404ed122b75e0eb63fc8f76cc79 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 27 Apr 2023 15:55:03 -0400 Subject: [PATCH 121/304] Update changelog --- .changelog/31008.txt | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.changelog/31008.txt b/.changelog/31008.txt index e7c4dfd34d3a..cdc983495494 100644 --- a/.changelog/31008.txt +++ b/.changelog/31008.txt @@ -1,7 +1,35 @@ ```release-note:breaking-change -resource/aws_elasticache_replication_group: Removed `availability_zones` argument -- use `preferred_cache_cluster_azs` instead +resource/aws_elasticache_replication_group: Remove `availability_zones`, `number_cache_clusters`, `replication_group_description` arguments -- use `preferred_cache_cluster_azs`, `num_cache_clusters`, and `description`, respectively, instead +``` + +```release-note:breaking-change +resource/aws_elasticache_replication_group: Remove `cluster_mode` configuration block -- use top-level `num_node_groups` and `replicas_per_node_group` instead +``` + +```release-note:note +resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument +``` + +```release-note:note +resource/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument +``` + +```release-note:note +resource/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument +``` + +```release-note:note +resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively +``` + +```release-note:breaking-change +data-source/aws_elasticache_replication_group: Remove `number_cache_clusters`, `replication_group_description` arguments -- use `num_cache_clusters`, and `description`, respectively, instead +``` + +```release-note:note +data-source/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ``` ```release-note:note -resource/aws_elasticache_replication_group: Update configurations to use the `preferred_cache_cluster_azs` instead of the `availability_zones` argument +data-source/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ``` \ No newline at end of file From ea4db2c73d68bf6fc18f7ae5a776e7552c1caf52 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 28 Apr 2023 12:52:42 +0000 Subject: [PATCH 122/304] Update CHANGELOG.md for #31046 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d2e2717808c..bd28eadde53b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,10 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +BUG FIXES: + +* resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) + ## 4.65.0 (April 27, 2023) NOTES: From 086f3f19e48b780d7abefba9085d2b555f832bc0 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 27 Apr 2023 16:03:29 -0500 Subject: [PATCH 123/304] aws_medialive_multiplex_program: remove statemux attribute --- .../service/medialive/multiplex_program.go | 139 +++--------------- 1 file changed, 21 insertions(+), 118 deletions(-) diff --git a/internal/service/medialive/multiplex_program.go b/internal/service/medialive/multiplex_program.go index 29621e8e4ad5..a026bf740a31 100644 --- a/internal/service/medialive/multiplex_program.go +++ b/internal/service/medialive/multiplex_program.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-provider-aws/internal/create" "github.com/hashicorp/terraform-provider-aws/internal/enum" + "github.com/hashicorp/terraform-provider-aws/internal/flex" "github.com/hashicorp/terraform-provider-aws/internal/framework" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" @@ -112,37 +113,6 @@ func (m *multiplexProgram) Schema(ctx context.Context, req resource.SchemaReques }, }, Blocks: map[string]schema.Block{ - "statemux_settings": schema.ListNestedBlock{ - DeprecationMessage: "Configure statmux_settings instead of statemux_settings. This block will be removed in the next major version of the provider.", - Validators: []validator.List{ - listvalidator.SizeAtMost(1), - }, - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "minimum_bitrate": schema.Int64Attribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.Int64{ - int64planmodifier.UseStateForUnknown(), - }, - }, - "maximum_bitrate": schema.Int64Attribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.Int64{ - int64planmodifier.UseStateForUnknown(), - }, - }, - "priority": schema.Int64Attribute{ - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.Int64{ - int64planmodifier.UseStateForUnknown(), - }, - }, - }, - }, - }, "statmux_settings": schema.ListNestedBlock{ Validators: []validator.List{ listvalidator.SizeAtMost(1), @@ -208,7 +178,7 @@ func (m *multiplexProgram) Create(ctx context.Context, req resource.CreateReques return } - mpSettings, isStateMuxSet, err := expandMultiplexProgramSettings(ctx, mps) + mpSettings, err := expandMultiplexProgramSettings(ctx, mps) resp.Diagnostics.Append(err...) if resp.Diagnostics.HasError() { @@ -229,10 +199,10 @@ func (m *multiplexProgram) Create(ctx context.Context, req resource.CreateReques var result resourceMultiplexProgramData - result.ID = types.StringValue(fmt.Sprintf("%s/%s", programName, multiplexId)) + result.ID = flex.StringValueToFramework(ctx, fmt.Sprintf("%s/%s", programName, multiplexId)) result.ProgramName = types.StringValue(aws.ToString(out.MultiplexProgram.ProgramName)) result.MultiplexID = types.StringValue(plan.MultiplexID.ValueString()) - result.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgram.MultiplexProgramSettings, isStateMuxSet) + result.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgram.MultiplexProgramSettings) resp.Diagnostics.Append(resp.State.Set(ctx, result)...) @@ -290,13 +260,7 @@ func (m *multiplexProgram) Read(ctx context.Context, req resource.ReadRequest, r return } - var stateMuxIsNull bool - if len(sm) > 0 { - if len(sm[0].StatemuxSettings.Elements()) == 0 { - stateMuxIsNull = true - } - } - state.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings, stateMuxIsNull) + state.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings) state.ProgramName = types.StringValue(aws.ToString(out.ProgramName)) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) @@ -332,7 +296,7 @@ func (m *multiplexProgram) Update(ctx context.Context, req resource.UpdateReques return } - mpSettings, stateMuxIsNull, errExpand := expandMultiplexProgramSettings(ctx, mps) + mpSettings, errExpand := expandMultiplexProgramSettings(ctx, mps) resp.Diagnostics.Append(errExpand...) if resp.Diagnostics.HasError() { @@ -366,7 +330,7 @@ func (m *multiplexProgram) Update(ctx context.Context, req resource.UpdateReques return } - plan.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings, stateMuxIsNull) + plan.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings) resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } @@ -413,41 +377,6 @@ func (m *multiplexProgram) ImportState(ctx context.Context, req resource.ImportS resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } -func (m *multiplexProgram) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse) { - var data resourceMultiplexProgramData - - resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) - - if resp.Diagnostics.HasError() { - return - } - - mps := make([]multiplexProgramSettings, 1) - resp.Diagnostics.Append(data.MultiplexProgramSettings.ElementsAs(ctx, &mps, false)...) - if resp.Diagnostics.HasError() { - return - } - - if len(mps[0].VideoSettings.Elements()) > 0 || !mps[0].VideoSettings.IsNull() { - vs := make([]videoSettings, 1) - resp.Diagnostics.Append(mps[0].VideoSettings.ElementsAs(ctx, &vs, false)...) - if resp.Diagnostics.HasError() { - return - } - - statMuxSet := len(vs[0].StatmuxSettings.Elements()) > 0 - stateMuxSet := len(vs[0].StatemuxSettings.Elements()) > 0 - - if statMuxSet && stateMuxSet { - resp.Diagnostics.AddAttributeError( - path.Root("multiplex_program_settings").AtListIndex(0).AtName("video_settings").AtListIndex(0).AtName("statmux_settings"), - "Conflicting Attribute Configuration", - "Attribute statmux_settings cannot be configured with statemux_settings.", - ) - } - } -} - func FindMultiplexProgramByID(ctx context.Context, conn *medialive.Client, multiplexId, programName string) (*medialive.DescribeMultiplexProgramOutput, error) { in := &medialive.DescribeMultiplexProgramInput{ MultiplexId: aws.String(multiplexId), @@ -473,12 +402,11 @@ func FindMultiplexProgramByID(ctx context.Context, conn *medialive.Client, multi return out, nil } -func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramSettings) (*mltypes.MultiplexProgramSettings, bool, diag.Diagnostics) { +func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramSettings) (*mltypes.MultiplexProgramSettings, diag.Diagnostics) { if len(mps) == 0 { - return nil, false, nil + return nil, nil } - var stateMuxIsNull bool data := mps[0] l := &mltypes.MultiplexProgramSettings{ @@ -490,7 +418,7 @@ func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramS sd := make([]serviceDescriptor, 1) err := data.ServiceDescriptor.ElementsAs(ctx, &sd, false) if err.HasError() { - return nil, false, err + return nil, err } l.ServiceDescriptor = &mltypes.MultiplexProgramServiceDescriptor{ @@ -503,34 +431,18 @@ func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramS vs := make([]videoSettings, 1) err := data.VideoSettings.ElementsAs(ctx, &vs, false) if err.HasError() { - return nil, false, err + return nil, err } l.VideoSettings = &mltypes.MultiplexVideoSettings{ ConstantBitrate: int32(vs[0].ConstantBitrate.ValueInt64()), } - // Deprecated: will be removed in the next major version - if len(vs[0].StatemuxSettings.Elements()) > 0 && !vs[0].StatemuxSettings.IsNull() { - sms := make([]statmuxSettings, 1) - err := vs[0].StatemuxSettings.ElementsAs(ctx, &sms, false) - if err.HasError() { - return nil, false, err - } - - l.VideoSettings.StatmuxSettings = &mltypes.MultiplexStatmuxVideoSettings{ - MinimumBitrate: int32(sms[0].MinimumBitrate.ValueInt64()), - MaximumBitrate: int32(sms[0].MaximumBitrate.ValueInt64()), - Priority: int32(sms[0].Priority.ValueInt64()), - } - } - if len(vs[0].StatmuxSettings.Elements()) > 0 && !vs[0].StatmuxSettings.IsNull() { - stateMuxIsNull = true sms := make([]statmuxSettings, 1) err := vs[0].StatmuxSettings.ElementsAs(ctx, &sms, false) if err.HasError() { - return nil, false, err + return nil, err } l.VideoSettings.StatmuxSettings = &mltypes.MultiplexStatmuxVideoSettings{ @@ -541,7 +453,7 @@ func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramS } } - return l, stateMuxIsNull, nil + return l, nil } var ( @@ -552,9 +464,8 @@ var ( } videoSettingsAttrs = map[string]attr.Type{ - "constant_bitrate": types.Int64Type, - "statemux_settings": types.ListType{ElemType: types.ObjectType{AttrTypes: statmuxAttrs}}, - "statmux_settings": types.ListType{ElemType: types.ObjectType{AttrTypes: statmuxAttrs}}, + "constant_bitrate": types.Int64Type, + "statmux_settings": types.ListType{ElemType: types.ObjectType{AttrTypes: statmuxAttrs}}, } serviceDescriptorAttrs = map[string]attr.Type{ @@ -570,7 +481,7 @@ var ( } ) -func flattenMultiplexProgramSettings(mps *mltypes.MultiplexProgramSettings, stateMuxIsNull bool) types.List { +func flattenMultiplexProgramSettings(mps *mltypes.MultiplexProgramSettings) types.List { elemType := types.ObjectType{AttrTypes: multiplexProgramSettingsAttrs} if mps == nil { @@ -581,7 +492,7 @@ func flattenMultiplexProgramSettings(mps *mltypes.MultiplexProgramSettings, stat attrs["program_number"] = types.Int64Value(int64(mps.ProgramNumber)) attrs["preferred_channel_pipeline"] = types.StringValue(string(mps.PreferredChannelPipeline)) attrs["service_descriptor"] = flattenServiceDescriptor(mps.ServiceDescriptor) - attrs["video_settings"] = flattenVideoSettings(mps.VideoSettings, stateMuxIsNull) + attrs["video_settings"] = flattenVideoSettings(mps.VideoSettings) vals := types.ObjectValueMust(multiplexProgramSettingsAttrs, attrs) @@ -621,7 +532,7 @@ func flattenStatMuxSettings(mps *mltypes.MultiplexStatmuxVideoSettings) types.Li return types.ListValueMust(elemType, []attr.Value{vals}) } -func flattenVideoSettings(mps *mltypes.MultiplexVideoSettings, stateMuxIsNull bool) types.List { +func flattenVideoSettings(mps *mltypes.MultiplexVideoSettings) types.List { elemType := types.ObjectType{AttrTypes: videoSettingsAttrs} if mps == nil { @@ -630,14 +541,7 @@ func flattenVideoSettings(mps *mltypes.MultiplexVideoSettings, stateMuxIsNull bo attrs := map[string]attr.Value{} attrs["constant_bitrate"] = types.Int64Value(int64(mps.ConstantBitrate)) - - if stateMuxIsNull { - attrs["statmux_settings"] = flattenStatMuxSettings(mps.StatmuxSettings) - attrs["statemux_settings"] = types.ListValueMust(types.ObjectType{AttrTypes: statmuxAttrs}, []attr.Value{}) - } else { - attrs["statmux_settings"] = types.ListValueMust(types.ObjectType{AttrTypes: statmuxAttrs}, []attr.Value{}) - attrs["statemux_settings"] = flattenStatMuxSettings(mps.StatmuxSettings) - } + attrs["statmux_settings"] = flattenStatMuxSettings(mps.StatmuxSettings) vals := types.ObjectValueMust(videoSettingsAttrs, attrs) @@ -678,9 +582,8 @@ type serviceDescriptor struct { } type videoSettings struct { - ConstantBitrate types.Int64 `tfsdk:"constant_bitrate"` - StatemuxSettings types.List `tfsdk:"statemux_settings"` // Deprecated: will be removed in the next major version - StatmuxSettings types.List `tfsdk:"statmux_settings"` + ConstantBitrate types.Int64 `tfsdk:"constant_bitrate"` + StatmuxSettings types.List `tfsdk:"statmux_settings"` } type statmuxSettings struct { From 875e9c324bb5aab55fdc77e0c19c9504369d4a5f Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 27 Apr 2023 16:34:40 -0500 Subject: [PATCH 124/304] use flex package --- .../service/medialive/multiplex_program.go | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/internal/service/medialive/multiplex_program.go b/internal/service/medialive/multiplex_program.go index a026bf740a31..fec9ffe47cf3 100644 --- a/internal/service/medialive/multiplex_program.go +++ b/internal/service/medialive/multiplex_program.go @@ -172,13 +172,13 @@ func (m *multiplexProgram) Create(ctx context.Context, req resource.CreateReques RequestId: aws.String(id.UniqueId()), } - mps := make([]multiplexProgramSettings, 1) + mps := make(mpSettingsObject, 1) resp.Diagnostics.Append(plan.MultiplexProgramSettings.ElementsAs(ctx, &mps, false)...) if resp.Diagnostics.HasError() { return } - mpSettings, err := expandMultiplexProgramSettings(ctx, mps) + mpSettings, err := mps.expand(ctx) resp.Diagnostics.Append(err...) if resp.Diagnostics.HasError() { @@ -200,9 +200,9 @@ func (m *multiplexProgram) Create(ctx context.Context, req resource.CreateReques var result resourceMultiplexProgramData result.ID = flex.StringValueToFramework(ctx, fmt.Sprintf("%s/%s", programName, multiplexId)) - result.ProgramName = types.StringValue(aws.ToString(out.MultiplexProgram.ProgramName)) - result.MultiplexID = types.StringValue(plan.MultiplexID.ValueString()) - result.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgram.MultiplexProgramSettings) + result.ProgramName = flex.StringToFrameworkLegacy(ctx, out.MultiplexProgram.ProgramName) + result.MultiplexID = plan.MultiplexID + result.MultiplexProgramSettings = flattenMultiplexProgramSettings(ctx, out.MultiplexProgram.MultiplexProgramSettings) resp.Diagnostics.Append(resp.State.Set(ctx, result)...) @@ -251,16 +251,7 @@ func (m *multiplexProgram) Read(ctx context.Context, req resource.ReadRequest, r return } - sm := make([]videoSettings, 1) - attErr := req.State.GetAttribute(ctx, path.Root("multiplex_program_settings"). - AtListIndex(0).AtName("video_settings"), &sm) - - resp.Diagnostics.Append(attErr...) - if resp.Diagnostics.HasError() { - return - } - - state.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings) + state.MultiplexProgramSettings = flattenMultiplexProgramSettings(ctx, out.MultiplexProgramSettings) state.ProgramName = types.StringValue(aws.ToString(out.ProgramName)) resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) @@ -290,13 +281,13 @@ func (m *multiplexProgram) Update(ctx context.Context, req resource.UpdateReques return } - mps := make([]multiplexProgramSettings, 1) + mps := make(mpSettingsObject, 1) resp.Diagnostics.Append(plan.MultiplexProgramSettings.ElementsAs(ctx, &mps, false)...) if resp.Diagnostics.HasError() { return } - mpSettings, errExpand := expandMultiplexProgramSettings(ctx, mps) + mpSettings, errExpand := mps.expand(ctx) resp.Diagnostics.Append(errExpand...) if resp.Diagnostics.HasError() { @@ -330,7 +321,7 @@ func (m *multiplexProgram) Update(ctx context.Context, req resource.UpdateReques return } - plan.MultiplexProgramSettings = flattenMultiplexProgramSettings(out.MultiplexProgramSettings) + plan.MultiplexProgramSettings = flattenMultiplexProgramSettings(ctx, out.MultiplexProgramSettings) resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } @@ -402,7 +393,9 @@ func FindMultiplexProgramByID(ctx context.Context, conn *medialive.Client, multi return out, nil } -func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramSettings) (*mltypes.MultiplexProgramSettings, diag.Diagnostics) { +type mpSettingsObject []multiplexProgramSettings + +func (mps mpSettingsObject) expand(ctx context.Context) (*mltypes.MultiplexProgramSettings, diag.Diagnostics) { if len(mps) == 0 { return nil, nil } @@ -422,8 +415,8 @@ func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramS } l.ServiceDescriptor = &mltypes.MultiplexProgramServiceDescriptor{ - ProviderName: aws.String(sd[0].ProviderName.ValueString()), - ServiceName: aws.String(sd[0].ServiceName.ValueString()), + ProviderName: flex.StringFromFramework(ctx, sd[0].ProviderName), + ServiceName: flex.StringFromFramework(ctx, sd[0].ServiceName), } } @@ -456,6 +449,8 @@ func expandMultiplexProgramSettings(ctx context.Context, mps []multiplexProgramS return l, nil } +type serviceDescriptorObject []serviceDescriptor + var ( statmuxAttrs = map[string]attr.Type{ "minimum_bitrate": types.Int64Type, @@ -481,7 +476,7 @@ var ( } ) -func flattenMultiplexProgramSettings(mps *mltypes.MultiplexProgramSettings) types.List { +func flattenMultiplexProgramSettings(ctx context.Context, mps *mltypes.MultiplexProgramSettings) types.List { elemType := types.ObjectType{AttrTypes: multiplexProgramSettingsAttrs} if mps == nil { @@ -490,16 +485,16 @@ func flattenMultiplexProgramSettings(mps *mltypes.MultiplexProgramSettings) type attrs := map[string]attr.Value{} attrs["program_number"] = types.Int64Value(int64(mps.ProgramNumber)) - attrs["preferred_channel_pipeline"] = types.StringValue(string(mps.PreferredChannelPipeline)) - attrs["service_descriptor"] = flattenServiceDescriptor(mps.ServiceDescriptor) - attrs["video_settings"] = flattenVideoSettings(mps.VideoSettings) + attrs["preferred_channel_pipeline"] = flex.StringValueToFrameworkLegacy(ctx, mps.PreferredChannelPipeline) + attrs["service_descriptor"] = flattenServiceDescriptor(ctx, mps.ServiceDescriptor) + attrs["video_settings"] = flattenVideoSettings(ctx, mps.VideoSettings) vals := types.ObjectValueMust(multiplexProgramSettingsAttrs, attrs) return types.ListValueMust(elemType, []attr.Value{vals}) } -func flattenServiceDescriptor(sd *mltypes.MultiplexProgramServiceDescriptor) types.List { +func flattenServiceDescriptor(ctx context.Context, sd *mltypes.MultiplexProgramServiceDescriptor) types.List { elemType := types.ObjectType{AttrTypes: serviceDescriptorAttrs} if sd == nil { @@ -507,15 +502,15 @@ func flattenServiceDescriptor(sd *mltypes.MultiplexProgramServiceDescriptor) typ } attrs := map[string]attr.Value{} - attrs["provider_name"] = types.StringValue(aws.ToString(sd.ProviderName)) - attrs["service_name"] = types.StringValue(aws.ToString(sd.ServiceName)) + attrs["provider_name"] = flex.StringToFrameworkLegacy(ctx, sd.ProviderName) + attrs["service_name"] = flex.StringToFrameworkLegacy(ctx, sd.ServiceName) vals := types.ObjectValueMust(serviceDescriptorAttrs, attrs) return types.ListValueMust(elemType, []attr.Value{vals}) } -func flattenStatMuxSettings(mps *mltypes.MultiplexStatmuxVideoSettings) types.List { +func flattenStatMuxSettings(_ context.Context, mps *mltypes.MultiplexStatmuxVideoSettings) types.List { elemType := types.ObjectType{AttrTypes: statmuxAttrs} if mps == nil { @@ -532,7 +527,7 @@ func flattenStatMuxSettings(mps *mltypes.MultiplexStatmuxVideoSettings) types.Li return types.ListValueMust(elemType, []attr.Value{vals}) } -func flattenVideoSettings(mps *mltypes.MultiplexVideoSettings) types.List { +func flattenVideoSettings(ctx context.Context, mps *mltypes.MultiplexVideoSettings) types.List { elemType := types.ObjectType{AttrTypes: videoSettingsAttrs} if mps == nil { @@ -541,7 +536,7 @@ func flattenVideoSettings(mps *mltypes.MultiplexVideoSettings) types.List { attrs := map[string]attr.Value{} attrs["constant_bitrate"] = types.Int64Value(int64(mps.ConstantBitrate)) - attrs["statmux_settings"] = flattenStatMuxSettings(mps.StatmuxSettings) + attrs["statmux_settings"] = flattenStatMuxSettings(ctx, mps.StatmuxSettings) vals := types.ObjectValueMust(videoSettingsAttrs, attrs) From c730141068d19f787d5a6e2863552dff049dc252 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 27 Apr 2023 17:07:27 -0500 Subject: [PATCH 125/304] methods for block objects --- .../service/medialive/multiplex_program.go | 66 +++++++++++++------ 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/internal/service/medialive/multiplex_program.go b/internal/service/medialive/multiplex_program.go index fec9ffe47cf3..46e2602470ca 100644 --- a/internal/service/medialive/multiplex_program.go +++ b/internal/service/medialive/multiplex_program.go @@ -172,7 +172,7 @@ func (m *multiplexProgram) Create(ctx context.Context, req resource.CreateReques RequestId: aws.String(id.UniqueId()), } - mps := make(mpSettingsObject, 1) + mps := make(multiplexProgramSettingsObject, 1) resp.Diagnostics.Append(plan.MultiplexProgramSettings.ElementsAs(ctx, &mps, false)...) if resp.Diagnostics.HasError() { return @@ -281,7 +281,7 @@ func (m *multiplexProgram) Update(ctx context.Context, req resource.UpdateReques return } - mps := make(mpSettingsObject, 1) + mps := make(multiplexProgramSettingsObject, 1) resp.Diagnostics.Append(plan.MultiplexProgramSettings.ElementsAs(ctx, &mps, false)...) if resp.Diagnostics.HasError() { return @@ -393,9 +393,9 @@ func FindMultiplexProgramByID(ctx context.Context, conn *medialive.Client, multi return out, nil } -type mpSettingsObject []multiplexProgramSettings +type multiplexProgramSettingsObject []multiplexProgramSettings -func (mps mpSettingsObject) expand(ctx context.Context) (*mltypes.MultiplexProgramSettings, diag.Diagnostics) { +func (mps multiplexProgramSettingsObject) expand(ctx context.Context) (*mltypes.MultiplexProgramSettings, diag.Diagnostics) { if len(mps) == 0 { return nil, nil } @@ -408,41 +408,32 @@ func (mps mpSettingsObject) expand(ctx context.Context) (*mltypes.MultiplexProgr } if len(data.ServiceDescriptor.Elements()) > 0 && !data.ServiceDescriptor.IsNull() { - sd := make([]serviceDescriptor, 1) + sd := make(serviceDescriptorObject, 1) err := data.ServiceDescriptor.ElementsAs(ctx, &sd, false) if err.HasError() { return nil, err } - l.ServiceDescriptor = &mltypes.MultiplexProgramServiceDescriptor{ - ProviderName: flex.StringFromFramework(ctx, sd[0].ProviderName), - ServiceName: flex.StringFromFramework(ctx, sd[0].ServiceName), - } + l.ServiceDescriptor = sd.expand(ctx) } if len(data.VideoSettings.Elements()) > 0 && !data.VideoSettings.IsNull() { - vs := make([]videoSettings, 1) + vs := make(videoSettingsObject, 1) err := data.VideoSettings.ElementsAs(ctx, &vs, false) if err.HasError() { return nil, err } - l.VideoSettings = &mltypes.MultiplexVideoSettings{ - ConstantBitrate: int32(vs[0].ConstantBitrate.ValueInt64()), - } + l.VideoSettings = vs.expand(ctx) if len(vs[0].StatmuxSettings.Elements()) > 0 && !vs[0].StatmuxSettings.IsNull() { - sms := make([]statmuxSettings, 1) + sms := make(statmuxSettingsObject, 1) err := vs[0].StatmuxSettings.ElementsAs(ctx, &sms, false) if err.HasError() { return nil, err } - l.VideoSettings.StatmuxSettings = &mltypes.MultiplexStatmuxVideoSettings{ - MinimumBitrate: int32(sms[0].MinimumBitrate.ValueInt64()), - MaximumBitrate: int32(sms[0].MaximumBitrate.ValueInt64()), - Priority: int32(sms[0].Priority.ValueInt64()), - } + l.VideoSettings.StatmuxSettings = sms.expand(ctx) } } @@ -451,6 +442,43 @@ func (mps mpSettingsObject) expand(ctx context.Context) (*mltypes.MultiplexProgr type serviceDescriptorObject []serviceDescriptor +func (sd serviceDescriptorObject) expand(ctx context.Context) *mltypes.MultiplexProgramServiceDescriptor { + if len(sd) == 0 { + return nil + } + + return &mltypes.MultiplexProgramServiceDescriptor{ + ProviderName: flex.StringFromFramework(ctx, sd[0].ProviderName), + ServiceName: flex.StringFromFramework(ctx, sd[0].ServiceName), + } +} + +type videoSettingsObject []videoSettings + +func (vs videoSettingsObject) expand(_ context.Context) *mltypes.MultiplexVideoSettings { + if len(vs) == 0 { + return nil + } + + return &mltypes.MultiplexVideoSettings{ + ConstantBitrate: int32(vs[0].ConstantBitrate.ValueInt64()), + } +} + +type statmuxSettingsObject []statmuxSettings + +func (sms statmuxSettingsObject) expand(ctx context.Context) *mltypes.MultiplexStatmuxVideoSettings { + if len(sms) == 0 { + return nil + } + + return &mltypes.MultiplexStatmuxVideoSettings{ + MaximumBitrate: int32(sms[0].MaximumBitrate.ValueInt64()), + MinimumBitrate: int32(sms[0].MinimumBitrate.ValueInt64()), + Priority: int32(sms[0].Priority.ValueInt64()), + } +} + var ( statmuxAttrs = map[string]attr.Type{ "minimum_bitrate": types.Int64Type, From 90f8592659dc7d8310ca9b56d87fcb6efcd083e2 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 27 Apr 2023 17:14:29 -0500 Subject: [PATCH 126/304] add CHANGELOG entry --- .changelog/31034.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/31034.txt diff --git a/.changelog/31034.txt b/.changelog/31034.txt new file mode 100644 index 000000000000..3bee11827122 --- /dev/null +++ b/.changelog/31034.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead +``` \ No newline at end of file From e1877defa535c61d7006a60ec2b820085885e652 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 27 Apr 2023 17:39:10 -0500 Subject: [PATCH 127/304] chore: fix linter errors --- internal/service/medialive/multiplex_program.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/medialive/multiplex_program.go b/internal/service/medialive/multiplex_program.go index 46e2602470ca..7f7f33780372 100644 --- a/internal/service/medialive/multiplex_program.go +++ b/internal/service/medialive/multiplex_program.go @@ -467,7 +467,7 @@ func (vs videoSettingsObject) expand(_ context.Context) *mltypes.MultiplexVideoS type statmuxSettingsObject []statmuxSettings -func (sms statmuxSettingsObject) expand(ctx context.Context) *mltypes.MultiplexStatmuxVideoSettings { +func (sms statmuxSettingsObject) expand(_ context.Context) *mltypes.MultiplexStatmuxVideoSettings { if len(sms) == 0 { return nil } From bb93dbbc63dbc38061cfd11d5f1f05f9d4ba9a33 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 28 Apr 2023 15:43:55 +0000 Subject: [PATCH 128/304] Update CHANGELOG.md for #31034 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd28eadde53b..a2f6d03fcb66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ BREAKING CHANGES: * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From c0fc6f9458a1dc99f0aec547e16aa1fb3a61f66d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 28 Apr 2023 14:09:15 -0400 Subject: [PATCH 129/304] r/aws_macie_member_account_association: Remove resource. --- .changelog/#####.txt | 3 + .../macie/member_account_association.go | 130 ------------------ .../macie/member_account_association_test.go | 122 ---------------- internal/service/macie/service_package_gen.go | 4 - ...e_member_account_association.html.markdown | 33 ----- 5 files changed, 3 insertions(+), 289 deletions(-) create mode 100644 .changelog/#####.txt delete mode 100644 internal/service/macie/member_account_association.go delete mode 100644 internal/service/macie/member_account_association_test.go delete mode 100644 website/docs/r/macie_member_account_association.html.markdown diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..2b5716512d24 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +provider: With the retirement of Macie Classic the `aws_macie_member_account_association` resource has been removed +``` \ No newline at end of file diff --git a/internal/service/macie/member_account_association.go b/internal/service/macie/member_account_association.go deleted file mode 100644 index 381d3e1b4a51..000000000000 --- a/internal/service/macie/member_account_association.go +++ /dev/null @@ -1,130 +0,0 @@ -package macie - -import ( - "context" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/macie" - "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" -) - -// @SDKResource("aws_macie_member_account_association") -func ResourceMemberAccountAssociation() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceMemberAccountAssociationCreate, - ReadWithoutTimeout: resourceMemberAccountAssociationRead, - DeleteWithoutTimeout: resourceMemberAccountAssociationDelete, - - Schema: map[string]*schema.Schema{ - "member_account_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, - }, - } -} - -func resourceMemberAccountAssociationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - memberAccountID := d.Get("member_account_id").(string) - input := &macie.AssociateMemberAccountInput{ - MemberAccountId: aws.String(memberAccountID), - } - - _, err := conn.AssociateMemberAccountWithContext(ctx, input) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "creating Macie Classic Member Account Association (%s): %s", memberAccountID, err) - } - - d.SetId(memberAccountID) - - return append(diags, resourceMemberAccountAssociationRead(ctx, d, meta)...) -} - -func resourceMemberAccountAssociationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - memberAccount, err := FindMemberAccountByID(ctx, conn, d.Id()) - - if !d.IsNewResource() && tfresource.NotFound(err) { - log.Printf("[WARN] Macie Classic Member Account Association (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags - } - - if err != nil { - return diag.Errorf("reading Macie Classic Member Account Association (%s): %s", d.Id(), err) - } - - d.Set("member_account_id", memberAccount.AccountId) - - return diags -} - -func resourceMemberAccountAssociationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - log.Printf("[DEBUG] Deleting Macie Classic Member Account Association: %s", d.Id()) - _, err := conn.DisassociateMemberAccountWithContext(ctx, &macie.DisassociateMemberAccountInput{ - MemberAccountId: aws.String(d.Id()), - }) - - if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is a master Macie account and cannot be disassociated") { - return diags - } - - if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "is not yet associated with Macie") { - return diags - } - - if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting Macie Classic Member Account Association (%s): %s", d.Id(), err) - } - - return diags -} - -func FindMemberAccountByID(ctx context.Context, conn *macie.Macie, id string) (*macie.MemberAccount, error) { - input := &macie.ListMemberAccountsInput{} - var output *macie.MemberAccount - - err := conn.ListMemberAccountsPagesWithContext(ctx, input, func(page *macie.ListMemberAccountsOutput, lastPage bool) bool { - if page == nil { - return !lastPage - } - - for _, v := range page.MemberAccounts { - if v != nil && aws.StringValue(v.AccountId) == id { - output = v - return false - } - } - - return !lastPage - }) - - if err != nil { - return nil, err - } - - if output == nil { - return nil, &retry.NotFoundError{} - } - - return output, nil -} diff --git a/internal/service/macie/member_account_association_test.go b/internal/service/macie/member_account_association_test.go deleted file mode 100644 index 9da2302ed2e8..000000000000 --- a/internal/service/macie/member_account_association_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package macie_test - -import ( - "context" - "fmt" - "os" - "testing" - - "github.com/aws/aws-sdk-go/service/macie" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - tfmacie "github.com/hashicorp/terraform-provider-aws/internal/service/macie" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" -) - -func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { - ctx := acctest.Context(t) - key := "MACIE_MEMBER_ACCOUNT_ID" - memberAccountID := os.Getenv(key) - if memberAccountID == "" { - t.Skipf("Environment variable %s is not set", key) - } - resourceName := "aws_macie_member_account_association.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckMemberAccountAssociationDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccMemberAccountAssociationConfig_basic(memberAccountID), - Check: resource.ComposeTestCheckFunc( - testAccCheckMemberAccountAssociationExists(ctx, resourceName), - ), - }, - }, - }) -} - -func TestAccMacieMemberAccountAssociation_self(t *testing.T) { - ctx := acctest.Context(t) - resourceName := "aws_macie_member_account_association.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: acctest.CheckDestroyNoop, - Steps: []resource.TestStep{ - { - Config: testAccMemberAccountAssociationConfig_self, - Check: resource.ComposeTestCheckFunc( - testAccCheckMemberAccountAssociationExists(ctx, resourceName), - ), - }, - }, - }) -} - -func testAccCheckMemberAccountAssociationDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_macie_member_account_association" { - continue - } - - _, err := tfmacie.FindMemberAccountByID(ctx, conn, rs.Primary.ID) - - if tfresource.NotFound(err) { - continue - } - - if err != nil { - return err - } - - return fmt.Errorf("Macie Classic Member Account Association %s still exists", rs.Primary.ID) - } - - return nil - } -} - -func testAccCheckMemberAccountAssociationExists(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) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No Macie Classic Member Account Association ID is set") - } - - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - _, err := tfmacie.FindMemberAccountByID(ctx, conn, rs.Primary.ID) - - return err - } -} - -func testAccMemberAccountAssociationConfig_basic(accountID string) string { - return fmt.Sprintf(` -resource "aws_macie_member_account_association" "test" { - member_account_id = %[1]q -} -`, accountID) -} - -const testAccMemberAccountAssociationConfig_self = ` -data "aws_caller_identity" "current" {} - -resource "aws_macie_member_account_association" "test" { - member_account_id = data.aws_caller_identity.current.account_id -} -` diff --git a/internal/service/macie/service_package_gen.go b/internal/service/macie/service_package_gen.go index 59aaae90a75e..5079161f4d45 100644 --- a/internal/service/macie/service_package_gen.go +++ b/internal/service/macie/service_package_gen.go @@ -25,10 +25,6 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { return []*types.ServicePackageSDKResource{ - { - Factory: ResourceMemberAccountAssociation, - TypeName: "aws_macie_member_account_association", - }, { Factory: ResourceS3BucketAssociation, TypeName: "aws_macie_s3_bucket_association", diff --git a/website/docs/r/macie_member_account_association.html.markdown b/website/docs/r/macie_member_account_association.html.markdown deleted file mode 100644 index b4ef31a2ee3a..000000000000 --- a/website/docs/r/macie_member_account_association.html.markdown +++ /dev/null @@ -1,33 +0,0 @@ ---- -subcategory: "Macie Classic" -layout: "aws" -page_title: "AWS: aws_macie_member_account_association" -description: |- - Associates an AWS account with Amazon Macie Classic as a member account. ---- - -# Resource: aws_macie_member_account_association - -~> **NOTE:** This resource interacts with [Amazon Macie Classic](https://docs.aws.amazon.com/macie/latest/userguide/what-is-macie.html). Macie Classic cannot be activated in new accounts. See the [FAQ](https://aws.amazon.com/macie/classic-faqs/) for more details. - -Associates an AWS account with Amazon Macie Classic as a member account. - -## Example Usage - -```terraform -resource "aws_macie_member_account_association" "example" { - member_account_id = "123456789012" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `member_account_id` - (Required) The ID of the AWS account that you want to associate with Amazon Macie Classic as a member account. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - The ID of the association. From 9b9f802903cfc9db3d9e09838666f45c021a67a8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 28 Apr 2023 14:10:32 -0400 Subject: [PATCH 130/304] r/aws_macie_s3_bucket_association: Remove resource. --- .changelog/#####.txt | 4 + .../service/macie/s3_bucket_association.go | 247 ------------------ .../macie/s3_bucket_association_test.go | 207 --------------- internal/service/macie/service_package_gen.go | 7 +- .../macie_s3_bucket_association.html.markdown | 48 ---- 5 files changed, 5 insertions(+), 508 deletions(-) delete mode 100644 internal/service/macie/s3_bucket_association.go delete mode 100644 internal/service/macie/s3_bucket_association_test.go delete mode 100644 website/docs/r/macie_s3_bucket_association.html.markdown diff --git a/.changelog/#####.txt b/.changelog/#####.txt index 2b5716512d24..bfaededbae0b 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,7 @@ ```release-note:breaking-change provider: With the retirement of Macie Classic the `aws_macie_member_account_association` resource has been removed +``` + +```release-note:breaking-change +provider: With the retirement of Macie Classic the `aws_macie_s3_bucket_association` resource has been removed ``` \ No newline at end of file diff --git a/internal/service/macie/s3_bucket_association.go b/internal/service/macie/s3_bucket_association.go deleted file mode 100644 index 0ee9b413ca41..000000000000 --- a/internal/service/macie/s3_bucket_association.go +++ /dev/null @@ -1,247 +0,0 @@ -package macie - -import ( - "context" - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/macie" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "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" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" - "github.com/hashicorp/terraform-provider-aws/internal/verify" -) - -// @SDKResource("aws_macie_s3_bucket_association") -func ResourceS3BucketAssociation() *schema.Resource { - return &schema.Resource{ - CreateWithoutTimeout: resourceS3BucketAssociationCreate, - ReadWithoutTimeout: resourceS3BucketAssociationRead, - UpdateWithoutTimeout: resourceS3BucketAssociationUpdate, - DeleteWithoutTimeout: resourceS3BucketAssociationDelete, - - Schema: map[string]*schema.Schema{ - "bucket_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "classification_type": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "continuous": { - Type: schema.TypeString, - Optional: true, - Default: macie.S3ContinuousClassificationTypeFull, - ValidateFunc: validation.StringInSlice([]string{macie.S3ContinuousClassificationTypeFull}, false), - }, - "one_time": { - Type: schema.TypeString, - Optional: true, - Default: macie.S3OneTimeClassificationTypeNone, - ValidateFunc: validation.StringInSlice([]string{macie.S3OneTimeClassificationTypeFull, macie.S3OneTimeClassificationTypeNone}, false), - }, - }, - }, - }, - "member_account_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: verify.ValidAccountID, - }, - "prefix": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - }, - } -} - -func resourceS3BucketAssociationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - input := &macie.AssociateS3ResourcesInput{ - S3Resources: []*macie.S3ResourceClassification{ - { - BucketName: aws.String(d.Get("bucket_name").(string)), - ClassificationType: expandClassificationType(d), - }, - }, - } - - if v, ok := d.GetOk("member_account_id"); ok { - input.MemberAccountId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("prefix"); ok { - input.S3Resources[0].Prefix = aws.String(v.(string)) - } - - output, err := conn.AssociateS3ResourcesWithContext(ctx, input) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association: %s", err) - } - - if len(output.FailedS3Resources) > 0 { - return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association: %s", output.FailedS3Resources[0]) - } - - d.SetId(fmt.Sprintf("%s/%s", d.Get("bucket_name"), d.Get("prefix"))) - - return append(diags, resourceS3BucketAssociationRead(ctx, d, meta)...) -} - -func resourceS3BucketAssociationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - output, err := FindS3ResourceClassificationByThreePartKey(ctx, conn, d.Get("member_account_id").(string), d.Get("bucket_name").(string), d.Get("prefix").(string)) - - if !d.IsNewResource() && tfresource.NotFound(err) { - log.Printf("[WARN] Macie Classic S3 Bucket Association (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags - } - - if err != nil { - return diag.Errorf("reading Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) - } - - d.Set("bucket_name", output.BucketName) - if err := d.Set("classification_type", flattenClassificationType(output.ClassificationType)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting classification_type: %s", err) - } - d.Set("prefix", output.Prefix) - - return diags -} - -func resourceS3BucketAssociationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - if d.HasChange("classification_type") { - input := &macie.UpdateS3ResourcesInput{ - S3ResourcesUpdate: []*macie.S3ResourceClassificationUpdate{ - { - BucketName: aws.String(d.Get("bucket_name").(string)), - ClassificationTypeUpdate: expandClassificationTypeUpdate(d), - }, - }, - } - - if v, ok := d.GetOk("member_account_id"); ok { - input.MemberAccountId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("prefix"); ok { - input.S3ResourcesUpdate[0].Prefix = aws.String(v.(string)) - } - - output, err := conn.UpdateS3ResourcesWithContext(ctx, input) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) - } - - if len(output.FailedS3Resources) > 0 { - return sdkdiag.AppendErrorf(diags, "creating Macie Classic S3 Bucket Association (%s): %s", d.Id(), output.FailedS3Resources[0]) - } - } - - return append(diags, resourceS3BucketAssociationRead(ctx, d, meta)...) -} - -func resourceS3BucketAssociationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).MacieConn() - - input := &macie.DisassociateS3ResourcesInput{ - AssociatedS3Resources: []*macie.S3Resource{ - { - BucketName: aws.String(d.Get("bucket_name").(string)), - }, - }, - } - - if v, ok := d.GetOk("member_account_id"); ok { - input.MemberAccountId = aws.String(v.(string)) - } - - if v, ok := d.GetOk("prefix"); ok { - input.AssociatedS3Resources[0].Prefix = aws.String(v.(string)) - } - - log.Printf("[DEBUG] Deleting Macie Classic S3 Bucket Association: %s", d.Id()) - output, err := conn.DisassociateS3ResourcesWithContext(ctx, input) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting Macie Classic S3 Bucket Association (%s): %s", d.Id(), err) - } - - if len(output.FailedS3Resources) > 0 { - failed := output.FailedS3Resources[0] - // { - // ErrorCode: "InvalidInputException", - // ErrorMessage: "The request was rejected. The specified S3 resource (bucket or prefix) is not associated with Macie.", - // FailedItem: { - // BucketName: "tf-macie-example-002" - // } - // } - if aws.StringValue(failed.ErrorCode) == macie.ErrCodeInvalidInputException && - strings.Contains(aws.StringValue(failed.ErrorMessage), "is not associated with Macie") { - return diags - } - - return sdkdiag.AppendErrorf(diags, "deleting Macie Classic S3 Bucket Association (%s): %s", d.Id(), failed) - } - - return diags -} - -func FindS3ResourceClassificationByThreePartKey(ctx context.Context, conn *macie.Macie, memberAccountID, bucketName, prefix string) (*macie.S3ResourceClassification, error) { - input := &macie.ListS3ResourcesInput{} - if memberAccountID != "" { - input.MemberAccountId = aws.String(memberAccountID) - } - var output *macie.S3ResourceClassification - - err := conn.ListS3ResourcesPagesWithContext(ctx, input, func(page *macie.ListS3ResourcesOutput, lastPage bool) bool { - if page == nil { - return !lastPage - } - - for _, v := range page.S3Resources { - if v != nil && aws.StringValue(v.BucketName) == bucketName && aws.StringValue(v.Prefix) == prefix { - output = v - return false - } - } - - return !lastPage - }) - - if err != nil { - return nil, err - } - - if output == nil { - return nil, &retry.NotFoundError{} - } - - return output, nil -} diff --git a/internal/service/macie/s3_bucket_association_test.go b/internal/service/macie/s3_bucket_association_test.go deleted file mode 100644 index f62c3279b12d..000000000000 --- a/internal/service/macie/s3_bucket_association_test.go +++ /dev/null @@ -1,207 +0,0 @@ -package macie_test - -import ( - "context" - "fmt" - "testing" - - "github.com/aws/aws-sdk-go/service/macie" - "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - tfmacie "github.com/hashicorp/terraform-provider-aws/internal/service/macie" - "github.com/hashicorp/terraform-provider-aws/internal/tfresource" -) - -func TestAccMacieS3BucketAssociation_basic(t *testing.T) { - ctx := acctest.Context(t) - rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) - resourceName := "aws_macie_s3_bucket_association.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccS3BucketAssociationConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "NONE"), - ), - }, - { - Config: testAccS3BucketAssociationConfig_basicOneTime(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "FULL"), - ), - }, - }, - }) -} - -func TestAccMacieS3BucketAssociation_accountIDAndPrefix(t *testing.T) { - ctx := acctest.Context(t) - rName := acctest.RandomWithPrefix(t, acctest.ResourcePrefix) - resourceName := "aws_macie_s3_bucket_association.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccS3BucketAssociationConfig_accountIDAndPrefix(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "NONE"), - ), - }, - { - Config: testAccS3BucketAssociationConfig_accountIDAndPrefixOneTime(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckS3BucketAssociationExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.continuous", "FULL"), - resource.TestCheckResourceAttr(resourceName, "classification_type.0.one_time", "FULL"), - ), - }, - }, - }) -} - -func testAccCheckS3BucketAssociationDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_macie_s3_bucket_association" { - continue - } - - _, err := tfmacie.FindS3ResourceClassificationByThreePartKey(ctx, conn, rs.Primary.Attributes["member_account_id"], rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) - - if tfresource.NotFound(err) { - continue - } - - if err != nil { - return err - } - - return fmt.Errorf(" Macie Classic S3 Bucket Association %s still exists", rs.Primary.ID) - } - - return nil - } -} - -func testAccCheckS3BucketAssociationExists(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) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No Macie Classic S3 Bucket Association ID is set") - } - - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - _, err := tfmacie.FindS3ResourceClassificationByThreePartKey(ctx, conn, rs.Primary.Attributes["member_account_id"], rs.Primary.Attributes["bucket_name"], rs.Primary.Attributes["prefix"]) - - return err - } -} - -func testAccPreCheck(ctx context.Context, t *testing.T) { - conn := acctest.Provider.Meta().(*conns.AWSClient).MacieConn() - - input := &macie.ListS3ResourcesInput{} - - _, err := conn.ListS3ResourcesWithContext(ctx, input) - - if acctest.PreCheckSkipError(err) { - t.Skipf("skipping acceptance testing: %s", err) - } - - if tfawserr.ErrMessageContains(err, macie.ErrCodeInvalidInputException, "Macie is not enabled for this AWS account") { - t.Skipf("skipping acceptance testing: %s", err) - } - - if err != nil { - t.Fatalf("unexpected PreCheck error: %s", err) - } -} - -func testAccS3BucketAssociationConfig_basic(rName string) string { - return fmt.Sprintf(` -resource "aws_s3_bucket" "test" { - bucket = %[1]q -} - -resource "aws_macie_s3_bucket_association" "test" { - bucket_name = aws_s3_bucket.test.id -} -`, rName) -} - -func testAccS3BucketAssociationConfig_basicOneTime(rName string) string { - return fmt.Sprintf(` -resource "aws_s3_bucket" "test" { - bucket = %[1]q -} - -resource "aws_macie_s3_bucket_association" "test" { - bucket_name = aws_s3_bucket.test.id - - classification_type { - one_time = "FULL" - } -} -`, rName) -} - -func testAccS3BucketAssociationConfig_accountIDAndPrefix(rName string) string { - return fmt.Sprintf(` -resource "aws_s3_bucket" "test" { - bucket = %[1]q -} - -data "aws_caller_identity" "current" {} - -resource "aws_macie_s3_bucket_association" "test" { - bucket_name = aws_s3_bucket.test.id - member_account_id = data.aws_caller_identity.current.account_id - prefix = "data" -} -`, rName) -} - -func testAccS3BucketAssociationConfig_accountIDAndPrefixOneTime(rName string) string { - return fmt.Sprintf(` -resource "aws_s3_bucket" "test" { - bucket = %[1]q -} - -data "aws_caller_identity" "current" {} - -resource "aws_macie_s3_bucket_association" "test" { - bucket_name = aws_s3_bucket.test.id - member_account_id = data.aws_caller_identity.current.account_id - prefix = "data" - - classification_type { - one_time = "FULL" - } -} -`, rName) -} diff --git a/internal/service/macie/service_package_gen.go b/internal/service/macie/service_package_gen.go index 5079161f4d45..cb4465d5f339 100644 --- a/internal/service/macie/service_package_gen.go +++ b/internal/service/macie/service_package_gen.go @@ -24,12 +24,7 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac } func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { - return []*types.ServicePackageSDKResource{ - { - Factory: ResourceS3BucketAssociation, - TypeName: "aws_macie_s3_bucket_association", - }, - } + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/website/docs/r/macie_s3_bucket_association.html.markdown b/website/docs/r/macie_s3_bucket_association.html.markdown deleted file mode 100644 index 617406423622..000000000000 --- a/website/docs/r/macie_s3_bucket_association.html.markdown +++ /dev/null @@ -1,48 +0,0 @@ ---- -subcategory: "Macie Classic" -layout: "aws" -page_title: "AWS: aws_macie_s3_bucket_association" -description: |- - Associates an S3 resource with Amazon Macie Classic for monitoring and data classification. ---- - -# Resource: aws_macie_s3_bucket_association - -~> **NOTE:** This resource interacts with [Amazon Macie Classic](https://docs.aws.amazon.com/macie/latest/userguide/what-is-macie.html). Macie Classic cannot be activated in new accounts. See the [FAQ](https://aws.amazon.com/macie/classic-faqs/) for more details. - -Associates an S3 resource with Amazon Macie Classic for monitoring and data classification. - -## Example Usage - -```terraform -resource "aws_macie_s3_bucket_association" "example" { - bucket_name = "tf-macie-example" - prefix = "data" - - classification_type { - one_time = "FULL" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `bucket_name` - (Required) The name of the S3 bucket that you want to associate with Amazon Macie Classic. -* `classification_type` - (Optional) The configuration of how Amazon Macie Classic classifies the S3 objects. -* `member_account_id` - (Optional) The ID of the Amazon Macie Classic member account whose S3 resources you want to associate with Macie. If `member_account_id` isn't specified, the action associates specified S3 resources with Macie for the current master account. -* `prefix` - (Optional) Object key prefix identifying one or more S3 objects to which the association applies. - -The `classification_type` object supports the following: - -* `continuous` - (Optional) A string value indicating that Macie perform a one-time classification of all of the existing objects in the bucket. -The only valid value is the default value, `FULL`. -* `one_time` - (Optional) A string value indicating whether or not Macie performs a one-time classification of all of the existing objects in the bucket. -Valid values are `NONE` and `FULL`. Defaults to `NONE` indicating that Macie only classifies objects that are added after the association was created. - -## Attributes Reference - -In addition to all arguments above, the following attributes are exported: - -* `id` - The ID of the association. From f5d7e16a2918d4732cfef63ebd370e966206f979 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 28 Apr 2023 14:17:16 -0400 Subject: [PATCH 131/304] Remove Macie Classic service package. --- .ci/.semgrep-service-name0.yml | 15 --- .ci/.semgrep-service-name1.yml | 29 ++--- .ci/.semgrep-service-name2.yml | 101 ++++++++---------- .ci/.semgrep-service-name3.yml | 29 ----- .../components/generated/services_all.kt | 1 - internal/provider/service_packages_gen.go | 2 - internal/service/macie/README.md | 10 -- internal/service/macie/flex.go | 48 --------- internal/service/macie/service_package_gen.go | 34 ------ 9 files changed, 58 insertions(+), 211 deletions(-) delete mode 100644 internal/service/macie/README.md delete mode 100644 internal/service/macie/flex.go delete mode 100644 internal/service/macie/service_package_gen.go diff --git a/.ci/.semgrep-service-name0.yml b/.ci/.semgrep-service-name0.yml index 0664a0f9d879..10e20096620e 100644 --- a/.ci/.semgrep-service-name0.yml +++ b/.ci/.semgrep-service-name0.yml @@ -3405,18 +3405,3 @@ rules: - pattern-regex: "(?i)ConfigService" - pattern-not-regex: ^TestAcc.* severity: WARNING - - id: configservice-in-test-name - languages: - - go - message: Include "ConfigService" in test name - paths: - include: - - internal/service/configservice/*_test.go - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-not-regex: "^TestAccConfigService" - - pattern-regex: ^TestAcc.* - severity: WARNING diff --git a/.ci/.semgrep-service-name1.yml b/.ci/.semgrep-service-name1.yml index 878b191736bb..45148c64670f 100644 --- a/.ci/.semgrep-service-name1.yml +++ b/.ci/.semgrep-service-name1.yml @@ -1,5 +1,20 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: configservice-in-test-name + languages: + - go + message: Include "ConfigService" in test name + paths: + include: + - internal/service/configservice/*_test.go + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-not-regex: "^TestAccConfigService" + - pattern-regex: ^TestAcc.* + severity: WARNING - id: configservice-in-const-name languages: - go @@ -3379,17 +3394,3 @@ rules: - pattern-regex: "(?i)inspectorv2" - pattern-not-regex: ^TestAcc.* severity: WARNING - - id: inspectorv2-in-const-name - languages: - - go - message: Do not use "inspectorv2" in const name inside inspector2 package - paths: - include: - - internal/service/inspector2 - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)inspectorv2" - severity: WARNING diff --git a/.ci/.semgrep-service-name2.yml b/.ci/.semgrep-service-name2.yml index 0aea8864a43a..26f7d500f6b1 100644 --- a/.ci/.semgrep-service-name2.yml +++ b/.ci/.semgrep-service-name2.yml @@ -1,5 +1,19 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: inspectorv2-in-const-name + languages: + - go + message: Do not use "inspectorv2" in const name inside inspector2 package + paths: + include: + - internal/service/inspector2 + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)inspectorv2" + severity: WARNING - id: inspectorv2-in-var-name languages: - go @@ -1477,64 +1491,6 @@ rules: patterns: - pattern-regex: "(?i)Logs" severity: WARNING - - id: macie-in-func-name - languages: - - go - message: Do not use "Macie" in func name inside macie package - paths: - include: - - internal/service/macie - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Macie" - - pattern-not-regex: ^TestAcc.* - severity: WARNING - - id: macie-in-test-name - languages: - - go - message: Include "Macie" in test name - paths: - include: - - internal/service/macie/*_test.go - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-not-regex: "^TestAccMacie" - - pattern-regex: ^TestAcc.* - severity: WARNING - - id: macie-in-const-name - languages: - - go - message: Do not use "Macie" in const name inside macie package - paths: - include: - - internal/service/macie - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Macie" - severity: WARNING - - id: macie-in-var-name - languages: - - go - message: Do not use "Macie" in var name inside macie package - paths: - include: - - internal/service/macie - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Macie" - severity: WARNING - id: macie2-in-func-name languages: - go @@ -3407,3 +3363,32 @@ rules: patterns: - pattern-regex: "(?i)Redshift" severity: WARNING + - id: redshift-in-var-name + languages: + - go + message: Do not use "Redshift" in var name inside redshift package + paths: + include: + - internal/service/redshift + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Redshift" + severity: WARNING + - id: redshiftdata-in-func-name + languages: + - go + message: Do not use "RedshiftData" in func name inside redshiftdata package + paths: + include: + - internal/service/redshiftdata + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)RedshiftData" + - pattern-not-regex: ^TestAcc.* + severity: WARNING diff --git a/.ci/.semgrep-service-name3.yml b/.ci/.semgrep-service-name3.yml index fdc623c690ee..6d40269a840a 100644 --- a/.ci/.semgrep-service-name3.yml +++ b/.ci/.semgrep-service-name3.yml @@ -1,34 +1,5 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: - - id: redshift-in-var-name - languages: - - go - message: Do not use "Redshift" in var name inside redshift package - paths: - include: - - internal/service/redshift - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Redshift" - severity: WARNING - - id: redshiftdata-in-func-name - languages: - - go - message: Do not use "RedshiftData" in func name inside redshiftdata package - paths: - include: - - internal/service/redshiftdata - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)RedshiftData" - - pattern-not-regex: ^TestAcc.* - severity: WARNING - id: redshiftdata-in-test-name languages: - go diff --git a/.teamcity/components/generated/services_all.kt b/.teamcity/components/generated/services_all.kt index 6ef919558283..967d5f8df039 100644 --- a/.teamcity/components/generated/services_all.kt +++ b/.teamcity/components/generated/services_all.kt @@ -120,7 +120,6 @@ val services = mapOf( "lightsail" to ServiceSpec("Lightsail", regionOverride = "us-east-1"), "location" to ServiceSpec("Location"), "logs" to ServiceSpec("CloudWatch Logs"), - "macie" to ServiceSpec("Macie Classic"), "macie2" to ServiceSpec("Macie"), "mediaconnect" to ServiceSpec("Elemental MediaConnect"), "mediaconvert" to ServiceSpec("Elemental MediaConvert"), diff --git a/internal/provider/service_packages_gen.go b/internal/provider/service_packages_gen.go index 68aad25056fa..523a637b3be7 100644 --- a/internal/provider/service_packages_gen.go +++ b/internal/provider/service_packages_gen.go @@ -128,7 +128,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" "github.com/hashicorp/terraform-provider-aws/internal/service/location" "github.com/hashicorp/terraform-provider-aws/internal/service/logs" - "github.com/hashicorp/terraform-provider-aws/internal/service/macie" "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" "github.com/hashicorp/terraform-provider-aws/internal/service/mediaconnect" "github.com/hashicorp/terraform-provider-aws/internal/service/mediaconvert" @@ -335,7 +334,6 @@ func servicePackages(context.Context) []conns.ServicePackage { lightsail.ServicePackage, location.ServicePackage, logs.ServicePackage, - macie.ServicePackage, macie2.ServicePackage, mediaconnect.ServicePackage, mediaconvert.ServicePackage, diff --git a/internal/service/macie/README.md b/internal/service/macie/README.md deleted file mode 100644 index 489d299a3363..000000000000 --- a/internal/service/macie/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Terraform AWS Provider Macie Package - -This area is primarily for AWS provider contributors and maintainers. For information on _using_ Terraform and the AWS provider, see the links below. - -## Handy Links - -* [Find out about contributing](https://hashicorp.github.io/terraform-provider-aws/#contribute) to the AWS provider! -* AWS Provider Docs: [Home](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) -* AWS Provider Docs: [One of the Macie resources](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/macie_member_account_association) -* AWS Docs: [AWS SDK for Go Macie](https://docs.aws.amazon.com/sdk-for-go/api/service/macie/) diff --git a/internal/service/macie/flex.go b/internal/service/macie/flex.go deleted file mode 100644 index d4c5817446ce..000000000000 --- a/internal/service/macie/flex.go +++ /dev/null @@ -1,48 +0,0 @@ -package macie - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/macie" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func expandClassificationType(d *schema.ResourceData) *macie.ClassificationType { - continuous := macie.S3ContinuousClassificationTypeFull - oneTime := macie.S3OneTimeClassificationTypeNone - if v := d.Get("classification_type").([]interface{}); len(v) > 0 { - m := v[0].(map[string]interface{}) - continuous = m["continuous"].(string) - oneTime = m["one_time"].(string) - } - - return &macie.ClassificationType{ - Continuous: aws.String(continuous), - OneTime: aws.String(oneTime), - } -} - -func expandClassificationTypeUpdate(d *schema.ResourceData) *macie.ClassificationTypeUpdate { - continuous := macie.S3ContinuousClassificationTypeFull - oneTime := macie.S3OneTimeClassificationTypeNone - if v := d.Get("classification_type").([]interface{}); len(v) > 0 { - m := v[0].(map[string]interface{}) - continuous = m["continuous"].(string) - oneTime = m["one_time"].(string) - } - - return &macie.ClassificationTypeUpdate{ - Continuous: aws.String(continuous), - OneTime: aws.String(oneTime), - } -} - -func flattenClassificationType(classificationType *macie.ClassificationType) []map[string]interface{} { - if classificationType == nil { - return []map[string]interface{}{} - } - m := map[string]interface{}{ - "continuous": aws.StringValue(classificationType.Continuous), - "one_time": aws.StringValue(classificationType.OneTime), - } - return []map[string]interface{}{m} -} diff --git a/internal/service/macie/service_package_gen.go b/internal/service/macie/service_package_gen.go deleted file mode 100644 index cb4465d5f339..000000000000 --- a/internal/service/macie/service_package_gen.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by internal/generate/servicepackages/main.go; DO NOT EDIT. - -package macie - -import ( - "context" - - "github.com/hashicorp/terraform-provider-aws/internal/types" - "github.com/hashicorp/terraform-provider-aws/names" -) - -type servicePackage struct{} - -func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { - return []*types.ServicePackageFrameworkDataSource{} -} - -func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { - return []*types.ServicePackageFrameworkResource{} -} - -func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { - return []*types.ServicePackageSDKDataSource{} -} - -func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { - return []*types.ServicePackageSDKResource{} -} - -func (p *servicePackage) ServicePackageName() string { - return names.Macie -} - -var ServicePackage = &servicePackage{} From 62d3b76f66e6e7f6cad6dbb481e477d48ce5d3aa Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 28 Apr 2023 14:40:34 -0400 Subject: [PATCH 132/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31058.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31058.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31058.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31058.txt From 0d450d1b7349e38d8c4f6b3843e442979ef8ff62 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 28 Apr 2023 15:32:56 -0400 Subject: [PATCH 133/304] Fix 'TestServicesForDirectories'. --- names/names_test.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/names/names_test.go b/names/names_test.go index 5c85a3e7e465..637f9cd4f2b0 100644 --- a/names/names_test.go +++ b/names/names_test.go @@ -68,30 +68,22 @@ func TestServicesForDirectories(t *testing.T) { "amplifyuibuilder", "apigatewaymanagementapi", "appconfigdata", - "appflow", - "appintegrations", "applicationcostprofiler", "applicationdiscovery", "applicationinsights", "appregistry", - "auditmanager", "augmentedairuntime", "backupgateway", "billingconductor", "braket", - "ce", "chimesdkidentity", "chimesdkmeetings", "chimesdkmessaging", "clouddirectory", "cloudsearchdomain", - "cloudwatchevidently", - "cloudwatchrum", "codeguruprofiler", - "codegurureviewer", "codestar", "cognitosync", - "comprehend", "comprehendmedical", "computeoptimizer", "connectcontactlens", @@ -118,9 +110,7 @@ func TestServicesForDirectories(t *testing.T) { "greengrassv2", "groundstation", "health", - "healthlake", "honeycode", - "inspector2", "iot1clickdevices", "iot1clickprojects", "iotdata", @@ -135,7 +125,6 @@ func TestServicesForDirectories(t *testing.T) { "iotthingsgraph", "iottwinmaker", "iotwireless", - "kendra", "kinesisvideoarchivedmedia", "kinesisvideomedia", "kinesisvideosignaling", @@ -143,12 +132,12 @@ func TestServicesForDirectories(t *testing.T) { "lexmodelsv2", "lexruntime", "lexruntimev2", - "location", "lookoutequipment", "lookoutforvision", "lookoutmetrics", "lookoutvision", "machinelearning", + "macie", "managedblockchain", "marketplacecatalog", "marketplacecommerceanalytics", @@ -179,14 +168,11 @@ func TestServicesForDirectories(t *testing.T) { "polly", "proton", "qldbsession", - "rbin", "rdsdata", - "redshiftdata", "rekognition", "resiliencehub", "robomaker", "route53recoverycluster", - "rum", "sagemakera2iruntime", "sagemakeredge", "sagemakeredgemanager", @@ -194,18 +180,14 @@ func TestServicesForDirectories(t *testing.T) { "sagemakerruntime", "savingsplans", "servicecatalogappregistry", - "sesv2", "sms", "snowball", "snowdevicemanagement", - "ssmcontacts", - "ssmincidents", "sso", "ssooidc", "support", "textract", "timestreamquery", - "transcribe", "transcribestreaming", "translate", "voiceid", From 45730d2c6f4b477566170a68678a25d434a75dc5 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 28 Apr 2023 20:21:54 +0000 Subject: [PATCH 134/304] Update CHANGELOG.md for #31058 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f6d03fcb66..9b99cc04a65c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ BREAKING CHANGES: * provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: With the retirement of Macie Classic the `aws_macie_member_account_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) +* provider: With the retirement of Macie Classic the `aws_macie_s3_bucket_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From 930509584020b9d121187d81fc98eda980f3ab4a Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 28 Apr 2023 15:55:33 -0400 Subject: [PATCH 135/304] r/aws_servicecatalog_product: provisioning_artifact_parameters changes force replacement --- internal/service/servicecatalog/product.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/service/servicecatalog/product.go b/internal/service/servicecatalog/product.go index c786ff97b775..f7ca32bc2560 100644 --- a/internal/service/servicecatalog/product.go +++ b/internal/service/servicecatalog/product.go @@ -88,19 +88,23 @@ func ResourceProduct() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "disable_template_validation": { Type: schema.TypeBool, Optional: true, + ForceNew: true, Default: false, }, "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "template_physical_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, ExactlyOneOf: []string{ "provisioning_artifact_parameters.0.template_url", "provisioning_artifact_parameters.0.template_physical_id", @@ -109,6 +113,7 @@ func ResourceProduct() *schema.Resource { "template_url": { Type: schema.TypeString, Optional: true, + ForceNew: true, ExactlyOneOf: []string{ "provisioning_artifact_parameters.0.template_url", "provisioning_artifact_parameters.0.template_physical_id", @@ -117,6 +122,7 @@ func ResourceProduct() *schema.Resource { "type": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringInSlice(servicecatalog.ProvisioningArtifactType_Values(), false), }, }, From f46a0262f018a88899dce9473bd76aac4009acb8 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 28 Apr 2023 15:59:25 -0400 Subject: [PATCH 136/304] r/aws_servicecatalog_product(test): rm unnecessary bucket acl --- internal/service/servicecatalog/product_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/service/servicecatalog/product_test.go b/internal/service/servicecatalog/product_test.go index 8809ef4cb822..63fd4324099f 100644 --- a/internal/service/servicecatalog/product_test.go +++ b/internal/service/servicecatalog/product_test.go @@ -275,11 +275,6 @@ resource "aws_s3_bucket" "test" { force_destroy = true } -resource "aws_s3_bucket_acl" "test" { - bucket = aws_s3_bucket.test.id - acl = "private" -} - resource "aws_s3_object" "test" { bucket = aws_s3_bucket.test.id key = "%[1]s.json" From dca8ae4fb3c76a51a46463601796d31bd2e69491 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 28 Apr 2023 16:13:24 -0400 Subject: [PATCH 137/304] chore: changelog --- .changelog/31061.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/31061.txt diff --git a/.changelog/31061.txt b/.changelog/31061.txt new file mode 100644 index 000000000000..80372ebb6a20 --- /dev/null +++ b/.changelog/31061.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_servicecatalog_product: Changes to `provisioning_artifact_parameters` arguments now properly trigger a replacement +``` + +```release-note:breaking-change +resource/aws_servicecatalog_product: Changes to any `provisioning_artifact_parameters` arguments now properly trigger a replacement. This fixes incorrect behavior, but may technically be breaking for configurations expecting non-functional in-place updates. +``` From 5261497ca3356f8848f29195849c789f5d9a5370 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 28 Apr 2023 21:03:25 +0000 Subject: [PATCH 138/304] Update CHANGELOG.md for #31061 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b99cc04a65c..008d2a263f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ BREAKING CHANGES: * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_security_group: With the retirement of EC2-Classic non-VPC security groups are no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_security_group_rule: With the retirement of EC2-Classic non-VPC security groups are no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_servicecatalog_product: Changes to any `provisioning_artifact_parameters` arguments now properly trigger a replacement. This fixes incorrect behavior, but may technically be breaking for configurations expecting non-functional in-place updates. ([#31061](https://github.com/hashicorp/terraform-provider-aws/issues/31061)) * resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -43,6 +44,7 @@ NOTES: BUG FIXES: +* resource/aws_servicecatalog_product: Changes to `provisioning_artifact_parameters` arguments now properly trigger a replacement ([#31061](https://github.com/hashicorp/terraform-provider-aws/issues/31061)) * resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) ## 4.65.0 (April 27, 2023) From d325bf4d0605d11667d00cb376d2b70e709d69aa Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 1 May 2023 08:34:20 -0400 Subject: [PATCH 139/304] r/aws_acmpca_certificate_authority: Remove 'status'. --- .changelog/#####.txt | 3 +++ internal/service/acmpca/certificate_authority.go | 7 ------- .../acmpca/certificate_authority_data_source_test.go | 2 -- internal/service/acmpca/certificate_authority_test.go | 8 -------- website/docs/r/acmpca_certificate_authority.html.markdown | 1 - 5 files changed, 3 insertions(+), 18 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..739753874551 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_acmpca_certificate_authority: The `status` attribute has been removed +``` \ No newline at end of file diff --git a/internal/service/acmpca/certificate_authority.go b/internal/service/acmpca/certificate_authority.go index fea9b5ab6338..d369c2befd3b 100644 --- a/internal/service/acmpca/certificate_authority.go +++ b/internal/service/acmpca/certificate_authority.go @@ -320,12 +320,6 @@ func ResourceCertificateAuthority() *schema.Resource { Type: schema.TypeString, Computed: true, }, - // See https://github.com/hashicorp/terraform-provider-aws/issues/17832 for deprecation / removal status - "status": { - Type: schema.TypeString, - Computed: true, - Deprecated: "The reported value of the \"status\" attribute is often inaccurate. Use the resource's \"enabled\" attribute to explicitly set status.", - }, names.AttrTags: tftags.TagsSchema(), names.AttrTagsAll: tftags.TagsSchemaComputed(), "type": { @@ -408,7 +402,6 @@ func resourceCertificateAuthorityRead(ctx context.Context, d *schema.ResourceDat return sdkdiag.AppendErrorf(diags, "setting revocation_configuration: %s", err) } d.Set("serial", certificateAuthority.Serial) - d.Set("status", certificateAuthority.Status) d.Set("type", certificateAuthority.Type) d.Set("usage_mode", certificateAuthority.UsageMode) diff --git a/internal/service/acmpca/certificate_authority_data_source_test.go b/internal/service/acmpca/certificate_authority_data_source_test.go index 4aa65405611d..2e03127e5e2d 100644 --- a/internal/service/acmpca/certificate_authority_data_source_test.go +++ b/internal/service/acmpca/certificate_authority_data_source_test.go @@ -39,7 +39,6 @@ func TestAccACMPCACertificateAuthorityDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(datasourceName, "revocation_configuration.0.crl_configuration.#", resourceName, "revocation_configuration.0.crl_configuration.#"), resource.TestCheckResourceAttrPair(datasourceName, "revocation_configuration.0.crl_configuration.0.enabled", resourceName, "revocation_configuration.0.crl_configuration.0.enabled"), resource.TestCheckResourceAttrPair(datasourceName, "serial", resourceName, "serial"), - resource.TestCheckResourceAttrPair(datasourceName, "status", resourceName, "status"), resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), resource.TestCheckResourceAttrPair(datasourceName, "type", resourceName, "type"), resource.TestCheckResourceAttrPair(datasourceName, "usage_mode", resourceName, "usage_mode"), @@ -82,7 +81,6 @@ func TestAccACMPCACertificateAuthorityDataSource_s3ObjectACL(t *testing.T) { resource.TestCheckResourceAttrPair(datasourceName, "revocation_configuration.0.crl_configuration.0.s3_bucket_name", resourceName, "revocation_configuration.0.crl_configuration.0.s3_bucket_name"), resource.TestCheckResourceAttrPair(datasourceName, "revocation_configuration.0.crl_configuration.0.s3_object_acl", resourceName, "revocation_configuration.0.crl_configuration.0.s3_object_acl"), resource.TestCheckResourceAttrPair(datasourceName, "serial", resourceName, "serial"), - resource.TestCheckResourceAttrPair(datasourceName, "status", resourceName, "status"), resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), resource.TestCheckResourceAttrPair(datasourceName, "type", resourceName, "type"), resource.TestCheckResourceAttrPair(datasourceName, "usage_mode", resourceName, "usage_mode"), diff --git a/internal/service/acmpca/certificate_authority_test.go b/internal/service/acmpca/certificate_authority_test.go index ce1d5a10eca4..30a20699d805 100644 --- a/internal/service/acmpca/certificate_authority_test.go +++ b/internal/service/acmpca/certificate_authority_test.go @@ -49,7 +49,6 @@ func TestAccACMPCACertificateAuthority_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "revocation_configuration.0.crl_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "revocation_configuration.0.crl_configuration.0.enabled", "false"), resource.TestCheckResourceAttr(resourceName, "serial", ""), - resource.TestCheckResourceAttr(resourceName, "status", "PENDING_CERTIFICATE"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "type", "SUBORDINATE"), resource.TestCheckResourceAttr(resourceName, "usage_mode", "SHORT_LIVED_CERTIFICATE"), @@ -106,7 +105,6 @@ func TestAccACMPCACertificateAuthority_enabledDeprecated(t *testing.T) { acctest.CheckACMPCACertificateAuthorityExists(ctx, resourceName, &certificateAuthority), resource.TestCheckResourceAttr(resourceName, "type", acmpca.CertificateAuthorityTypeRoot), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "status", acmpca.CertificateAuthorityStatusPendingCertificate), acctest.CheckACMPCACertificateAuthorityActivateRootCA(ctx, &certificateAuthority), ), }, @@ -116,7 +114,6 @@ func TestAccACMPCACertificateAuthority_enabledDeprecated(t *testing.T) { acctest.CheckACMPCACertificateAuthorityExists(ctx, resourceName, &certificateAuthority), resource.TestCheckResourceAttr(resourceName, "type", acmpca.CertificateAuthorityTypeRoot), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "status", acmpca.CertificateAuthorityStatusActive), ), }, { @@ -124,7 +121,6 @@ func TestAccACMPCACertificateAuthority_enabledDeprecated(t *testing.T) { Check: resource.ComposeTestCheckFunc( acctest.CheckACMPCACertificateAuthorityExists(ctx, resourceName, &certificateAuthority), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "status", acmpca.CertificateAuthorityStatusDisabled), ), }, { @@ -188,9 +184,6 @@ func TestAccACMPCACertificateAuthority_deleteFromActiveState(t *testing.T) { acctest.CheckACMPCACertificateAuthorityExists(ctx, resourceName, &certificateAuthority), resource.TestCheckResourceAttr(resourceName, "type", acmpca.CertificateAuthorityTypeRoot), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), - // Since the status of the CA is changed by importing the certificate in - // aws_acmpca_certificate_authority_certificate, the value of `status` is no longer accurate - // resource.TestCheckResourceAttr(resourceName, "status", acmpca.CertificateAuthorityStatusActive), ), }, }, @@ -230,7 +223,6 @@ func TestAccACMPCACertificateAuthority_RevocationConfiguration_empty(t *testing. resource.TestCheckResourceAttr(resourceName, "revocation_configuration.0.crl_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "revocation_configuration.0.crl_configuration.0.enabled", "false"), resource.TestCheckResourceAttr(resourceName, "serial", ""), - resource.TestCheckResourceAttr(resourceName, "status", "PENDING_CERTIFICATE"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "type", "SUBORDINATE"), resource.TestCheckResourceAttr(resourceName, "usage_mode", "SHORT_LIVED_CERTIFICATE"), diff --git a/website/docs/r/acmpca_certificate_authority.html.markdown b/website/docs/r/acmpca_certificate_authority.html.markdown index fb6d0cbbc2a6..e0c561cdb22b 100644 --- a/website/docs/r/acmpca_certificate_authority.html.markdown +++ b/website/docs/r/acmpca_certificate_authority.html.markdown @@ -170,7 +170,6 @@ In addition to all arguments above, the following attributes are exported: * `not_after` - Date and time after which the certificate authority is not valid. Only available after the certificate authority certificate has been imported. * `not_before` - Date and time before which the certificate authority is not valid. Only available after the certificate authority certificate has been imported. * `serial` - Serial number of the certificate authority. Only available after the certificate authority certificate has been imported. -* `status` - (**Deprecated** use the `enabled` attribute instead) Status of the certificate authority. * `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Timeouts From 4b281c8348fe3c9dd097eb87dc8a944ab202ee64 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 1 May 2023 08:37:58 -0400 Subject: [PATCH 140/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31084.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31084.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31084.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31084.txt From eb76995b47ad652b356454c1d0921856fabc1899 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 1 May 2023 13:11:06 +0000 Subject: [PATCH 141/304] Update CHANGELOG.md for #31084 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 008d2a263f62..b55d05dd1ba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ BREAKING CHANGES: * provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of Macie Classic the `aws_macie_member_account_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) * provider: With the retirement of Macie Classic the `aws_macie_s3_bucket_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) +* resource/aws_acmpca_certificate_authority: The `status` attribute has been removed ([#31084](https://github.com/hashicorp/terraform-provider-aws/issues/31084)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From 05eb86ae279e409889cae2cca79fcd42e9a9eab5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 1 May 2023 09:34:08 -0400 Subject: [PATCH 142/304] r/aws_spot_instance_request: 'instance_interruption_behaviour' was NOT deprecated in v4.0.0. --- website/docs/guides/version-4-upgrade.html.md | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/website/docs/guides/version-4-upgrade.html.md b/website/docs/guides/version-4-upgrade.html.md index 0ae9e3a3ff5c..f07ae69e447d 100644 --- a/website/docs/guides/version-4-upgrade.html.md +++ b/website/docs/guides/version-4-upgrade.html.md @@ -3528,30 +3528,6 @@ For example, the following will import an S3 object into state, assuming the con ~> **CAUTION:** We do not recommend modifying the state file manually. If you do, you can make it unusable. However, if you accept that risk, some community members have upgraded to the new resource by searching and replacing `"type": "aws_s3_bucket_object",` with `"type": "aws_s3_object",` in the state file, and then running `terraform apply -refresh-only`. -## Resource: aws_spot_instance_request - -### instance_interruption_behaviour Argument removal - -Switch your Terraform configuration from the `instance_interruption_behaviour` attribute to the `instance_interruption_behavior` attribute instead. - -For example, given this previous configuration: - -```terraform -resource "aws_spot_instance_request" "example" { - # ... other configuration ... - instance_interruption_behaviour = "hibernate" -} -``` - -An updated configuration: - -```terraform -resource "aws_spot_instance_request" "example" { - # ... other configuration ... - instance_interruption_behavior = "hibernate" -} -``` - ## EC2-Classic Resource and Data Source Support While an upgrade to this major version will not directly impact EC2-Classic resources configured with Terraform, From 784cdac6507f4165e4d2296173b73ec48c1c087d Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 25 Apr 2023 11:44:48 -0400 Subject: [PATCH 143/304] r/aws_api_gateway_rest_api: convert minimum_compression_size to NullableTypeInt --- internal/service/apigateway/rest_api.go | 41 ++++++++++++------- internal/service/apigateway/rest_api_test.go | 27 ++++++------ .../docs/r/api_gateway_rest_api.html.markdown | 2 +- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/internal/service/apigateway/rest_api.go b/internal/service/apigateway/rest_api.go index 5e24641f2ac1..ef7683979202 100644 --- a/internal/service/apigateway/rest_api.go +++ b/internal/service/apigateway/rest_api.go @@ -19,6 +19,7 @@ import ( "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" + "github.com/hashicorp/terraform-provider-aws/internal/experimental/nullable" "github.com/hashicorp/terraform-provider-aws/internal/flex" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" @@ -116,10 +117,14 @@ func ResourceRestAPI() *schema.Resource { Optional: true, }, "minimum_compression_size": { - Type: schema.TypeInt, + Type: nullable.TypeNullableInt, Optional: true, - Default: -1, - ValidateFunc: validation.IntBetween(-1, 10485760), + Computed: true, + ValidateFunc: nullable.ValidateTypeStringNullableIntBetween(-1, 10485760), + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + // suppress null trigger when value is already null + return old == "" && new == "-1" + }, }, "name": { Type: schema.TypeString, @@ -196,8 +201,12 @@ func resourceRestAPICreate(ctx context.Context, d *schema.ResourceData, meta int input.EndpointConfiguration = expandEndpointConfiguration(v.([]interface{})) } - if minimumCompressionSize := d.Get("minimum_compression_size").(int); minimumCompressionSize > -1 { - input.MinimumCompressionSize = aws.Int64(int64(minimumCompressionSize)) + if v, ok := d.GetOk("minimum_compression_size"); ok && v.(string) != "" && v.(string) != "-1" { + mcs, err := strconv.Atoi(v.(string)) + if err != nil { + return sdkdiag.AppendErrorf(diags, "converting minimum_compression_size (%s): %s", v, err) + } + input.MinimumCompressionSize = aws.Int64(int64(mcs)) } if v, ok := d.GetOk("policy"); ok { @@ -326,9 +335,9 @@ func resourceRestAPIRead(ctx context.Context, d *schema.ResourceData, meta inter }.String() d.Set("execution_arn", executionARN) if api.MinimumCompressionSize == nil { - d.Set("minimum_compression_size", -1) + d.Set("minimum_compression_size", nil) } else { - d.Set("minimum_compression_size", api.MinimumCompressionSize) + d.Set("minimum_compression_size", strconv.FormatInt(aws.Int64Value(api.MinimumCompressionSize), 10)) } d.Set("name", api.Name) @@ -470,15 +479,15 @@ func resourceRestAPIUpdate(ctx context.Context, d *schema.ResourceData, meta int } if d.HasChange("minimum_compression_size") { - minimumCompressionSize := d.Get("minimum_compression_size").(int) - var value string - if minimumCompressionSize > -1 { - value = strconv.Itoa(minimumCompressionSize) + v := d.Get("minimum_compression_size").(string) + value := aws.String(v) + if v == "-1" { + value = nil } operations = append(operations, &apigateway.PatchOperation{ Op: aws.String(apigateway.OpReplace), Path: aws.String("/minimumCompressionSize"), - Value: aws.String(value), + Value: value, }) } @@ -683,11 +692,15 @@ func resourceRestAPIWithBodyUpdateOperations(d *schema.ResourceData, output *api } } - if v := d.Get("minimum_compression_size").(int); v > -1 && int64(v) != aws.Int64Value(output.MinimumCompressionSize) { + if v, ok := d.GetOk("minimum_compression_size"); ok && v.(string) != strconv.FormatInt(aws.Int64Value(output.MinimumCompressionSize), 10) { + value := aws.String(v.(string)) + if v.(string) == "-1" { + value = nil + } operations = append(operations, &apigateway.PatchOperation{ Op: aws.String(apigateway.OpReplace), Path: aws.String("/minimumCompressionSize"), - Value: aws.String(strconv.Itoa(v)), + Value: value, }) } diff --git a/internal/service/apigateway/rest_api_test.go b/internal/service/apigateway/rest_api_test.go index 660529fc952b..60b6c5b80ead 100644 --- a/internal/service/apigateway/rest_api_test.go +++ b/internal/service/apigateway/rest_api_test.go @@ -43,7 +43,6 @@ func TestAccAPIGatewayRestAPI_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "disable_execute_api_endpoint", "false"), resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), acctest.MatchResourceAttrRegionalARN(resourceName, "execution_arn", "execute-api", regexp.MustCompile(`[a-z0-9]+`)), - resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "-1"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestMatchResourceAttr(resourceName, "root_resource_id", regexp.MustCompile(`[a-z0-9]+`)), @@ -1036,10 +1035,10 @@ func TestAccAPIGatewayRestAPI_minimumCompressionSize(t *testing.T) { CheckDestroy: testAccCheckRestAPIDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccRestAPIConfig_minimumCompressionSize(rName, 0), + Config: testAccRestAPIConfig_minimumCompressionSize(rName, "1"), Check: resource.ComposeTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), - resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "0"), + resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "1"), ), }, { @@ -1049,14 +1048,14 @@ func TestAccAPIGatewayRestAPI_minimumCompressionSize(t *testing.T) { ImportStateVerifyIgnore: []string{"body", "put_rest_api_mode"}, }, { - Config: testAccRestAPIConfig_minimumCompressionSize(rName, -1), + Config: testAccRestAPIConfig_minimumCompressionSize(rName, "-1"), // -1 removes existing values Check: resource.ComposeTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), - resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "-1"), + resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", ""), ), }, { - Config: testAccRestAPIConfig_minimumCompressionSize(rName, 5242880), + Config: testAccRestAPIConfig_minimumCompressionSize(rName, "5242880"), Check: resource.ComposeTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "5242880"), @@ -1079,7 +1078,7 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_overrideBody(t *testing.T) CheckDestroy: testAccCheckRestAPIDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, 1, 5242880), + Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, "1", 5242880), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "1"), @@ -1093,7 +1092,7 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_overrideBody(t *testing.T) }, // Verify updated minimum compression size still overrides { - Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, 2, 5242880), + Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, "2", 5242880), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "2"), @@ -1101,7 +1100,7 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_overrideBody(t *testing.T) }, // Verify updated body minimum compression size is still overridden { - Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, 2, 1048576), + Config: testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName, "2", 1048576), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckRestAPIExists(ctx, resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "2"), @@ -1129,8 +1128,6 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_setByBody(t *testing.T) { testAccCheckRestAPIExists(ctx, resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "1048576"), ), - // TODO: The attribute type must be changed to NullableTypeInt so it can be Computed properly. - ExpectNonEmptyPlan: true, }, { ResourceName: resourceName, @@ -2414,20 +2411,20 @@ resource "aws_api_gateway_rest_api" "test" { `, rName, bodyDescription) } -func testAccRestAPIConfig_minimumCompressionSize(rName string, minimumCompressionSize int) string { +func testAccRestAPIConfig_minimumCompressionSize(rName string, minimumCompressionSize string) string { return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - minimum_compression_size = %[2]d name = %[1]q + minimum_compression_size = %[2]q } `, rName, minimumCompressionSize) } -func testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName string, minimumCompressionSize int, bodyMinimumCompressionSize int) string { +func testAccRestAPIConfig_minimumCompressionSizeOverrideBody(rName string, minimumCompressionSize string, bodyMinimumCompressionSize int) string { return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - minimum_compression_size = %[2]d name = %[1]q + minimum_compression_size = %[2]q body = jsonencode({ swagger = "2.0" diff --git a/website/docs/r/api_gateway_rest_api.html.markdown b/website/docs/r/api_gateway_rest_api.html.markdown index 3b4c92cd3e5b..8b27e8673c12 100644 --- a/website/docs/r/api_gateway_rest_api.html.markdown +++ b/website/docs/r/api_gateway_rest_api.html.markdown @@ -227,7 +227,7 @@ The following arguments are supported: * `description` - (Optional) Description of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.description` field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. * `disable_execute_api_endpoint` - (Optional) Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to `false`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-endpoint-configuration` extension `disableExecuteApiEndpoint` property](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html). If the argument value is `true` and is different than the OpenAPI value, the argument value will override the OpenAPI value. * `endpoint_configuration` - (Optional) Configuration block defining API endpoint configuration including endpoint type. Defined below. -* `minimum_compression_size` - (Optional) Minimum response size to compress for the REST API. Integer between `-1` and `10485760` (10MB). Setting a value greater than `-1` will enable compression, `-1` disables compression (default). If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value (_except_ `-1`) is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. +* `minimum_compression_size` - (Optional) Minimum response size to compress for the REST API. String containing an integer value between `-1` and `10485760` (10MB). `-1` will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to `-1`. If importing an OpenAPI specification via the `body` argument, this corresponds to the [`x-amazon-apigateway-minimum-compression-size` extension](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-openapi-minimum-compression-size.html). If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. * `name` - (Required) Name of the REST API. If importing an OpenAPI specification via the `body` argument, this corresponds to the `info.title` field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. * `fail_on_warnings` - (Optional) Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to `false` * `parameters` - (Optional) Map of customizations for importing the specification in the `body` argument. For example, to exclude DocumentationParts from an imported API, set `ignore` equal to `documentation`. Additional documentation, including other parameters such as `basepath`, can be found in the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html). From 33a8245216504ae8270faac80ef0dd85daa96e89 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Mon, 1 May 2023 09:56:05 -0400 Subject: [PATCH 144/304] d/aws_api_gateway_rest_api: convert minimum_compression_size to NullableTypeInt --- internal/service/apigateway/rest_api_data_source.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/service/apigateway/rest_api_data_source.go b/internal/service/apigateway/rest_api_data_source.go index 17357688aadd..66a99c8bd4d0 100644 --- a/internal/service/apigateway/rest_api_data_source.go +++ b/internal/service/apigateway/rest_api_data_source.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "log" + "strconv" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" @@ -12,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" + "github.com/hashicorp/terraform-provider-aws/internal/experimental/nullable" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -45,7 +47,7 @@ func DataSourceRestAPI() *schema.Resource { Computed: true, }, "minimum_compression_size": { - Type: schema.TypeInt, + Type: nullable.TypeNullableInt, Computed: true, }, "binary_media_types": { @@ -126,9 +128,9 @@ func dataSourceRestAPIRead(ctx context.Context, d *schema.ResourceData, meta int d.Set("binary_media_types", match.BinaryMediaTypes) if match.MinimumCompressionSize == nil { - d.Set("minimum_compression_size", -1) + d.Set("minimum_compression_size", nil) } else { - d.Set("minimum_compression_size", match.MinimumCompressionSize) + d.Set("minimum_compression_size", strconv.FormatInt(aws.Int64Value(match.MinimumCompressionSize), 10)) } if err := d.Set("endpoint_configuration", flattenEndpointConfiguration(match.EndpointConfiguration)); err != nil { From 3b29ed0fc871ffca121a0b5ce8779d56942155de Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Mon, 1 May 2023 09:56:29 -0400 Subject: [PATCH 145/304] d/aws_api_gateway_rest_api(test): tidy test configs --- .../apigateway/rest_api_data_source_test.go | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/internal/service/apigateway/rest_api_data_source_test.go b/internal/service/apigateway/rest_api_data_source_test.go index ed6f51de40c2..a14b2353f942 100644 --- a/internal/service/apigateway/rest_api_data_source_test.go +++ b/internal/service/apigateway/rest_api_data_source_test.go @@ -20,10 +20,7 @@ func TestAccAPIGatewayRestAPIDataSource_basic(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - testAccRestAPIConfig_name(rName), - testAccRestAPIDataSourceConfig_name(), - ), + Config: testAccRestAPIDataSourceConfig_basic(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), @@ -53,10 +50,7 @@ func TestAccAPIGatewayRestAPIDataSource_Endpoint_vpcEndpointIDs(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - testAccRestAPIConfig_vpcEndpointIDs1(rName), - testAccRestAPIDataSourceConfig_name(), - ), + Config: testAccRestAPIDataSourceConfig_Endpoint_vpcEndpointIDs(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), @@ -76,10 +70,24 @@ func TestAccAPIGatewayRestAPIDataSource_Endpoint_vpcEndpointIDs(t *testing.T) { }) } -func testAccRestAPIDataSourceConfig_name() string { - return ` +func testAccRestAPIDataSourceConfig_basic(rName string) string { + return acctest.ConfigCompose( + testAccRestAPIConfig_name(rName), + ` +data "aws_api_gateway_rest_api" "test" { + name = aws_api_gateway_rest_api.test.name +} +`, + ) +} + +func testAccRestAPIDataSourceConfig_Endpoint_vpcEndpointIDs(rName string) string { + return acctest.ConfigCompose( + testAccRestAPIConfig_vpcEndpointIDs1(rName), + ` data "aws_api_gateway_rest_api" "test" { name = aws_api_gateway_rest_api.test.name } -` +`, + ) } From 852bc4a0a7e20d424643b921fdc11bd23ab3b2c7 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 25 Apr 2023 14:37:09 -0400 Subject: [PATCH 146/304] chore: changelog --- .changelog/30969.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/30969.txt diff --git a/.changelog/30969.txt b/.changelog/30969.txt new file mode 100644 index 000000000000..66efb992b0a0 --- /dev/null +++ b/.changelog/30969.txt @@ -0,0 +1,11 @@ +```release-note:breaking-change +resource/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. +``` + +```release-note:breaking-change +data-source/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. +``` + +```release-note:note +resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. +``` From e335556ed5adedccb7713067ada68b3dc6569a92 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 14 Feb 2023 15:20:18 -0500 Subject: [PATCH 147/304] r/aws_rds_cluster: force new on snapshot_identifier change --- internal/service/rds/cluster.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 4426d6cce4b2..27450259b106 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -474,6 +474,7 @@ func ResourceCluster() *schema.Resource { // cluster which is not joined to the provided global cluster). "global_cluster_identifier", }, + ForceNew: true, }, "source_region": { Type: schema.TypeString, From 271d7d87ca1319caa13790d44c04b966945d349d Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 15 Feb 2023 09:47:01 -0500 Subject: [PATCH 148/304] r/aws_docdb_cluster: force new on snapshot_identifier change --- internal/service/docdb/cluster.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/docdb/cluster.go b/internal/service/docdb/cluster.go index 53de179f25cf..98adca01dca3 100644 --- a/internal/service/docdb/cluster.go +++ b/internal/service/docdb/cluster.go @@ -178,6 +178,7 @@ func ResourceCluster() *schema.Resource { "snapshot_identifier": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "port": { From d51a8c151526f75eb42981b23cacb897ab5a4f13 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 15 Feb 2023 09:50:13 -0500 Subject: [PATCH 149/304] r/aws_neptune_cluster: force new on snapshot_identifier change --- internal/service/neptune/cluster.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/neptune/cluster.go b/internal/service/neptune/cluster.go index 0215c97b3985..3320a33a8661 100644 --- a/internal/service/neptune/cluster.go +++ b/internal/service/neptune/cluster.go @@ -273,6 +273,7 @@ func ResourceCluster() *schema.Resource { "snapshot_identifier": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "storage_encrypted": { Type: schema.TypeBool, From dfe1f99c3a1e07481cf2cee01b2a099ed172266e Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 13:29:13 -0500 Subject: [PATCH 150/304] r/aws_rds_cluster: suppress diff on empty snapshot_identifier --- internal/service/rds/cluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 27450259b106..08c69671df3b 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -475,6 +475,10 @@ func ResourceCluster() *schema.Resource { "global_cluster_identifier", }, ForceNew: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + // allow snapshot_idenfitier to be removed without forcing re-creation + return new == "" + }, }, "source_region": { Type: schema.TypeString, From 230591dcd2bfb731d163367c2f3850631172755c Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 13:29:53 -0500 Subject: [PATCH 151/304] r/aws_docdb_cluster: suppress diff on empty snapshot_identifier --- internal/service/docdb/cluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/docdb/cluster.go b/internal/service/docdb/cluster.go index 98adca01dca3..42c9d3bd32ac 100644 --- a/internal/service/docdb/cluster.go +++ b/internal/service/docdb/cluster.go @@ -179,6 +179,10 @@ func ResourceCluster() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + // allow snapshot_idenfitier to be removed without forcing re-creation + return new == "" + }, }, "port": { From 3d0479a3dda251af3a1b31ad2e6e1649b0570cb8 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 13:30:39 -0500 Subject: [PATCH 152/304] r/aws_neptune_cluster: suppress diff on empty snapshot_identifier --- internal/service/neptune/cluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/neptune/cluster.go b/internal/service/neptune/cluster.go index 3320a33a8661..08280df998df 100644 --- a/internal/service/neptune/cluster.go +++ b/internal/service/neptune/cluster.go @@ -274,6 +274,10 @@ func ResourceCluster() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + // allow snapshot_idenfitier to be removed without forcing re-creation + return new == "" + }, }, "storage_encrypted": { Type: schema.TypeBool, From 000a04085419aa3e7d1ba8f014dc4a5ab66e916f Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 17:15:19 -0500 Subject: [PATCH 153/304] r/aws_rds_cluster: discourage automated snapshots for snapshot_identifier --- website/docs/r/rds_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 4f4cfd2bae57..35907deeeb9a 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -258,7 +258,7 @@ The following arguments are supported: * `scaling_configuration` - (Optional) Nested attribute with scaling properties. Only valid when `engine_mode` is set to `serverless`. More details below. * `serverlessv2_scaling_configuration`- (Optional) Nested attribute with scaling properties for ServerlessV2. Only valid when `engine_mode` is set to `provisioned`. More details below. * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. -* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Conflicts with `global_cluster_identifier`. Clusters cannot be restored from snapshot **and** joined to an existing global cluster in a single operation. See the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-getting-started.html#aurora-global-database.use-snapshot) or the [Global Cluster Restored From Snapshot example](#global-cluster-restored-from-snapshot) for instructions on building a global cluster starting with a snapshot. +* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. Conflicts with `global_cluster_identifier`. Clusters cannot be restored from snapshot **and** joined to an existing global cluster in a single operation. See the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-getting-started.html#aurora-global-database.use-snapshot) or the [Global Cluster Restored From Snapshot example](#global-cluster-restored-from-snapshot) for instructions on building a global cluster starting with a snapshot. * `source_region` - (Optional) The source region for an encrypted replica DB cluster. * `allocated_storage` - (Optional) The amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster). * `storage_type` - (Optional) Specifies the storage type to be associated with the DB cluster. (This setting is required to create a Multi-AZ DB cluster). Valid values: `io1`, Default: `io1`. From fc6745e9b68e70acd8021bcd6bda1aa6113819fb Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 17:15:43 -0500 Subject: [PATCH 154/304] r/aws_docdb_cluster: discourage automated snapshots for snapshot_identifier --- website/docs/r/docdb_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/docdb_cluster.html.markdown b/website/docs/r/docdb_cluster.html.markdown index 753e996a3084..4fae4a271d8f 100644 --- a/website/docs/r/docdb_cluster.html.markdown +++ b/website/docs/r/docdb_cluster.html.markdown @@ -70,7 +70,7 @@ The following arguments are supported: Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 * `preferred_maintenance_window` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. -* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. +* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false`. * `tags` - (Optional) A map of tags to assign to the DB cluster. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate From e09178b6f0d03695ae2379e399c718bbce5a7944 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 21 Feb 2023 17:15:55 -0500 Subject: [PATCH 155/304] r/aws_neptune_cluster: discourage automated snapshots for snapshot_identifier --- website/docs/r/neptune_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/neptune_cluster.html.markdown b/website/docs/r/neptune_cluster.html.markdown index 933081620654..025ada759e33 100644 --- a/website/docs/r/neptune_cluster.html.markdown +++ b/website/docs/r/neptune_cluster.html.markdown @@ -62,7 +62,7 @@ The following arguments are supported: * `port` - (Optional) The port on which the Neptune accepts connections. Default is `8182`. * `replication_source_identifier` - (Optional) ARN of a source Neptune cluster or Neptune instance if this Neptune cluster is to be created as a Read Replica. * `skip_final_snapshot` - (Optional) Determines whether a final Neptune snapshot is created before the Neptune cluster is deleted. If true is specified, no Neptune snapshot is created. If false is specified, a Neptune snapshot is created before the Neptune cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. -* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a Neptune cluster snapshot, or the ARN when specifying a Neptune snapshot. +* `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a Neptune cluster snapshot, or the ARN when specifying a Neptune snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. * `storage_encrypted` - (Optional) Specifies whether the Neptune cluster is encrypted. The default is `false` if not specified. * `tags` - (Optional) A map of tags to assign to the Neptune cluster. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate with the Cluster From 296fa824e0ed0ee1b1ac18f986c2e85b7d4fe83a Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 14 Feb 2023 16:59:28 -0500 Subject: [PATCH 156/304] chore: changelog --- .changelog/29409.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .changelog/29409.txt diff --git a/.changelog/29409.txt b/.changelog/29409.txt new file mode 100644 index 000000000000..e43f91df3f9f --- /dev/null +++ b/.changelog/29409.txt @@ -0,0 +1,24 @@ +```release-note:breaking-change +resource/aws_rds_cluster: `snapshot_identifier` change now properly forces replacement +``` + +```release-note:breaking-change +resource/aws_docdb_cluster: `snapshot_identifier` change now properly forces replacement +``` + +```release-note:breaking-change +resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement +``` + +```release-note:note +resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. +``` + +```release-note:note +resource/aws_docdb_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. +``` + +```release-note:note +resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. +``` + From 17748b83952a61a1c52427f74f10f7dd3aea9c67 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 1 May 2023 14:31:55 -0400 Subject: [PATCH 157/304] r/aws_spot_fleet_request: Deprecate 'instance_interruption_behaviour' in favor of 'instance_interruption_behavior'. --- .changelog/#####.txt | 3 + .../service/ec2/ec2_spot_fleet_request.go | 137 ++++++++++-------- .../docs/r/spot_fleet_request.html.markdown | 5 +- 3 files changed, 82 insertions(+), 63 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..0ddf834b8b11 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_spot_fleet_request: The `instance_interruption_behaviour` argument has been deprecated and will be removed in a future version. Use the new `instance_interruption_behavior` argument instead +``` \ No newline at end of file diff --git a/internal/service/ec2/ec2_spot_fleet_request.go b/internal/service/ec2/ec2_spot_fleet_request.go index 14b3b36bc91b..d4a53998d052 100644 --- a/internal/service/ec2/ec2_spot_fleet_request.go +++ b/internal/service/ec2/ec2_spot_fleet_request.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -87,12 +88,21 @@ func ResourceSpotFleetRequest() *schema.Resource { ForceNew: true, ValidateFunc: verify.ValidARN, }, + "instance_interruption_behavior": { + Type: schema.TypeString, + Optional: true, + Default: ec2.InstanceInterruptionBehaviorTerminate, + ForceNew: true, + ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), + ConflictsWith: []string{"instance_interruption_behaviour"}, + }, "instance_interruption_behaviour": { - Type: schema.TypeString, - Optional: true, - Default: ec2.InstanceInterruptionBehaviorTerminate, - ForceNew: true, - ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), + Deprecated: `use 'instance_interruption_behavior' instead`, + ConflictsWith: []string{"instance_interruption_behavior"}, }, "instance_pools_to_use_count": { Type: schema.TypeInt, @@ -857,7 +867,19 @@ func ResourceSpotFleetRequest() *schema.Resource { }, }, - CustomizeDiff: verify.SetTagsDiff, + CustomizeDiff: customdiff.All( + func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error { + if d.Id() == "" { + if v, ok := d.GetOk("spot_maintenance_strategies"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil && d.Get("fleet_type").(string) != ec2.FleetTypeMaintain { + // InvalidSpotFleetConfig: SpotMaintenanceStrategies option is only available with the spot fleet type maintain. + return fmt.Errorf("`spot_maintenance_strategies` can only be specified for `fleet_type` = %q", ec2.FleetTypeMaintain) + } + } + + return nil + }, + verify.SetTagsDiff, + ), } } @@ -865,13 +887,10 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() - _, launchSpecificationOk := d.GetOk("launch_specification") - - // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-SpotFleetRequestConfigData spotFleetConfig := &ec2.SpotFleetRequestConfigData{ ClientToken: aws.String(id.UniqueId()), IamFleetRole: aws.String(d.Get("iam_fleet_role").(string)), - InstanceInterruptionBehavior: aws.String(d.Get("instance_interruption_behaviour").(string)), + OnDemandTargetCapacity: aws.Int64(int64(d.Get("on_demand_target_capacity").(int))), ReplaceUnhealthyInstances: aws.Bool(d.Get("replace_unhealthy_instances").(bool)), TagSpecifications: getTagSpecificationsIn(ctx, ec2.ResourceTypeSpotFleetRequest), TargetCapacity: aws.Int64(int64(d.Get("target_capacity").(int))), @@ -879,68 +898,38 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, Type: aws.String(d.Get("fleet_type").(string)), } - if launchSpecificationOk { - launchSpecs, err := buildSpotFleetLaunchSpecifications(ctx, d, meta) - if err != nil { - return sdkdiag.AppendErrorf(diags, "creating EC2 Spot Fleet Request: %s", err) - } - spotFleetConfig.LaunchSpecifications = launchSpecs - } - - if v, ok := d.GetOk("launch_template_config"); ok && v.(*schema.Set).Len() > 0 { - spotFleetConfig.LaunchTemplateConfigs = expandLaunchTemplateConfigs(v.(*schema.Set).List()) + if v, ok := d.GetOk("allocation_strategy"); ok { + spotFleetConfig.AllocationStrategy = aws.String(v.(string)) + } else { + spotFleetConfig.AllocationStrategy = aws.String(ec2.AllocationStrategyLowestPrice) } if v, ok := d.GetOk("excess_capacity_termination_policy"); ok { spotFleetConfig.ExcessCapacityTerminationPolicy = aws.String(v.(string)) } - if v, ok := d.GetOk("allocation_strategy"); ok { - spotFleetConfig.AllocationStrategy = aws.String(v.(string)) - } else { - spotFleetConfig.AllocationStrategy = aws.String(ec2.AllocationStrategyLowestPrice) + if v, ok := d.GetOk("instance_interruption_behaviour"); ok { + spotFleetConfig.InstanceInterruptionBehavior = aws.String(v.(string)) + } else if v, ok := d.GetOk("instance_interruption_behavior"); ok { + spotFleetConfig.InstanceInterruptionBehavior = aws.String(v.(string)) } if v, ok := d.GetOk("instance_pools_to_use_count"); ok && v.(int) != 1 { spotFleetConfig.InstancePoolsToUseCount = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("spot_maintenance_strategies"); ok { - spotFleetConfig.SpotMaintenanceStrategies = expandSpotMaintenanceStrategies(v.([]interface{})) - } + if _, ok := d.GetOk("launch_specification"); ok { + launchSpecs, err := buildSpotFleetLaunchSpecifications(ctx, d, meta) - // InvalidSpotFleetConfig: SpotMaintenanceStrategies option is only available with the spot fleet type maintain. - if d.Get("fleet_type").(string) != ec2.FleetTypeMaintain { - if spotFleetConfig.SpotMaintenanceStrategies != nil { - log.Printf("[WARN] Spot Fleet (%s) has an invalid configuration and can not be requested. Capacity Rebalance maintenance strategies can only be specified for spot fleets of type maintain.", spotFleetConfig) - return diags + if err != nil { + return sdkdiag.AppendFromErr(diags, err) } - } - - if v, ok := d.GetOk("spot_price"); ok { - spotFleetConfig.SpotPrice = aws.String(v.(string)) - } - - spotFleetConfig.OnDemandTargetCapacity = aws.Int64(int64(d.Get("on_demand_target_capacity").(int))) - - if v, ok := d.GetOk("on_demand_allocation_strategy"); ok { - spotFleetConfig.OnDemandAllocationStrategy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("on_demand_max_total_price"); ok { - spotFleetConfig.OnDemandMaxTotalPrice = aws.String(v.(string)) - } - - if v, ok := d.GetOk("valid_from"); ok { - v, _ := time.Parse(time.RFC3339, v.(string)) - spotFleetConfig.ValidFrom = aws.Time(v) + spotFleetConfig.LaunchSpecifications = launchSpecs } - if v, ok := d.GetOk("valid_until"); ok { - v, _ := time.Parse(time.RFC3339, v.(string)) - - spotFleetConfig.ValidUntil = aws.Time(v) + if v, ok := d.GetOk("launch_template_config"); ok && v.(*schema.Set).Len() > 0 { + spotFleetConfig.LaunchTemplateConfigs = expandLaunchTemplateConfigs(v.(*schema.Set).List()) } if v, ok := d.GetOk("load_balancers"); ok && v.(*schema.Set).Len() > 0 { @@ -958,6 +947,26 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, } } + if v, ok := d.GetOk("on_demand_allocation_strategy"); ok { + spotFleetConfig.OnDemandAllocationStrategy = aws.String(v.(string)) + } + + if v, ok := d.GetOk("on_demand_max_total_price"); ok { + spotFleetConfig.OnDemandMaxTotalPrice = aws.String(v.(string)) + } + + if v, ok := d.GetOk("spot_maintenance_strategies"); ok { + spotFleetConfig.SpotMaintenanceStrategies = expandSpotMaintenanceStrategies(v.([]interface{})) + } + + if v, ok := d.GetOk("spot_price"); ok { + spotFleetConfig.SpotPrice = aws.String(v.(string)) + } + + if v, ok := d.GetOk("target_capacity_unit_type"); ok { + spotFleetConfig.TargetCapacityUnitType = aws.String(v.(string)) + } + if v, ok := d.GetOk("target_group_arns"); ok && v.(*schema.Set).Len() > 0 { var targetGroups []*ec2.TargetGroup for _, v := range v.(*schema.Set).List() { @@ -973,16 +982,20 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, } } - if v, ok := d.GetOk("target_capacity_unit_type"); ok { - spotFleetConfig.SetTargetCapacityUnitType(v.(string)) + if v, ok := d.GetOk("valid_from"); ok { + v, _ := time.Parse(time.RFC3339, v.(string)) + spotFleetConfig.ValidFrom = aws.Time(v) + } + + if v, ok := d.GetOk("valid_until"); ok { + v, _ := time.Parse(time.RFC3339, v.(string)) + spotFleetConfig.ValidUntil = aws.Time(v) } - // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-RequestSpotFleetInput input := &ec2.RequestSpotFleetInput{ SpotFleetRequestConfig: spotFleetConfig, } - log.Printf("[DEBUG] Creating EC2 Spot Fleet Request: %s", input) outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) { return conn.RequestSpotFleetWithContext(ctx, input) @@ -1053,7 +1066,11 @@ func resourceSpotFleetRequestRead(ctx context.Context, d *schema.ResourceData, m } d.Set("replace_unhealthy_instances", config.ReplaceUnhealthyInstances) - d.Set("instance_interruption_behaviour", config.InstanceInterruptionBehavior) + if _, ok := d.GetOk("instance_interruption_behaviour"); ok { + d.Set("instance_interruption_behaviour", config.InstanceInterruptionBehavior) + } else { + d.Set("instance_interruption_behavior", config.InstanceInterruptionBehavior) + } d.Set("fleet_type", config.Type) d.Set("launch_specification", launchSpec) diff --git a/website/docs/r/spot_fleet_request.html.markdown b/website/docs/r/spot_fleet_request.html.markdown index 6a2d6bbf94c8..f2d3acb18875 100644 --- a/website/docs/r/spot_fleet_request.html.markdown +++ b/website/docs/r/spot_fleet_request.html.markdown @@ -235,9 +235,8 @@ across different markets and instance types. Conflicts with `launch_template_con * `terminate_instances_on_delete` - (Optional) Indicates whether running Spot instances should be terminated when the resource is deleted (and the Spot fleet request cancelled). If no value is specified, the value of the `terminate_instances_with_expiration` argument is used. -* `instance_interruption_behaviour` - (Optional) Indicates whether a Spot - instance stops or terminates when it is interrupted. Default is - `terminate`. +* `instance_interruption_behavior` - (Optional) Indicates whether a Spot instance stops or terminates when it is interrupted. Default is `terminate`. +* `instance_interruption_behaviour` - (Optional, **Deprecated** use the `instance_interruption_behavior` argument instead) Indicates whether a Spot instance stops or terminates when it is interrupted. Default is `terminate`. * `fleet_type` - (Optional) The type of fleet request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. Default is `maintain`. * `valid_until` - (Optional) The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. From 03f7d369d411351e9422aa85dc2b957683d2d6bd Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 1 May 2023 18:55:38 +0000 Subject: [PATCH 158/304] Update CHANGELOG.md for #29409 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b55d05dd1ba6..7b81d58c6881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,12 +18,15 @@ BREAKING CHANGES: * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_docdb_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) +* resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) +* resource/aws_rds_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) @@ -39,7 +42,10 @@ NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) +* resource/aws_docdb_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) +* resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) +* resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From 56003fe5308eb7c184cabb3c3729f529571e5138 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 1 May 2023 18:59:38 +0000 Subject: [PATCH 159/304] Update CHANGELOG.md for #30969 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b81d58c6881..2f8a06348d32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ BREAKING CHANGES: +* data-source/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) @@ -14,6 +15,7 @@ BREAKING CHANGES: * provider: With the retirement of Macie Classic the `aws_macie_member_account_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) * provider: With the retirement of Macie Classic the `aws_macie_s3_bucket_association` resource has been removed ([#31058](https://github.com/hashicorp/terraform-provider-aws/issues/31058)) * resource/aws_acmpca_certificate_authority: The `status` attribute has been removed ([#31084](https://github.com/hashicorp/terraform-provider-aws/issues/31084)) +* resource/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -41,6 +43,7 @@ BREAKING CHANGES: NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) +* resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_docdb_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From 99bbc19a5c5bf557759895d7759aba8b8d61eca4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Mon, 1 May 2023 16:47:56 -0400 Subject: [PATCH 160/304] Remove unused --- internal/service/elasticache/replication_group.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/service/elasticache/replication_group.go b/internal/service/elasticache/replication_group.go index ad8c396a0e96..a166b801e97e 100644 --- a/internal/service/elasticache/replication_group.go +++ b/internal/service/elasticache/replication_group.go @@ -954,18 +954,6 @@ func deleteReplicationGroup(ctx context.Context, replicationGroupID string, conn return err } -func flattenNodeGroupsToClusterMode(nodeGroups []*elasticache.NodeGroup) []map[string]interface{} { - if len(nodeGroups) == 0 { - return []map[string]interface{}{} - } - - m := map[string]interface{}{ - "num_node_groups": len(nodeGroups), - "replicas_per_node_group": (len(nodeGroups[0].NodeGroupMembers) - 1), - } - return []map[string]interface{}{m} -} - func modifyReplicationGroupShardConfiguration(ctx context.Context, conn *elasticache.ElastiCache, d *schema.ResourceData) error { if d.HasChange("num_node_groups") { err := modifyReplicationGroupShardConfigurationNumNodeGroups(ctx, conn, d, "num_node_groups") From 2f6d29b2a99f191adf95ff0a9b35c6436b663b94 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 2 May 2023 02:06:28 +0000 Subject: [PATCH 161/304] Update CHANGELOG.md for #31008 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f8a06348d32..7987cca70006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ BREAKING CHANGES: * data-source/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* data-source/aws_elasticache_replication_group: Remove `number_cache_clusters`, `replication_group_description` arguments -- use `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -24,6 +25,8 @@ BREAKING CHANGES: * resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_elasticache_replication_group: Remove `availability_zones`, `number_cache_clusters`, `replication_group_description` arguments -- use `preferred_cache_cluster_azs`, `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_elasticache_replication_group: Remove `cluster_mode` configuration block -- use top-level `num_node_groups` and `replicas_per_node_group` instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) * resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) @@ -43,9 +46,15 @@ BREAKING CHANGES: NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) +* data-source/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* data-source/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_docdb_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) +* resource/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From 0984f0eb4f136617beccfdc668b99be76d862987 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 08:06:09 -0400 Subject: [PATCH 162/304] Revert "r/aws_spot_fleet_request: Deprecate 'instance_interruption_behaviour' in favor of 'instance_interruption_behavior'." This reverts commit 17748b83952a61a1c52427f74f10f7dd3aea9c67. --- .changelog/#####.txt | 3 - .../service/ec2/ec2_spot_fleet_request.go | 137 ++++++++---------- .../docs/r/spot_fleet_request.html.markdown | 5 +- 3 files changed, 63 insertions(+), 82 deletions(-) delete mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt deleted file mode 100644 index 0ddf834b8b11..000000000000 --- a/.changelog/#####.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:note -resource/aws_spot_fleet_request: The `instance_interruption_behaviour` argument has been deprecated and will be removed in a future version. Use the new `instance_interruption_behavior` argument instead -``` \ No newline at end of file diff --git a/internal/service/ec2/ec2_spot_fleet_request.go b/internal/service/ec2/ec2_spot_fleet_request.go index d4a53998d052..14b3b36bc91b 100644 --- a/internal/service/ec2/ec2_spot_fleet_request.go +++ b/internal/service/ec2/ec2_spot_fleet_request.go @@ -12,7 +12,6 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -88,21 +87,12 @@ func ResourceSpotFleetRequest() *schema.Resource { ForceNew: true, ValidateFunc: verify.ValidARN, }, - "instance_interruption_behavior": { - Type: schema.TypeString, - Optional: true, - Default: ec2.InstanceInterruptionBehaviorTerminate, - ForceNew: true, - ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), - ConflictsWith: []string{"instance_interruption_behaviour"}, - }, "instance_interruption_behaviour": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), - Deprecated: `use 'instance_interruption_behavior' instead`, - ConflictsWith: []string{"instance_interruption_behavior"}, + Type: schema.TypeString, + Optional: true, + Default: ec2.InstanceInterruptionBehaviorTerminate, + ForceNew: true, + ValidateFunc: validation.StringInSlice(ec2.InstanceInterruptionBehavior_Values(), false), }, "instance_pools_to_use_count": { Type: schema.TypeInt, @@ -867,19 +857,7 @@ func ResourceSpotFleetRequest() *schema.Resource { }, }, - CustomizeDiff: customdiff.All( - func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error { - if d.Id() == "" { - if v, ok := d.GetOk("spot_maintenance_strategies"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil && d.Get("fleet_type").(string) != ec2.FleetTypeMaintain { - // InvalidSpotFleetConfig: SpotMaintenanceStrategies option is only available with the spot fleet type maintain. - return fmt.Errorf("`spot_maintenance_strategies` can only be specified for `fleet_type` = %q", ec2.FleetTypeMaintain) - } - } - - return nil - }, - verify.SetTagsDiff, - ), + CustomizeDiff: verify.SetTagsDiff, } } @@ -887,10 +865,13 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() + _, launchSpecificationOk := d.GetOk("launch_specification") + + // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-SpotFleetRequestConfigData spotFleetConfig := &ec2.SpotFleetRequestConfigData{ ClientToken: aws.String(id.UniqueId()), IamFleetRole: aws.String(d.Get("iam_fleet_role").(string)), - OnDemandTargetCapacity: aws.Int64(int64(d.Get("on_demand_target_capacity").(int))), + InstanceInterruptionBehavior: aws.String(d.Get("instance_interruption_behaviour").(string)), ReplaceUnhealthyInstances: aws.Bool(d.Get("replace_unhealthy_instances").(bool)), TagSpecifications: getTagSpecificationsIn(ctx, ec2.ResourceTypeSpotFleetRequest), TargetCapacity: aws.Int64(int64(d.Get("target_capacity").(int))), @@ -898,38 +879,68 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, Type: aws.String(d.Get("fleet_type").(string)), } - if v, ok := d.GetOk("allocation_strategy"); ok { - spotFleetConfig.AllocationStrategy = aws.String(v.(string)) - } else { - spotFleetConfig.AllocationStrategy = aws.String(ec2.AllocationStrategyLowestPrice) + if launchSpecificationOk { + launchSpecs, err := buildSpotFleetLaunchSpecifications(ctx, d, meta) + if err != nil { + return sdkdiag.AppendErrorf(diags, "creating EC2 Spot Fleet Request: %s", err) + } + spotFleetConfig.LaunchSpecifications = launchSpecs + } + + if v, ok := d.GetOk("launch_template_config"); ok && v.(*schema.Set).Len() > 0 { + spotFleetConfig.LaunchTemplateConfigs = expandLaunchTemplateConfigs(v.(*schema.Set).List()) } if v, ok := d.GetOk("excess_capacity_termination_policy"); ok { spotFleetConfig.ExcessCapacityTerminationPolicy = aws.String(v.(string)) } - if v, ok := d.GetOk("instance_interruption_behaviour"); ok { - spotFleetConfig.InstanceInterruptionBehavior = aws.String(v.(string)) - } else if v, ok := d.GetOk("instance_interruption_behavior"); ok { - spotFleetConfig.InstanceInterruptionBehavior = aws.String(v.(string)) + if v, ok := d.GetOk("allocation_strategy"); ok { + spotFleetConfig.AllocationStrategy = aws.String(v.(string)) + } else { + spotFleetConfig.AllocationStrategy = aws.String(ec2.AllocationStrategyLowestPrice) } if v, ok := d.GetOk("instance_pools_to_use_count"); ok && v.(int) != 1 { spotFleetConfig.InstancePoolsToUseCount = aws.Int64(int64(v.(int))) } - if _, ok := d.GetOk("launch_specification"); ok { - launchSpecs, err := buildSpotFleetLaunchSpecifications(ctx, d, meta) + if v, ok := d.GetOk("spot_maintenance_strategies"); ok { + spotFleetConfig.SpotMaintenanceStrategies = expandSpotMaintenanceStrategies(v.([]interface{})) + } - if err != nil { - return sdkdiag.AppendFromErr(diags, err) + // InvalidSpotFleetConfig: SpotMaintenanceStrategies option is only available with the spot fleet type maintain. + if d.Get("fleet_type").(string) != ec2.FleetTypeMaintain { + if spotFleetConfig.SpotMaintenanceStrategies != nil { + log.Printf("[WARN] Spot Fleet (%s) has an invalid configuration and can not be requested. Capacity Rebalance maintenance strategies can only be specified for spot fleets of type maintain.", spotFleetConfig) + return diags } + } - spotFleetConfig.LaunchSpecifications = launchSpecs + if v, ok := d.GetOk("spot_price"); ok { + spotFleetConfig.SpotPrice = aws.String(v.(string)) } - if v, ok := d.GetOk("launch_template_config"); ok && v.(*schema.Set).Len() > 0 { - spotFleetConfig.LaunchTemplateConfigs = expandLaunchTemplateConfigs(v.(*schema.Set).List()) + spotFleetConfig.OnDemandTargetCapacity = aws.Int64(int64(d.Get("on_demand_target_capacity").(int))) + + if v, ok := d.GetOk("on_demand_allocation_strategy"); ok { + spotFleetConfig.OnDemandAllocationStrategy = aws.String(v.(string)) + } + + if v, ok := d.GetOk("on_demand_max_total_price"); ok { + spotFleetConfig.OnDemandMaxTotalPrice = aws.String(v.(string)) + } + + if v, ok := d.GetOk("valid_from"); ok { + v, _ := time.Parse(time.RFC3339, v.(string)) + + spotFleetConfig.ValidFrom = aws.Time(v) + } + + if v, ok := d.GetOk("valid_until"); ok { + v, _ := time.Parse(time.RFC3339, v.(string)) + + spotFleetConfig.ValidUntil = aws.Time(v) } if v, ok := d.GetOk("load_balancers"); ok && v.(*schema.Set).Len() > 0 { @@ -947,26 +958,6 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, } } - if v, ok := d.GetOk("on_demand_allocation_strategy"); ok { - spotFleetConfig.OnDemandAllocationStrategy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("on_demand_max_total_price"); ok { - spotFleetConfig.OnDemandMaxTotalPrice = aws.String(v.(string)) - } - - if v, ok := d.GetOk("spot_maintenance_strategies"); ok { - spotFleetConfig.SpotMaintenanceStrategies = expandSpotMaintenanceStrategies(v.([]interface{})) - } - - if v, ok := d.GetOk("spot_price"); ok { - spotFleetConfig.SpotPrice = aws.String(v.(string)) - } - - if v, ok := d.GetOk("target_capacity_unit_type"); ok { - spotFleetConfig.TargetCapacityUnitType = aws.String(v.(string)) - } - if v, ok := d.GetOk("target_group_arns"); ok && v.(*schema.Set).Len() > 0 { var targetGroups []*ec2.TargetGroup for _, v := range v.(*schema.Set).List() { @@ -982,20 +973,16 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData, } } - if v, ok := d.GetOk("valid_from"); ok { - v, _ := time.Parse(time.RFC3339, v.(string)) - spotFleetConfig.ValidFrom = aws.Time(v) - } - - if v, ok := d.GetOk("valid_until"); ok { - v, _ := time.Parse(time.RFC3339, v.(string)) - spotFleetConfig.ValidUntil = aws.Time(v) + if v, ok := d.GetOk("target_capacity_unit_type"); ok { + spotFleetConfig.SetTargetCapacityUnitType(v.(string)) } + // http://docs.aws.amazon.com/sdk-for-go/api/service/ec2.html#type-RequestSpotFleetInput input := &ec2.RequestSpotFleetInput{ SpotFleetRequestConfig: spotFleetConfig, } + log.Printf("[DEBUG] Creating EC2 Spot Fleet Request: %s", input) outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) { return conn.RequestSpotFleetWithContext(ctx, input) @@ -1066,11 +1053,7 @@ func resourceSpotFleetRequestRead(ctx context.Context, d *schema.ResourceData, m } d.Set("replace_unhealthy_instances", config.ReplaceUnhealthyInstances) - if _, ok := d.GetOk("instance_interruption_behaviour"); ok { - d.Set("instance_interruption_behaviour", config.InstanceInterruptionBehavior) - } else { - d.Set("instance_interruption_behavior", config.InstanceInterruptionBehavior) - } + d.Set("instance_interruption_behaviour", config.InstanceInterruptionBehavior) d.Set("fleet_type", config.Type) d.Set("launch_specification", launchSpec) diff --git a/website/docs/r/spot_fleet_request.html.markdown b/website/docs/r/spot_fleet_request.html.markdown index f2d3acb18875..6a2d6bbf94c8 100644 --- a/website/docs/r/spot_fleet_request.html.markdown +++ b/website/docs/r/spot_fleet_request.html.markdown @@ -235,8 +235,9 @@ across different markets and instance types. Conflicts with `launch_template_con * `terminate_instances_on_delete` - (Optional) Indicates whether running Spot instances should be terminated when the resource is deleted (and the Spot fleet request cancelled). If no value is specified, the value of the `terminate_instances_with_expiration` argument is used. -* `instance_interruption_behavior` - (Optional) Indicates whether a Spot instance stops or terminates when it is interrupted. Default is `terminate`. -* `instance_interruption_behaviour` - (Optional, **Deprecated** use the `instance_interruption_behavior` argument instead) Indicates whether a Spot instance stops or terminates when it is interrupted. Default is `terminate`. +* `instance_interruption_behaviour` - (Optional) Indicates whether a Spot + instance stops or terminates when it is interrupted. Default is + `terminate`. * `fleet_type` - (Optional) The type of fleet request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. Default is `maintain`. * `valid_until` - (Optional) The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. From 34cf5f6cdf3b4738245b8cea96764376dfd5eba7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 08:20:35 -0400 Subject: [PATCH 163/304] r/aws_spot_fleet_request: Discourage use of this resource. --- website/docs/r/spot_fleet_request.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/docs/r/spot_fleet_request.html.markdown b/website/docs/r/spot_fleet_request.html.markdown index 6a2d6bbf94c8..3a39b2337493 100644 --- a/website/docs/r/spot_fleet_request.html.markdown +++ b/website/docs/r/spot_fleet_request.html.markdown @@ -11,6 +11,9 @@ description: |- Provides an EC2 Spot Fleet Request resource. This allows a fleet of Spot instances to be requested on the Spot market. +~> **NOTE [AWS strongly discourages](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use) the use of the legacy APIs called by this resource. +We recommend using the [EC2 Fleet](ec2_fleet.html) or [Auto Scaling Group](autoscaling_group.html) resources instead. + ## Example Usage ### Using launch specifications From ed59a162d1e518d835d64ed3ba5c0905d0d6091c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 08:21:21 -0400 Subject: [PATCH 164/304] r/aws_spot_instance_request: Discourage use of this resource. --- website/docs/r/spot_instance_request.html.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/docs/r/spot_instance_request.html.markdown b/website/docs/r/spot_instance_request.html.markdown index bfcf0eeed853..d1f73ede98f7 100644 --- a/website/docs/r/spot_instance_request.html.markdown +++ b/website/docs/r/spot_instance_request.html.markdown @@ -31,6 +31,9 @@ point in time. See the [AWS Spot Instance documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html) for more information. +~> **NOTE [AWS strongly discourages](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use) the use of the legacy APIs called by this resource. +We recommend using the [EC2 Fleet](ec2_fleet.html) or [Auto Scaling Group](autoscaling_group.html) resources instead. + ## Example Usage ```terraform From ad864164bd03c48c533617d1555656f2e92aad85 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 08:28:02 -0400 Subject: [PATCH 165/304] Fix markdown link check. --- website/docs/guides/version-4-upgrade.html.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/guides/version-4-upgrade.html.md b/website/docs/guides/version-4-upgrade.html.md index f07ae69e447d..98722b78c46e 100644 --- a/website/docs/guides/version-4-upgrade.html.md +++ b/website/docs/guides/version-4-upgrade.html.md @@ -72,7 +72,6 @@ Upgrade topics: - [Resource: aws_fsx_ontap_storage_virtual_machine](#resource-aws_fsx_ontap_storage_virtual_machine) - [Resource: aws_lb_target_group](#resource-aws_lb_target_group) - [Resource: aws_s3_bucket_object](#resource-aws_s3_bucket_object) -- [Resource: aws_spot_instance_request](#resource-aws_spot_instance_request) From 9fa95207a0cc2f6253ac9c539f815e1e2ec27878 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 2 May 2023 11:15:35 -0400 Subject: [PATCH 166/304] rds/cluster: engine becomes required --- internal/service/rds/cluster.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 08c69671df3b..97996cdad986 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -174,9 +174,8 @@ func ResourceCluster() *schema.Resource { }, "engine": { Type: schema.TypeString, - Optional: true, + Required: true, ForceNew: true, - Default: ClusterEngineAurora, ValidateFunc: validClusterEngine(), }, "engine_mode": { From 6a8cd3022c37a256e185e36cdb2e77986a74d994 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 2 May 2023 11:26:55 -0400 Subject: [PATCH 167/304] Add changelog, update docs --- .changelog/31112.txt | 7 +++++++ website/docs/r/rds_cluster.html.markdown | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changelog/31112.txt diff --git a/.changelog/31112.txt b/.changelog/31112.txt new file mode 100644 index 000000000000..ac4081490dc4 --- /dev/null +++ b/.changelog/31112.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change +resource/aws_rds_cluster: The `engine` argument is now required and has no default +``` + +```release-note:note +data-source/aws_rds_cluster: Configurations not including the `engine` argument must be updated to include the specific engine you want. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster +``` \ No newline at end of file diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 35907deeeb9a..54a462bc1936 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -235,7 +235,7 @@ The following arguments are supported: * `deletion_protection` - (Optional) If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`. * `enable_http_endpoint` - (Optional) Enable HTTP endpoint (data API). Only valid when `engine_mode` is set to `serverless`. * `enabled_cloudwatch_logs_exports` - (Optional) Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL). -* `engine` - (Optional) The name of the database engine to be used for this DB cluster. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). +* `engine` - (Required) Name of the database engine to be used for this DB cluster. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). * `engine_mode` - (Optional) The database engine mode. Valid values: `global` (only valid for Aurora MySQL 1.21 and earlier), `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`. * `engine_version` - (Optional) The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value, or by running `aws rds describe-db-engine-versions`. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. The value can contain a partial version where supported by the API. The actual engine version used is returned in the attribute `engine_version_actual`, , see [Attributes Reference](#attributes-reference) below. * `db_cluster_instance_class` - (Optional) The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes and availability for your engine, see [DB instance class](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). From e2489ac4a6ae465a47e7ed28f8e2acfcb68c85d5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 14:09:54 -0400 Subject: [PATCH 168/304] Add CHANGELOG entry. --- .changelog/28539.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/28539.txt diff --git a/.changelog/28539.txt b/.changelog/28539.txt new file mode 100644 index 000000000000..7e77b285c40a --- /dev/null +++ b/.changelog/28539.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +data-source/aws_iam_policy_document: Don't add empty `statement.sid` values to `json` attribute value +``` \ No newline at end of file From 144e123b46309bb359fcdf70a5eab6058980aba7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 2 May 2023 14:25:00 -0400 Subject: [PATCH 169/304] d/aws_iam_policy_document: Fixup acceptance tests. --- internal/service/iam/policy_document_data_source_test.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index bca0980a965b..4bc1ae3c0de7 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -804,7 +804,6 @@ var testAccPolicyDocumentSourceListExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "foo:ActionOne" }, @@ -819,7 +818,6 @@ var testAccPolicyDocumentSourceListExpectedJSON = `{ "Action": "foo:ActionTwo" }, { - "Sid": "", "Effect": "Allow", "Action": "bar:ActionTwo" } @@ -961,7 +959,6 @@ var testAccPolicyDocumentOverrideExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "ec2:*", "Resource": "*" @@ -1021,7 +1018,6 @@ var testAccPolicyDocumentOverrideListExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "foo:ActionOne" }, @@ -1065,7 +1061,6 @@ var testAccPolicyDocumentNoStatementMergeExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "ec2:DescribeAccountAttributes", "Resource": "*" @@ -1154,13 +1149,11 @@ var testAccPolicyDocumentDuplicateBlankSidExpectedJSON = `{ "Version": "2012-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "ec2:DescribeAccountAttributes", "Resource": "*" }, { - "Sid": "", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "*" @@ -1183,7 +1176,6 @@ const testAccPolicyDocumentVersion20081017ExpectedJSONDataSourceConfig = `{ "Version": "2008-10-17", "Statement": [ { - "Sid": "", "Effect": "Allow", "Action": "ec2:*", "Resource": "*" From 116564bfb926bbfef854b877af0a0c1f1acf181d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 10:47:33 -0400 Subject: [PATCH 170/304] Update cluster instance --- internal/service/rds/cluster_instance.go | 3 +- internal/service/rds/cluster_instance_test.go | 415 ++++++------------ internal/service/rds/consts.go | 2 - 3 files changed, 127 insertions(+), 293 deletions(-) diff --git a/internal/service/rds/cluster_instance.go b/internal/service/rds/cluster_instance.go index 4db8568f8f82..3279cf06608d 100644 --- a/internal/service/rds/cluster_instance.go +++ b/internal/service/rds/cluster_instance.go @@ -99,9 +99,8 @@ func ResourceClusterInstance() *schema.Resource { }, "engine": { Type: schema.TypeString, - Optional: true, + Required: true, ForceNew: true, - Default: ClusterEngineAurora, ValidateFunc: validClusterEngine(), }, "engine_version": { diff --git a/internal/service/rds/cluster_instance_test.go b/internal/service/rds/cluster_instance_test.go index 83458b96fe94..f3548329e927 100644 --- a/internal/service/rds/cluster_instance_test.go +++ b/internal/service/rds/cluster_instance_test.go @@ -45,7 +45,7 @@ func TestAccRDSClusterInstance_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "cluster_identifier", rName), resource.TestCheckResourceAttr(resourceName, "copy_tags_to_snapshot", "false"), resource.TestCheckResourceAttrSet(resourceName, "dbi_resource_id"), - resource.TestCheckResourceAttr(resourceName, "engine", "aurora"), + resource.TestCheckResourceAttr(resourceName, "engine", "aurora-mysql"), resource.TestCheckResourceAttrSet(resourceName, "engine_version"), resource.TestCheckResourceAttr(resourceName, "network_type", "IPV4"), resource.TestCheckResourceAttrSet(resourceName, "preferred_backup_window"), @@ -669,7 +669,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1(t *testin var v rds.DBInstance resourceName := "aws_rds_cluster_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora" + engine := "aurora-mysql" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, @@ -697,44 +697,6 @@ func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1(t *testin }) } -func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL2(t *testing.T) { - ctx := acctest.Context(t) - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } - - var v rds.DBInstance - resourceName := "aws_rds_cluster_instance.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora-mysql" - engineVersion := "5.7.mysql_aurora.2.04.2" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, - ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterInstanceConfig_performanceInsightsEnabledAuroraMySQL2(rName, engine, engineVersion), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterInstanceExists(ctx, resourceName, &v), - resource.TestCheckResourceAttr(resourceName, "performance_insights_enabled", "true"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "apply_immediately", - "identifier_prefix", - }, - }, - }, - }) -} - func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -782,7 +744,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1(t *testi kmsKeyResourceName := "aws_kms_key.test" resourceName := "aws_rds_cluster_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora" + engine := "aurora-mysql" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, @@ -820,7 +782,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKe var v rds.DBInstance resourceName := "aws_rds_cluster_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora" + engine := "aurora-mysql" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, @@ -852,88 +814,6 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKe }) } -func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL2(t *testing.T) { - ctx := acctest.Context(t) - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } - - var v rds.DBInstance - kmsKeyResourceName := "aws_kms_key.test" - resourceName := "aws_rds_cluster_instance.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora-mysql" - engineVersion := "5.7.mysql_aurora.2.04.2" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, - ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterInstanceConfig_performanceInsightsKMSKeyIDAuroraMySQL2(rName, engine, engineVersion), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterInstanceExists(ctx, resourceName, &v), - resource.TestCheckResourceAttr(resourceName, "performance_insights_enabled", "true"), - resource.TestCheckResourceAttrPair(resourceName, "performance_insights_kms_key_id", kmsKeyResourceName, "arn"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "apply_immediately", - "identifier_prefix", - }, - }, - }, - }) -} - -func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL2_defaultKeyToCustomKey(t *testing.T) { - ctx := acctest.Context(t) - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } - - var v rds.DBInstance - resourceName := "aws_rds_cluster_instance.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - engine := "aurora-mysql" - engineVersion := "5.7.mysql_aurora.2.04.2" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, - ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterInstanceConfig_performanceInsightsEnabledAuroraMySQL2(rName, engine, engineVersion), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterInstanceExists(ctx, resourceName, &v), - resource.TestCheckResourceAttr(resourceName, "performance_insights_enabled", "true"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "apply_immediately", - "identifier_prefix", - }, - }, - { - Config: testAccClusterInstanceConfig_performanceInsightsKMSKeyIDAuroraMySQL2(rName, engine, engineVersion), - ExpectError: regexp.MustCompile(`InvalidParameterCombination: You .* change your Performance Insights KMS key`), - }, - }, - }) -} - func TestAccRDSClusterInstance_performanceInsightsRetentionPeriod(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -945,7 +825,10 @@ func TestAccRDSClusterInstance_performanceInsightsRetentionPeriod(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "aurora") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "aurora-mysql") + }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1173,33 +1056,62 @@ func testAccCheckClusterInstanceDestroy(ctx context.Context) resource.TestCheckF } } -func testAccClusterInstanceConfig_base(rName string) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` +func testAccClusterInstanceConfig_orderableEngineBase(engine string, performanceInsights bool) string { + if performanceInsights { + return fmt.Sprintf(` +data "aws_rds_engine_version" "default" { + engine = %[1]q +} + +data "aws_rds_orderable_db_instance" "test" { + engine = aws_rds_cluster.test.engine + engine_version = aws_rds_cluster.test.engine_version + supports_performance_insights = true + preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] +} +`, engine) + } + + return fmt.Sprintf(` +data "aws_rds_engine_version" "default" { + engine = %[1]q +} + data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version preferred_instance_classes = ["db.t3.small", "db.t2.small", "db.t3.medium"] } +`, engine) +} +func testAccClusterInstanceConfig_base(rName, engine string) string { + return acctest.ConfigCompose( + acctest.ConfigAvailableAZsNoOptIn(), + testAccClusterInstanceConfig_orderableEngineBase(engine, false), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { - cluster_identifier = %[1]q + cluster_identifier = %[2]q availability_zones = [ data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1], data.aws_availability_zones.available.names[2] ] + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version database_name = "mydb" master_username = "foo" master_password = "mustbeeightcharacters" skip_final_snapshot = true } -`, rName)) +`, engine, rName)) } func testAccClusterInstanceConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name @@ -1208,7 +1120,7 @@ resource "aws_rds_cluster_instance" "test" { resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1220,9 +1132,10 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_modified(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name @@ -1232,7 +1145,7 @@ resource "aws_rds_cluster_instance" "test" { resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1244,9 +1157,10 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name @@ -1259,7 +1173,7 @@ resource "aws_rds_cluster_instance" "test" { resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1271,9 +1185,10 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name @@ -1287,7 +1202,7 @@ resource "aws_rds_cluster_instance" "test" { resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1299,9 +1214,10 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_az(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name @@ -1311,7 +1227,7 @@ resource "aws_rds_cluster_instance" "test" { resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1323,23 +1239,23 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_identifierPrefix(rName, identifierPrefix string) string { - return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - preferred_instance_classes = ["db.t3.small", "db.t2.small", "db.t3.medium"] -} - + return acctest.ConfigCompose( + acctest.ConfigVPCWithSubnets(rName, 2), + testAccClusterInstanceConfig_orderableEngineBase("aurora-mysql", false), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q - master_username = "root" - master_password = "password" db_subnet_group_name = aws_db_subnet_group.test.name + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version + master_password = "password" + master_username = "root" skip_final_snapshot = true } resource "aws_rds_cluster_instance" "test" { identifier_prefix = %[2]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class } @@ -1352,23 +1268,23 @@ resource "aws_db_subnet_group" "test" { } func testAccClusterInstanceConfig_identifierGenerated(rName string) string { - return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - preferred_instance_classes = ["db.t3.small", "db.t2.small", "db.t3.medium"] -} - + return acctest.ConfigCompose( + acctest.ConfigVPCWithSubnets(rName, 2), + testAccClusterInstanceConfig_orderableEngineBase("aurora-mysql", false), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q master_username = "root" master_password = "password" db_subnet_group_name = aws_db_subnet_group.test.name skip_final_snapshot = true + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version } resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id + engine = data.aws_rds_engine_version.default.engine instance_class = data.aws_rds_orderable_db_instance.test.instance_class } @@ -1380,7 +1296,10 @@ resource "aws_db_subnet_group" "test" { } func testAccClusterInstanceConfig_kmsKey(rName string) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` + return acctest.ConfigCompose( + acctest.ConfigAvailableAZsNoOptIn(), + testAccClusterInstanceConfig_orderableEngineBase("aurora-mysql", false), + fmt.Sprintf(` resource "aws_kms_key" "test" { description = %[1]q @@ -1411,6 +1330,8 @@ resource "aws_rds_cluster" "test" { data.aws_availability_zones.available.names[2] ] database_name = "mydb" + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_username = "foo" master_password = "mustbeeightcharacters" storage_encrypted = true @@ -1418,22 +1339,17 @@ resource "aws_rds_cluster" "test" { skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - preferred_instance_classes = ["db.t3.small", "db.t2.small", "db.t3.medium"] -} - resource "aws_rds_cluster_instance" "test" { identifier = %[1]q cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class db_parameter_group_name = aws_db_parameter_group.test.name + engine = data.aws_rds_engine_version.default.engine } resource "aws_db_parameter_group" "test" { name = %[1]q - family = "aurora5.6" + family = data.aws_rds_engine_version.default.parameter_group_family parameter { name = "back_log" @@ -1445,9 +1361,10 @@ resource "aws_db_parameter_group" "test" { } func testAccClusterInstanceConfig_publiclyAccessible(rName string, publiclyAccessible bool) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { apply_immediately = true + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class @@ -1457,9 +1374,10 @@ resource "aws_rds_cluster_instance" "test" { } func testAccClusterInstanceConfig_copyTagsToSnapshot(rName string, copy bool) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { identifier = %[1]q + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id instance_class = data.aws_rds_orderable_db_instance.test.instance_class promotion_tier = "3" @@ -1469,7 +1387,7 @@ resource "aws_rds_cluster_instance" "test" { } func testAccClusterInstanceConfig_caCertificateID(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` data "aws_rds_certificate" "latest" { latest_valid_till = true } @@ -1477,6 +1395,7 @@ data "aws_rds_certificate" "latest" { resource "aws_rds_cluster_instance" "test" { apply_immediately = true cluster_identifier = aws_rds_cluster.test.id + engine = data.aws_rds_engine_version.default.engine identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class ca_cert_identifier = data.aws_rds_certificate.latest.id @@ -1485,7 +1404,7 @@ resource "aws_rds_cluster_instance" "test" { } func testAccClusterInstanceConfig_monitoringInterval(rName string, monitoringInterval int) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` data "aws_partition" "current" {} resource "aws_iam_role" "test" { @@ -1517,6 +1436,7 @@ resource "aws_rds_cluster_instance" "test" { depends_on = [aws_iam_role_policy_attachment.test] cluster_identifier = aws_rds_cluster.test.id + engine = data.aws_rds_engine_version.default.engine identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class monitoring_interval = %[2]d @@ -1526,9 +1446,10 @@ resource "aws_rds_cluster_instance" "test" { } func testAccClusterInstanceConfig_monitoringRoleARNRemoved(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id + engine = data.aws_rds_engine_version.default.engine identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class } @@ -1536,7 +1457,7 @@ resource "aws_rds_cluster_instance" "test" { } func testAccClusterInstanceConfig_monitoringRoleARN(rName string) string { - return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterInstanceConfig_base(rName, "aurora-mysql"), fmt.Sprintf(` data "aws_partition" "current" {} resource "aws_iam_role" "test" { @@ -1565,93 +1486,56 @@ resource "aws_iam_role_policy_attachment" "test" { } resource "aws_rds_cluster_instance" "test" { - depends_on = [aws_iam_role_policy_attachment.test] - + engine = data.aws_rds_engine_version.default.engine cluster_identifier = aws_rds_cluster.test.id identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class monitoring_interval = 5 monitoring_role_arn = aws_iam_role.test.arn + + depends_on = [aws_iam_role_policy_attachment.test] } `, rName)) } func testAccClusterInstanceConfig_performanceInsightsEnabledAuroraMySQL1(rName, engine string) string { - return fmt.Sprintf(` -resource "aws_rds_cluster" "test" { - cluster_identifier = %[1]q - database_name = "mydb" - engine = %[2]q - master_password = "mustbeeightcharacters" - master_username = "foo" - skip_final_snapshot = true -} - -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - -resource "aws_rds_cluster_instance" "test" { - cluster_identifier = aws_rds_cluster.test.id - engine = aws_rds_cluster.test.engine - identifier = %[1]q - instance_class = data.aws_rds_orderable_db_instance.test.instance_class - performance_insights_enabled = true -} -`, rName, engine) -} - -func testAccClusterInstanceConfig_performanceInsightsEnabledAuroraMySQL2(rName, engine, engineVersion string) string { - return fmt.Sprintf(` + return acctest.ConfigCompose( + testAccClusterInstanceConfig_orderableEngineBase(engine, true), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q database_name = "mydb" - engine = %[2]q - engine_version = %[3]q + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_password = "mustbeeightcharacters" master_username = "foo" skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version + engine = data.aws_rds_engine_version.default.engine identifier = %[1]q instance_class = data.aws_rds_orderable_db_instance.test.instance_class performance_insights_enabled = true } -`, rName, engine, engineVersion) +`, rName)) } func testAccClusterInstanceConfig_performanceInsightsEnabledAuroraPostgresql(rName, engine string) string { - return fmt.Sprintf(` + return acctest.ConfigCompose( + testAccClusterInstanceConfig_orderableEngineBase(engine, true), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q database_name = "mydb" - engine = %[2]q + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_password = "mustbeeightcharacters" master_username = "foo" skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id engine = aws_rds_cluster.test.engine @@ -1659,11 +1543,13 @@ resource "aws_rds_cluster_instance" "test" { instance_class = data.aws_rds_orderable_db_instance.test.instance_class performance_insights_enabled = true } -`, rName, engine) +`, rName)) } func testAccClusterInstanceConfig_performanceInsightsKMSKeyIDAuroraMySQL1(rName, engine string) string { - return fmt.Sprintf(` + return acctest.ConfigCompose( + testAccClusterInstanceConfig_orderableEngineBase(engine, true), + fmt.Sprintf(` resource "aws_kms_key" "test" { deletion_window_in_days = 7 } @@ -1671,19 +1557,13 @@ resource "aws_kms_key" "test" { resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q database_name = "mydb" - engine = %[2]q + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_password = "mustbeeightcharacters" master_username = "foo" skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id engine = aws_rds_cluster.test.engine @@ -1692,46 +1572,13 @@ resource "aws_rds_cluster_instance" "test" { performance_insights_enabled = true performance_insights_kms_key_id = aws_kms_key.test.arn } -`, rName, engine) -} - -func testAccClusterInstanceConfig_performanceInsightsKMSKeyIDAuroraMySQL2(rName, engine, engineVersion string) string { - return fmt.Sprintf(` -resource "aws_kms_key" "test" { - deletion_window_in_days = 7 -} - -resource "aws_rds_cluster" "test" { - cluster_identifier = %[1]q - database_name = "mydb" - engine = %[2]q - engine_version = %[3]q - master_password = "mustbeeightcharacters" - master_username = "foo" - skip_final_snapshot = true -} - -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - -resource "aws_rds_cluster_instance" "test" { - cluster_identifier = aws_rds_cluster.test.id - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - identifier = %[1]q - instance_class = data.aws_rds_orderable_db_instance.test.instance_class - performance_insights_enabled = true - performance_insights_kms_key_id = aws_kms_key.test.arn -} -`, rName, engine, engineVersion) +`, rName)) } func testAccClusterInstanceConfig_performanceInsightsKMSKeyIDAuroraPostgresql(rName, engine string) string { - return fmt.Sprintf(` + return acctest.ConfigCompose( + testAccClusterInstanceConfig_orderableEngineBase(engine, true), + fmt.Sprintf(` resource "aws_kms_key" "test" { deletion_window_in_days = 7 } @@ -1739,19 +1586,13 @@ resource "aws_kms_key" "test" { resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q database_name = "mydb" - engine = %[2]q + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_password = "mustbeeightcharacters" master_username = "foo" skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id engine = aws_rds_cluster.test.engine @@ -1760,27 +1601,23 @@ resource "aws_rds_cluster_instance" "test" { performance_insights_enabled = true performance_insights_kms_key_id = aws_kms_key.test.arn } -`, rName, engine) +`, rName)) } func testAccClusterInstanceConfig_performanceInsightsRetentionPeriod(rName string, performanceInsightsRetentionPeriod int) string { - return fmt.Sprintf(` + return acctest.ConfigCompose( + testAccClusterInstanceConfig_orderableEngineBase("aurora-mysql", true), + fmt.Sprintf(` resource "aws_rds_cluster" "test" { cluster_identifier = %[1]q database_name = "mydb" - engine = "aurora" + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version master_password = "mustbeeightcharacters" master_username = "foo" skip_final_snapshot = true } -data "aws_rds_orderable_db_instance" "test" { - engine = aws_rds_cluster.test.engine - engine_version = aws_rds_cluster.test.engine_version - supports_performance_insights = true - preferred_instance_classes = ["db.t3.medium", "db.r5.large", "db.r4.large"] -} - resource "aws_rds_cluster_instance" "test" { cluster_identifier = aws_rds_cluster.test.id engine = aws_rds_cluster.test.engine @@ -1789,5 +1626,5 @@ resource "aws_rds_cluster_instance" "test" { performance_insights_enabled = true performance_insights_retention_period = %[2]d } -`, rName, performanceInsightsRetentionPeriod) +`, rName, performanceInsightsRetentionPeriod)) } diff --git a/internal/service/rds/consts.go b/internal/service/rds/consts.go index ec1663363a4d..e0775deb8cb7 100644 --- a/internal/service/rds/consts.go +++ b/internal/service/rds/consts.go @@ -107,7 +107,6 @@ const ( ) const ( - ClusterEngineAurora = "aurora" ClusterEngineAuroraMySQL = "aurora-mysql" ClusterEngineAuroraPostgreSQL = "aurora-postgresql" ClusterEngineMySQL = "mysql" @@ -116,7 +115,6 @@ const ( func ClusterEngine_Values() []string { return []string{ - ClusterEngineAurora, ClusterEngineAuroraMySQL, ClusterEngineAuroraPostgreSQL, ClusterEngineMySQL, From f622bbc1a9100d198c433a08f62fc3952d4daf12 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 10:58:19 -0400 Subject: [PATCH 171/304] Terraform AWS Provider Version 5 Upgrade Guide. --- website/docs/guides/version-5-upgrade.html.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 website/docs/guides/version-5-upgrade.html.md diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md new file mode 100644 index 000000000000..fd4948133571 --- /dev/null +++ b/website/docs/guides/version-5-upgrade.html.md @@ -0,0 +1,73 @@ +--- +subcategory: "" +layout: "aws" +page_title: "Terraform AWS Provider Version 5 Upgrade Guide" +description: |- + Terraform AWS Provider Version 5 Upgrade Guide +--- + +# Terraform AWS Provider Version 5 Upgrade Guide + +Version 5.0.0 of the AWS provider for Terraform is a major release and includes some changes that you will need to consider when upgrading. We intend this guide to help with that process and focus only on changes from version 4.X to version 5.0.0. See the [Version 4 Upgrade Guide](/docs/providers/aws/guides/version-4-upgrade.html) for information about upgrading from 3.X to version 4.0.0. + +We previously marked most of the changes we outline in this guide as deprecated in the Terraform plan/apply output throughout previous provider releases. You can find these changes, including deprecation notices, in the [Terraform AWS Provider CHANGELOG](https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md). + +Upgrade topics: + + + +- [Provider Version Configuration](#provider-version-configuration) + + + +Additional Topics: + + + +- [EC2-Classic Retirement](#ec2-classic-retirement) + + + +## Provider Version Configuration + +-> Before upgrading to version 5.0.0, upgrade to the most recent 4.X version of the provider and ensure that your environment successfully runs [`terraform plan`](https://www.terraform.io/docs/commands/plan.html). You should not see changes you don't expect or deprecation notices. + +Use [version constraints when configuring Terraform providers](https://www.terraform.io/docs/configuration/providers.html#provider-versions). If you are following that recommendation, update the version constraints in your Terraform configuration and run [`terraform init -upgrade`](https://www.terraform.io/docs/commands/init.html) to download the new version. + +For example, given this previous configuration: + +```terraform +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.65" + } + } +} + +provider "aws" { + # Configuration options +} +``` + +Update to the latest 5.X version: + +```terraform +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + } +} + +provider "aws" { + # Configuration options +} +``` + +## EC2-Classic Retirement + +Blah. From f601406041b192ad06adbf43f5d6f80b4b731f34 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 11:08:13 -0400 Subject: [PATCH 172/304] Update docs, changelog --- .changelog/31112.txt | 10 +- website/docs/r/rds_cluster.html.markdown | 96 +++++++++---------- .../docs/r/rds_cluster_instance.html.markdown | 56 +++++------ 3 files changed, 86 insertions(+), 76 deletions(-) diff --git a/.changelog/31112.txt b/.changelog/31112.txt index ac4081490dc4..70c2393db946 100644 --- a/.changelog/31112.txt +++ b/.changelog/31112.txt @@ -3,5 +3,13 @@ resource/aws_rds_cluster: The `engine` argument is now required and has no defau ``` ```release-note:note -data-source/aws_rds_cluster: Configurations not including the `engine` argument must be updated to include the specific engine you want. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster +resource/aws_rds_cluster: Configurations not including the `engine` argument must be updated to include `engine` as it is now required. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster +``` + +```release-note:breaking-change +resource/aws_rds_cluster_instance: The `engine` argument is now required and has no default +``` + +```release-note:note +resource/aws_rds_cluster_instance: Configurations not including the `engine` argument must be updated to include `engine` as it is now required. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster instance ``` \ No newline at end of file diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 54a462bc1936..6ca852b57090 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -223,48 +223,48 @@ The following arguments are supported: * `allow_major_version_upgrade` - (Optional) Enable to allow major engine version upgrades when changing engine versions. Defaults to `false`. * `apply_immediately` - (Optional) Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html) * `availability_zones` - (Optional) List of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next Terraform apply. We recommend specifying 3 AZs or using [the `lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) if necessary. A maximum of 3 AZs can be configured. -* `backtrack_window` - (Optional) The target backtrack window, in seconds. Only available for `aurora` and `aurora-mysql` engines currently. To disable backtracking, set this value to `0`. Defaults to `0`. Must be between `0` and `259200` (72 hours) -* `backup_retention_period` - (Optional) The days to retain backups for. Default `1` +* `backtrack_window` - (Optional) Target backtrack window, in seconds. Only available for `aurora` and `aurora-mysql` engines currently. To disable backtracking, set this value to `0`. Defaults to `0`. Must be between `0` and `259200` (72 hours) +* `backup_retention_period` - (Optional) Days to retain backups for. Default `1` * `cluster_identifier_prefix` - (Optional, Forces new resource) Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `cluster_identifier`. * `cluster_identifier` - (Optional, Forces new resources) The cluster identifier. If omitted, Terraform will assign a random, unique identifier. * `copy_tags_to_snapshot` – (Optional, boolean) Copy all Cluster `tags` to snapshots. Default is `false`. * `database_name` - (Optional) Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: [RDS Naming Constraints][5] -* `db_cluster_parameter_group_name` - (Optional) A cluster parameter group to associate with the cluster. +* `db_cluster_parameter_group_name` - (Optional) Cluster parameter group to associate with the cluster. * `db_instance_parameter_group_name` - (Optional) Instance parameter group to associate with all instances of the DB cluster. The `db_instance_parameter_group_name` parameter is only valid in combination with the `allow_major_version_upgrade` parameter. -* `db_subnet_group_name` - (Optional) A DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` specified on every [`aws_rds_cluster_instance`](/docs/providers/aws/r/rds_cluster_instance.html) in the cluster. +* `db_subnet_group_name` - (Optional) DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` specified on every [`aws_rds_cluster_instance`](/docs/providers/aws/r/rds_cluster_instance.html) in the cluster. * `deletion_protection` - (Optional) If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`. * `enable_http_endpoint` - (Optional) Enable HTTP endpoint (data API). Only valid when `engine_mode` is set to `serverless`. * `enabled_cloudwatch_logs_exports` - (Optional) Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL). * `engine` - (Required) Name of the database engine to be used for this DB cluster. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). -* `engine_mode` - (Optional) The database engine mode. Valid values: `global` (only valid for Aurora MySQL 1.21 and earlier), `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`. -* `engine_version` - (Optional) The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value, or by running `aws rds describe-db-engine-versions`. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. The value can contain a partial version where supported by the API. The actual engine version used is returned in the attribute `engine_version_actual`, , see [Attributes Reference](#attributes-reference) below. -* `db_cluster_instance_class` - (Optional) The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes and availability for your engine, see [DB instance class](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). -* `final_snapshot_identifier` - (Optional) The name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made. -* `global_cluster_identifier` - (Optional) The global cluster identifier specified on [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html). +* `engine_mode` - (Optional) Database engine mode. Valid values: `global` (only valid for Aurora MySQL 1.21 and earlier), `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`. +* `engine_version` - (Optional) Database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value, or by running `aws rds describe-db-engine-versions`. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. The value can contain a partial version where supported by the API. The actual engine version used is returned in the attribute `engine_version_actual`, , see [Attributes Reference](#attributes-reference) below. +* `db_cluster_instance_class` - (Optional) Compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes and availability for your engine, see [DB instance class](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). +* `final_snapshot_identifier` - (Optional) Name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made. +* `global_cluster_identifier` - (Optional) Global cluster identifier specified on [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html). * `enable_global_write_forwarding` - (Optional) Whether cluster should forward writes to an associated global cluster. Applied to secondary clusters to enable them to forward writes to an [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html)'s primary cluster. See the [Aurora Userguide documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-write-forwarding.html) for more information. * `iam_database_authentication_enabled` - (Optional) Specifies whether or not mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html) for availability and limitations. -* `iam_roles` - (Optional) A List of ARNs for the IAM roles to associate to the RDS Cluster. -* `kms_key_id` - (Optional) The ARN for the KMS encryption key. When specifying `kms_key_id`, `storage_encrypted` needs to be set to true. +* `iam_roles` - (Optional) List of ARNs for the IAM roles to associate to the RDS Cluster. +* `kms_key_id` - (Optional) ARN for the KMS encryption key. When specifying `kms_key_id`, `storage_encrypted` needs to be set to true. * `manage_master_user_password` - (Optional) Set to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if `master_password` is provided. -* `master_user_secret_kms_key_id` - (Optional) The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN. If not specified, the default KMS key for your Amazon Web Services account is used. +* `master_user_secret_kms_key_id` - (Optional) Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN. If not specified, the default KMS key for your Amazon Web Services account is used. * `master_password` - (Required unless `manage_master_user_password` is set to true or unless a `snapshot_identifier` or `replication_source_identifier` is provided or unless a `global_cluster_identifier` is provided when the cluster is the "secondary" cluster of a global database) Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Please refer to the [RDS Naming Constraints][5]. Cannot be set if `manage_master_user_password` is set to `true`. * `master_username` - (Required unless a `snapshot_identifier` or `replication_source_identifier` is provided or unless a `global_cluster_identifier` is provided when the cluster is the "secondary" cluster of a global database) Username for the master DB user. Please refer to the [RDS Naming Constraints][5]. This argument does not support in-place updates and cannot be changed during a restore from snapshot. -* `port` - (Optional) The port on which the DB accepts connections -* `preferred_backup_window` - (Optional) The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC. Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 -* `preferred_maintenance_window` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 +* `port` - (Optional) Port on which the DB accepts connections +* `preferred_backup_window` - (Optional) Daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC. Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 +* `preferred_maintenance_window` - (Optional) Weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `replication_source_identifier` - (Optional) ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica. If DB Cluster is part of a Global Cluster, use the [`lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to prevent Terraform from showing differences for this argument instead of configuring this value. -* `network_type` - (Optional) The network type of the cluster. Valid values: `IPV4`, `DUAL`. +* `network_type` - (Optional) Network type of the cluster. Valid values: `IPV4`, `DUAL`. * `restore_to_point_in_time` - (Optional) Nested attribute for [point in time restore](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PIT.html). More details below. * `scaling_configuration` - (Optional) Nested attribute with scaling properties. Only valid when `engine_mode` is set to `serverless`. More details below. * `serverlessv2_scaling_configuration`- (Optional) Nested attribute with scaling properties for ServerlessV2. Only valid when `engine_mode` is set to `provisioned`. More details below. * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. Conflicts with `global_cluster_identifier`. Clusters cannot be restored from snapshot **and** joined to an existing global cluster in a single operation. See the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-getting-started.html#aurora-global-database.use-snapshot) or the [Global Cluster Restored From Snapshot example](#global-cluster-restored-from-snapshot) for instructions on building a global cluster starting with a snapshot. -* `source_region` - (Optional) The source region for an encrypted replica DB cluster. -* `allocated_storage` - (Optional) The amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster). +* `source_region` - (Optional) Source region for an encrypted replica DB cluster. +* `allocated_storage` - (Optional) Amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster). * `storage_type` - (Optional) Specifies the storage type to be associated with the DB cluster. (This setting is required to create a Multi-AZ DB cluster). Valid values: `io1`, Default: `io1`. -* `iops` - (Optional) The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB instance in the Multi-AZ DB cluster. For information about valid Iops values, see [Amazon RDS Provisioned IOPS storage to improve performance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). Must be a multiple between .5 and 50 of the storage amount for the DB cluster. +* `iops` - (Optional) Amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB instance in the Multi-AZ DB cluster. For information about valid Iops values, see [Amazon RDS Provisioned IOPS storage to improve performance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). Must be a multiple between .5 and 50 of the storage amount for the DB cluster. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engine_mode` and `true` for `serverless` `engine_mode`. When restoring an unencrypted `snapshot_identifier`, the `kms_key_id` argument must be provided to encrypt the restored cluster. Terraform will only perform drift detection if a configuration value is provided. -* `tags` - (Optional) A map of tags to assign to the DB cluster. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `tags` - (Optional) Map of tags to assign to the DB cluster. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate with the Cluster ### S3 Import Options @@ -287,7 +287,7 @@ resource "aws_rds_cluster" "db" { } ``` -* `bucket_name` - (Required) The bucket name where your backup is stored +* `bucket_name` - (Required) Bucket name where your backup is stored * `bucket_prefix` - (Optional) Can be blank, but is the path to your backup * `ingestion_role` - (Required) Role applied to load the data. * `source_engine` - (Required) Source engine for the backup @@ -313,7 +313,7 @@ resource "aws_rds_cluster" "example-clone" { } ``` -* `source_cluster_identifier` - (Required) The identifier of the source database cluster from which to restore. +* `source_cluster_identifier` - (Required) Identifier of the source database cluster from which to restore. * `restore_type` - (Optional) Type of restore to be performed. Valid options are `full-copy` (default) and `copy-on-write`. * `use_latest_restorable_time` - (Optional) Set to true to restore the database cluster to the latest restorable backup time. Defaults to false. Conflicts with `restore_to_time`. @@ -342,10 +342,10 @@ resource "aws_rds_cluster" "example" { ``` * `auto_pause` - (Optional) Whether to enable automatic pause. A DB cluster can be paused only when it's idle (it has no connections). If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it. Defaults to `true`. -* `max_capacity` - (Optional) The maximum capacity for an Aurora DB cluster in `serverless` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid Aurora MySQL capacity values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `256`. Valid Aurora PostgreSQL capacity values are (`2`, `4`, `8`, `16`, `32`, `64`, `192`, and `384`). Defaults to `16`. -* `min_capacity` - (Optional) The minimum capacity for an Aurora DB cluster in `serverless` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid Aurora MySQL capacity values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `256`. Valid Aurora PostgreSQL capacity values are (`2`, `4`, `8`, `16`, `32`, `64`, `192`, and `384`). Defaults to `1`. -* `seconds_until_auto_pause` - (Optional) The time, in seconds, before an Aurora DB cluster in serverless mode is paused. Valid values are `300` through `86400`. Defaults to `300`. -* `timeout_action` - (Optional) The action to take when the timeout is reached. Valid values: `ForceApplyCapacityChange`, `RollbackCapacityChange`. Defaults to `RollbackCapacityChange`. See [documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.timeout-action). +* `max_capacity` - (Optional) Maximum capacity for an Aurora DB cluster in `serverless` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid Aurora MySQL capacity values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `256`. Valid Aurora PostgreSQL capacity values are (`2`, `4`, `8`, `16`, `32`, `64`, `192`, and `384`). Defaults to `16`. +* `min_capacity` - (Optional) Minimum capacity for an Aurora DB cluster in `serverless` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid Aurora MySQL capacity values are `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `256`. Valid Aurora PostgreSQL capacity values are (`2`, `4`, `8`, `16`, `32`, `64`, `192`, and `384`). Defaults to `1`. +* `seconds_until_auto_pause` - (Optional) Time, in seconds, before an Aurora DB cluster in serverless mode is paused. Valid values are `300` through `86400`. Defaults to `300`. +* `timeout_action` - (Optional) Action to take when the timeout is reached. Valid values: `ForceApplyCapacityChange`, `RollbackCapacityChange`. Defaults to `RollbackCapacityChange`. See [documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.timeout-action). ### serverlessv2_scaling_configuration Argument Reference @@ -364,35 +364,35 @@ resource "aws_rds_cluster" "example" { } ``` -* `max_capacity` - (Required) The maximum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid capacity values are in a range of `0.5` up to `128` in steps of `0.5`. -* `min_capacity` - (Required) The minimum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid capacity values are in a range of `0.5` up to `128` in steps of `0.5`. +* `max_capacity` - (Required) Maximum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The maximum capacity must be greater than or equal to the minimum capacity. Valid capacity values are in a range of `0.5` up to `128` in steps of `0.5`. +* `min_capacity` - (Required) Minimum capacity for an Aurora DB cluster in `provisioned` DB engine mode. The minimum capacity must be lesser than or equal to the maximum capacity. Valid capacity values are in a range of `0.5` up to `128` in steps of `0.5`. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of cluster -* `id` - The RDS Cluster Identifier -* `cluster_identifier` - The RDS Cluster Identifier -* `cluster_resource_id` - The RDS Cluster Resource ID +* `id` - RDS Cluster Identifier +* `cluster_identifier` - RDS Cluster Identifier +* `cluster_resource_id` - RDS Cluster Resource ID * `cluster_members` – List of RDS Instances that are a part of this cluster -* `availability_zones` - The availability zone of the instance -* `backup_retention_period` - The backup retention period -* `preferred_backup_window` - The daily time range during which the backups happen -* `preferred_maintenance_window` - The maintenance window -* `endpoint` - The DNS address of the RDS instance -* `reader_endpoint` - A read-only endpoint for the Aurora cluster, automatically +* `availability_zones` - Availability zone of the instance +* `backup_retention_period` - Backup retention period +* `preferred_backup_window` - Daily time range during which the backups happen +* `preferred_maintenance_window` - Maintenance window +* `endpoint` - DNS address of the RDS instance +* `reader_endpoint` - Read-only endpoint for the Aurora cluster, automatically load-balanced across replicas -* `engine` - The database engine -* `engine_version_actual` - The running version of the database. -* `database_name` - The database name -* `port` - The database port -* `master_username` - The master username for the database -* `master_user_secret` - A block that specifies the master user secret. Only available when `manage_master_user_password` is set to true. [Documented below](#master_user_secret). +* `engine` - Database engine +* `engine_version_actual` - Running version of the database. +* `database_name` - Database name +* `port` - Database port +* `master_username` - Master username for the database +* `master_user_secret` - Block that specifies the master user secret. Only available when `manage_master_user_password` is set to true. [Documented below](#master_user_secret). * `storage_encrypted` - Specifies whether the DB cluster is encrypted * `replication_source_identifier` - ARN of the source DB cluster or DB instance if this DB cluster is created as a Read Replica. -* `hosted_zone_id` - The Route53 Hosted Zone ID of the endpoint -* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `hosted_zone_id` - Route53 Hosted Zone ID of the endpoint +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Replication.html [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html @@ -404,9 +404,9 @@ load-balanced across replicas The `master_user_secret` configuration block supports the following attributes: -* `kms_key_id` - The Amazon Web Services KMS key identifier that is used to encrypt the secret. -* `secret_arn` - The Amazon Resource Name (ARN) of the secret. -* `secret_status` - The status of the secret. Valid Values: `creating` | `active` | `rotating` | `impaired`. +* `kms_key_id` - Amazon Web Services KMS key identifier that is used to encrypt the secret. +* `secret_arn` - Amazon Resource Name (ARN) of the secret. +* `secret_status` - Status of the secret. Valid Values: `creating` | `active` | `rotating` | `impaired`. ## Timeouts diff --git a/website/docs/r/rds_cluster_instance.html.markdown b/website/docs/r/rds_cluster_instance.html.markdown index 38fa945a96b1..56cdabc842c4 100644 --- a/website/docs/r/rds_cluster_instance.html.markdown +++ b/website/docs/r/rds_cluster_instance.html.markdown @@ -23,6 +23,8 @@ For more information on Amazon Aurora, see [Aurora on Amazon RDS][2] in the Amaz ~> **NOTE:** Deletion Protection from the RDS service can only be enabled at the cluster level, not for individual cluster instances. You can still add the [`prevent_destroy` lifecycle behavior](https://www.terraform.io/language/meta-arguments/lifecycle#prevent_destroy) to your Terraform resource configuration if you desire protection from accidental deletion. +~> **NOTE:** `aurora` is no longer a valid `engine` because of [Amazon Aurora's MySQL-Compatible Edition version 1 end of life](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.MySQL56.EOL.html). + ## Example Usage ```terraform @@ -51,61 +53,61 @@ the [AWS official documentation](https://docs.aws.amazon.com/cli/latest/referenc The following arguments are supported: -* `identifier` - (Optional, Forces new resource) The identifier for the RDS instance, if omitted, Terraform will assign a random, unique identifier. +* `identifier` - (Optional, Forces new resource) Identifier for the RDS instance, if omitted, Terraform will assign a random, unique identifier. * `identifier_prefix` - (Optional, Forces new resource) Creates a unique identifier beginning with the specified prefix. Conflicts with `identifier`. -* `cluster_identifier` - (Required, Forces new resource) The identifier of the [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html) in which to launch this instance. -* `engine` - (Optional, Forces new resource) The name of the database engine to be used for the RDS instance. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`. +* `cluster_identifier` - (Required, Forces new resource) Identifier of the [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html) in which to launch this instance. +* `engine` - (Required, Forces new resource) Name of the database engine to be used for the RDS instance. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. For information on the difference between the available Aurora MySQL engines see [Comparison between Aurora MySQL 1 and Aurora MySQL 2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Updates.20180206.html) in the Amazon RDS User Guide. -* `engine_version` - (Optional) The database engine version. -* `instance_class` - (Required) The instance class to use. For details on CPU +* `engine_version` - (Optional) Database engine version. +* `instance_class` - (Required) Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances][4]. Aurora uses `db.*` instance classes/types. Please see [AWS Documentation][7] for currently available instance classes and complete details. * `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances][6] for more details on controlling this property. -* `db_subnet_group_name` - (Required if `publicly_accessible = false`, Optional otherwise, Forces new resource) A DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` of the attached [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html). -* `db_parameter_group_name` - (Optional) The name of the DB parameter group to associate with this instance. +* `db_subnet_group_name` - (Required if `publicly_accessible = false`, Optional otherwise, Forces new resource) DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` of the attached [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html). +* `db_parameter_group_name` - (Optional) Name of the DB parameter group to associate with this instance. * `apply_immediately` - (Optional) Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default is`false`. -* `monitoring_role_arn` - (Optional) The ARN for the IAM role that permits RDS to send +* `monitoring_role_arn` - (Optional) ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances. -* `monitoring_interval` - (Optional) The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60. +* `monitoring_interval` - (Optional) Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60. * `promotion_tier` - (Optional) Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer. -* `availability_zone` - (Optional, Computed, Forces new resource) The EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details. -* `preferred_backup_window` - (Optional) The daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted. -* `preferred_maintenance_window` - (Optional) The window to perform maintenance in. +* `availability_zone` - (Optional, Computed, Forces new resource) EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details. +* `preferred_backup_window` - (Optional) Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted. +* `preferred_maintenance_window` - (Optional) Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00". * `auto_minor_version_upgrade` - (Optional) Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`. * `performance_insights_enabled` - (Optional) Specifies whether Performance Insights is enabled or not. * `performance_insights_kms_key_id` - (Optional) ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true. * `performance_insights_retention_period` - (Optional) Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'. * `copy_tags_to_snapshot` – (Optional, boolean) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`. -* `ca_cert_identifier` - (Optional) The identifier of the CA certificate for the DB instance. -* `tags` - (Optional) A map of tags to assign to the instance. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `ca_cert_identifier` - (Optional) Identifier of the CA certificate for the DB instance. +* `tags` - (Optional) Map of tags to assign to the instance. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of cluster instance -* `cluster_identifier` - The RDS Cluster Identifier -* `identifier` - The Instance identifier -* `id` - The Instance identifier +* `cluster_identifier` - RDS Cluster Identifier +* `identifier` - Instance identifier +* `id` - Instance identifier * `writer` – Boolean indicating if this instance is writable. `False` indicates this instance is a read replica. -* `availability_zone` - The availability zone of the instance -* `endpoint` - The DNS address for this instance. May not be writable -* `engine` - The database engine -* `engine_version_actual` - The database engine version -* `port` - The database port +* `availability_zone` - Availability zone of the instance +* `endpoint` - DNS address for this instance. May not be writable +* `engine` - Database engine +* `engine_version_actual` - Database engine version +* `port` - Database port * `storage_encrypted` - Specifies whether the DB cluster is encrypted. -* `kms_key_id` - The ARN for the KMS encryption key if one is set to the cluster. -* `network_type` - The network type of the DB instance. -* `dbi_resource_id` - The region-unique, immutable identifier for the DB instance. +* `kms_key_id` - ARN for the KMS encryption key if one is set to the cluster. +* `network_type` - Network type of the DB instance. +* `dbi_resource_id` - Region-unique, immutable identifier for the DB instance. * `performance_insights_enabled` - Specifies whether Performance Insights is enabled or not. -* `performance_insights_kms_key_id` - The ARN for the KMS encryption key used by Performance Insights. -* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `performance_insights_kms_key_id` - ARN for the KMS encryption key used by Performance Insights. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html [3]: /docs/providers/aws/r/rds_cluster.html From 8110085de7beb3305895de4e3c9ea24d8d075280 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 11:20:57 -0400 Subject: [PATCH 173/304] Update docs --- website/docs/r/rds_cluster.html.markdown | 16 +++---- .../docs/r/rds_cluster_instance.html.markdown | 42 +++++++------------ 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 6ca852b57090..e5a829bb0d22 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -220,6 +220,7 @@ the AWS official documentation : The following arguments are supported: +* `allocated_storage` - (Optional) Amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster). * `allow_major_version_upgrade` - (Optional) Enable to allow major engine version upgrades when changing engine versions. Defaults to `false`. * `apply_immediately` - (Optional) Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html) * `availability_zones` - (Optional) List of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next Terraform apply. We recommend specifying 3 AZs or using [the `lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) if necessary. A maximum of 3 AZs can be configured. @@ -229,41 +230,40 @@ The following arguments are supported: * `cluster_identifier` - (Optional, Forces new resources) The cluster identifier. If omitted, Terraform will assign a random, unique identifier. * `copy_tags_to_snapshot` – (Optional, boolean) Copy all Cluster `tags` to snapshots. Default is `false`. * `database_name` - (Optional) Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: [RDS Naming Constraints][5] +* `db_cluster_instance_class` - (Optional) Compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes and availability for your engine, see [DB instance class](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). * `db_cluster_parameter_group_name` - (Optional) Cluster parameter group to associate with the cluster. * `db_instance_parameter_group_name` - (Optional) Instance parameter group to associate with all instances of the DB cluster. The `db_instance_parameter_group_name` parameter is only valid in combination with the `allow_major_version_upgrade` parameter. * `db_subnet_group_name` - (Optional) DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` specified on every [`aws_rds_cluster_instance`](/docs/providers/aws/r/rds_cluster_instance.html) in the cluster. * `deletion_protection` - (Optional) If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`. +* `enable_global_write_forwarding` - (Optional) Whether cluster should forward writes to an associated global cluster. Applied to secondary clusters to enable them to forward writes to an [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html)'s primary cluster. See the [Aurora Userguide documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-write-forwarding.html) for more information. * `enable_http_endpoint` - (Optional) Enable HTTP endpoint (data API). Only valid when `engine_mode` is set to `serverless`. * `enabled_cloudwatch_logs_exports` - (Optional) Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL). -* `engine` - (Required) Name of the database engine to be used for this DB cluster. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). * `engine_mode` - (Optional) Database engine mode. Valid values: `global` (only valid for Aurora MySQL 1.21 and earlier), `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`. * `engine_version` - (Optional) Database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value, or by running `aws rds describe-db-engine-versions`. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. The value can contain a partial version where supported by the API. The actual engine version used is returned in the attribute `engine_version_actual`, , see [Attributes Reference](#attributes-reference) below. -* `db_cluster_instance_class` - (Optional) Compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes and availability for your engine, see [DB instance class](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). +* `engine` - (Required) Name of the database engine to be used for this DB cluster. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). * `final_snapshot_identifier` - (Optional) Name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made. * `global_cluster_identifier` - (Optional) Global cluster identifier specified on [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html). -* `enable_global_write_forwarding` - (Optional) Whether cluster should forward writes to an associated global cluster. Applied to secondary clusters to enable them to forward writes to an [`aws_rds_global_cluster`](/docs/providers/aws/r/rds_global_cluster.html)'s primary cluster. See the [Aurora Userguide documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-write-forwarding.html) for more information. * `iam_database_authentication_enabled` - (Optional) Specifies whether or not mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html) for availability and limitations. * `iam_roles` - (Optional) List of ARNs for the IAM roles to associate to the RDS Cluster. +* `iops` - (Optional) Amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB instance in the Multi-AZ DB cluster. For information about valid Iops values, see [Amazon RDS Provisioned IOPS storage to improve performance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). Must be a multiple between .5 and 50 of the storage amount for the DB cluster. * `kms_key_id` - (Optional) ARN for the KMS encryption key. When specifying `kms_key_id`, `storage_encrypted` needs to be set to true. * `manage_master_user_password` - (Optional) Set to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if `master_password` is provided. -* `master_user_secret_kms_key_id` - (Optional) Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN. If not specified, the default KMS key for your Amazon Web Services account is used. * `master_password` - (Required unless `manage_master_user_password` is set to true or unless a `snapshot_identifier` or `replication_source_identifier` is provided or unless a `global_cluster_identifier` is provided when the cluster is the "secondary" cluster of a global database) Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Please refer to the [RDS Naming Constraints][5]. Cannot be set if `manage_master_user_password` is set to `true`. +* `master_user_secret_kms_key_id` - (Optional) Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN. If not specified, the default KMS key for your Amazon Web Services account is used. * `master_username` - (Required unless a `snapshot_identifier` or `replication_source_identifier` is provided or unless a `global_cluster_identifier` is provided when the cluster is the "secondary" cluster of a global database) Username for the master DB user. Please refer to the [RDS Naming Constraints][5]. This argument does not support in-place updates and cannot be changed during a restore from snapshot. +* `network_type` - (Optional) Network type of the cluster. Valid values: `IPV4`, `DUAL`. * `port` - (Optional) Port on which the DB accepts connections * `preferred_backup_window` - (Optional) Daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC. Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00 * `preferred_maintenance_window` - (Optional) Weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30 * `replication_source_identifier` - (Optional) ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica. If DB Cluster is part of a Global Cluster, use the [`lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to prevent Terraform from showing differences for this argument instead of configuring this value. -* `network_type` - (Optional) Network type of the cluster. Valid values: `IPV4`, `DUAL`. * `restore_to_point_in_time` - (Optional) Nested attribute for [point in time restore](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PIT.html). More details below. * `scaling_configuration` - (Optional) Nested attribute with scaling properties. Only valid when `engine_mode` is set to `serverless`. More details below. * `serverlessv2_scaling_configuration`- (Optional) Nested attribute with scaling properties for ServerlessV2. Only valid when `engine_mode` is set to `provisioned`. More details below. * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is `false`. * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. Conflicts with `global_cluster_identifier`. Clusters cannot be restored from snapshot **and** joined to an existing global cluster in a single operation. See the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-getting-started.html#aurora-global-database.use-snapshot) or the [Global Cluster Restored From Snapshot example](#global-cluster-restored-from-snapshot) for instructions on building a global cluster starting with a snapshot. * `source_region` - (Optional) Source region for an encrypted replica DB cluster. -* `allocated_storage` - (Optional) Amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. (This setting is required to create a Multi-AZ DB cluster). -* `storage_type` - (Optional) Specifies the storage type to be associated with the DB cluster. (This setting is required to create a Multi-AZ DB cluster). Valid values: `io1`, Default: `io1`. -* `iops` - (Optional) Amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB instance in the Multi-AZ DB cluster. For information about valid Iops values, see [Amazon RDS Provisioned IOPS storage to improve performance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS) in the Amazon RDS User Guide. (This setting is required to create a Multi-AZ DB cluster). Must be a multiple between .5 and 50 of the storage amount for the DB cluster. * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engine_mode` and `true` for `serverless` `engine_mode`. When restoring an unencrypted `snapshot_identifier`, the `kms_key_id` argument must be provided to encrypt the restored cluster. Terraform will only perform drift detection if a configuration value is provided. +* `storage_type` - (Optional) Specifies the storage type to be associated with the DB cluster. (This setting is required to create a Multi-AZ DB cluster). Valid values: `io1`, Default: `io1`. * `tags` - (Optional) Map of tags to assign to the DB cluster. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate with the Cluster diff --git a/website/docs/r/rds_cluster_instance.html.markdown b/website/docs/r/rds_cluster_instance.html.markdown index 56cdabc842c4..6e0c2e6c2a51 100644 --- a/website/docs/r/rds_cluster_instance.html.markdown +++ b/website/docs/r/rds_cluster_instance.html.markdown @@ -53,38 +53,28 @@ the [AWS official documentation](https://docs.aws.amazon.com/cli/latest/referenc The following arguments are supported: -* `identifier` - (Optional, Forces new resource) Identifier for the RDS instance, if omitted, Terraform will assign a random, unique identifier. -* `identifier_prefix` - (Optional, Forces new resource) Creates a unique identifier beginning with the specified prefix. Conflicts with `identifier`. +* `apply_immediately` - (Optional) Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default is`false`. +* `auto_minor_version_upgrade` - (Optional) Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`. +* `availability_zone` - (Optional, Computed, Forces new resource) EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details. +* `ca_cert_identifier` - (Optional) Identifier of the CA certificate for the DB instance. * `cluster_identifier` - (Required, Forces new resource) Identifier of the [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html) in which to launch this instance. -* `engine` - (Required, Forces new resource) Name of the database engine to be used for the RDS instance. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. -For information on the difference between the available Aurora MySQL engines -see [Comparison between Aurora MySQL 1 and Aurora MySQL 2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Updates.20180206.html) -in the Amazon RDS User Guide. -* `engine_version` - (Optional) Database engine version. -* `instance_class` - (Required) Instance class to use. For details on CPU -and memory, see [Scaling Aurora DB Instances][4]. Aurora uses `db.*` instance classes/types. Please see [AWS Documentation][7] for currently available instance classes and complete details. -* `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. -Default `false`. See the documentation on [Creating DB Instances][6] for more -details on controlling this property. -* `db_subnet_group_name` - (Required if `publicly_accessible = false`, Optional otherwise, Forces new resource) DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` of the attached [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html). +* `copy_tags_to_snapshot` – (Optional, boolean) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`. * `db_parameter_group_name` - (Optional) Name of the DB parameter group to associate with this instance. -* `apply_immediately` - (Optional) Specifies whether any database modifications - are applied immediately, or during the next maintenance window. Default is`false`. -* `monitoring_role_arn` - (Optional) ARN for the IAM role that permits RDS to send -enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) -what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances. +* `db_subnet_group_name` - (Required if `publicly_accessible = false`, Optional otherwise, Forces new resource) DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` of the attached [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html). +* `engine_version` - (Optional) Database engine version. +* `engine` - (Required, Forces new resource) Name of the database engine to be used for the RDS instance. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. +* `identifier_prefix` - (Optional, Forces new resource) Creates a unique identifier beginning with the specified prefix. Conflicts with `identifier`. +* `identifier` - (Optional, Forces new resource) Identifier for the RDS instance, if omitted, Terraform will assign a random, unique identifier. +* `instance_class` - (Required) Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances][4]. Aurora uses `db.*` instance classes/types. Please see [AWS Documentation][7] for currently available instance classes and complete details. * `monitoring_interval` - (Optional) Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60. -* `promotion_tier` - (Optional) Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer. -* `availability_zone` - (Optional, Computed, Forces new resource) EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details. -* `preferred_backup_window` - (Optional) Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted. -* `preferred_maintenance_window` - (Optional) Window to perform maintenance in. - Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00". -* `auto_minor_version_upgrade` - (Optional) Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`. +* `monitoring_role_arn` - (Optional) ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances. * `performance_insights_enabled` - (Optional) Specifies whether Performance Insights is enabled or not. * `performance_insights_kms_key_id` - (Optional) ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true. * `performance_insights_retention_period` - (Optional) Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'. -* `copy_tags_to_snapshot` – (Optional, boolean) Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`. -* `ca_cert_identifier` - (Optional) Identifier of the CA certificate for the DB instance. +* `preferred_backup_window` - (Optional) Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted. +* `preferred_maintenance_window` - (Optional) Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00". +* `promotion_tier` - (Optional) Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer. +* `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances][6] for more details on controlling this property. * `tags` - (Optional) Map of tags to assign to the instance. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference From 738519ca039b5dac7a576a4e07a235187e01c007 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 11:48:09 -0400 Subject: [PATCH 174/304] Documenrt EC2-Classic retirement removals. --- website/docs/guides/version-5-upgrade.html.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index fd4948133571..92e44c8039c9 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -70,4 +70,21 @@ provider "aws" { ## EC2-Classic Retirement -Blah. +Following the retirement of EC2-Classic a number of resources and attributes have been removed. + +* The `aws_db_security_group` resource has been removed +* The `aws_elasticache_security_group` resource has been removed +* The `aws_redshift_security_group` resource has been removed +* The [`aws_db_instance`](/docs/providers/aws/r/db_instance.html) resource's `security_group_names` argument has been removed +* The [`aws_elasticache_cluster`](/docs/providers/aws/r/elasticache_cluster.html) resource's `security_group_names` argument has been removed +* The [`aws_redshift_cluster`](/docs/providers/aws/r/redshift_cluster.html) resource's `cluster_security_groups` argument has been removed +* The [`aws_launch_configuration`](/docs/providers/aws/r/launch_configuration.html) resource's `vpc_classic_link_id` and `vpc_classic_link_security_groups` arguments have been removed +* The [`aws_vpc`](/docs/providers/aws/r/vpc.html) resource's `enable_classiclink` and `enable_classiclink_dns_support` arguments have been removed +* The [`aws_default_vpc`](/docs/providers/aws/r/default_vpc.html) resource's `enable_classiclink` and `enable_classiclink_dns_support` arguments have been removed +* The [`aws_vpc_peering_connection`](/docs/providers/aws/r/vpc_peering_connection.html) resource's `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` arguments have been removed +* The [`aws_vpc_peering_connection_accepter`](/docs/providers/aws/r/vpc_peering_connection_accepter.html) resource's `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` arguments have been removed +* The [`aws_vpc_peering_connection_options`](/docs/providers/aws/r/vpc_peering_connection_options.html) resource's `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` arguments have been removed +* The [`aws_db_instance`](/docs/providers/aws/d/db_instance.html) data source's `db_security_groups` attribute has been removed +* The [`aws_elasticache_cluster`](/docs/providers/aws/d/elasticache_cluster.html) data source's `security_group_names` attribute has been removed +* The [`aws_redshift_cluster`](/docs/providers/aws/d/redshift_cluster.html) data source's `cluster_security_groups` attribute has been removed +* The [`aws_launch_configuration`](/docs/providers/aws/d/launch_configuration.html) data source's `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed From 1ea8eb5a99adc6efd03feeee6016dafde73683a8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 11:50:39 -0400 Subject: [PATCH 175/304] Document Macie Classic retirement removals. --- website/docs/guides/version-5-upgrade.html.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 92e44c8039c9..2e16e81cd6a3 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -25,6 +25,7 @@ Additional Topics: - [EC2-Classic Retirement](#ec2-classic-retirement) +- [Macie Classic Retirement](#macie-classic-retirement) @@ -88,3 +89,10 @@ Following the retirement of EC2-Classic a number of resources and attributes hav * The [`aws_elasticache_cluster`](/docs/providers/aws/d/elasticache_cluster.html) data source's `security_group_names` attribute has been removed * The [`aws_redshift_cluster`](/docs/providers/aws/d/redshift_cluster.html) data source's `cluster_security_groups` attribute has been removed * The [`aws_launch_configuration`](/docs/providers/aws/d/launch_configuration.html) data source's `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed + +## Macie Classic Retirement + +Following the retirement of Amazon Macie Classic a couple of resources have been removed. + +* The `aws_macie_member_account_association` resource has been removed +* The `aws_macie_s3_bucket_association` resource has been removed From 431e9dc374626fd0206f40ce596d2e0ce4534e95 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 11:53:34 -0400 Subject: [PATCH 176/304] Document d/aws_redshift_service_account deprecation. --- website/docs/guides/version-5-upgrade.html.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 2e16e81cd6a3..11ad2de365f5 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -17,6 +17,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) +- [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) @@ -69,6 +70,11 @@ provider "aws" { } ``` +## Data Source: aws_redshift_service_account + +[AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. +The [`aws_redshift_service_account`](/docs/providers/aws/d/redshift_service_account.html) data source should now be considered deprecated and will be removed in a future version. + ## EC2-Classic Retirement Following the retirement of EC2-Classic a number of resources and attributes have been removed. From 183319280ef2903f147f015bbc6ea7a1518aae28 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 11:57:55 -0400 Subject: [PATCH 177/304] Document 'aws_acmpca_certificate_authority.status' removal. --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 11ad2de365f5..31d7aa9cc568 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -18,6 +18,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) +- [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) @@ -70,6 +71,10 @@ provider "aws" { } ``` +## Resource: aws_acmpca_certificate_authority + +The `status` attribute is superfluous and sometimes incorrect. It has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From fc70c7d3e84577e9c4802ad0c02bd0fee8ae6401 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 3 May 2023 16:44:04 +0000 Subject: [PATCH 178/304] Update CHANGELOG.md for #31135 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7987cca70006..72f2be63e81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ BREAKING CHANGES: * data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_elasticache_replication_group: Remove `number_cache_clusters`, `replication_group_description` arguments -- use `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* data-source/aws_iam_policy_document: Don't add empty `statement.sid` values to `json` attribute value ([#28539](https://github.com/hashicorp/terraform-provider-aws/issues/28539)) * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) * data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From d2a930b1a05d4761274d89d6bbdb9384bbe5bdba Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:08:35 -0400 Subject: [PATCH 179/304] d/aws_subnet_ids: Remove data source. --- internal/service/ec2/service_package_gen.go | 4 - .../service/ec2/vpc_subnet_ids_data_source.go | 94 -------- .../ec2/vpc_subnet_ids_data_source_test.go | 210 ------------------ website/docs/d/subnet_ids.html.markdown | 93 -------- 4 files changed, 401 deletions(-) delete mode 100644 internal/service/ec2/vpc_subnet_ids_data_source.go delete mode 100644 internal/service/ec2/vpc_subnet_ids_data_source_test.go delete mode 100644 website/docs/d/subnet_ids.html.markdown diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index 84af2879bbb5..8a435049a9d0 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -315,10 +315,6 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceSubnet, TypeName: "aws_subnet", }, - { - Factory: DataSourceSubnetIDs, - TypeName: "aws_subnet_ids", - }, { Factory: DataSourceSubnets, TypeName: "aws_subnets", diff --git a/internal/service/ec2/vpc_subnet_ids_data_source.go b/internal/service/ec2/vpc_subnet_ids_data_source.go deleted file mode 100644 index ef203fb04f4f..000000000000 --- a/internal/service/ec2/vpc_subnet_ids_data_source.go +++ /dev/null @@ -1,94 +0,0 @@ -package ec2 - -import ( - "context" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/conns" - "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" -) - -// @SDKDataSource("aws_subnet_ids") -func DataSourceSubnetIDs() *schema.Resource { - return &schema.Resource{ - ReadWithoutTimeout: dataSourceSubnetIDsRead, - - Timeouts: &schema.ResourceTimeout{ - Read: schema.DefaultTimeout(20 * time.Minute), - }, - - Schema: map[string]*schema.Schema{ - "filter": CustomFiltersSchema(), - "ids": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "tags": tftags.TagsSchemaComputed(), - "vpc_id": { - Type: schema.TypeString, - Required: true, - }, - }, - DeprecationMessage: `The aws_subnet_ids data source has been deprecated and will be removed in a future version. ` + - `Use the aws_subnets data source instead: ` + - `https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets`, - } -} - -func dataSourceSubnetIDsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).EC2Conn() - - input := &ec2.DescribeSubnetsInput{} - - if vpc, vpcOk := d.GetOk("vpc_id"); vpcOk { - input.Filters = BuildAttributeFilterList( - map[string]string{ - "vpc-id": vpc.(string), - }, - ) - } - - if tags, tagsOk := d.GetOk("tags"); tagsOk { - input.Filters = append(input.Filters, BuildTagFilterList( - Tags(tftags.New(ctx, tags.(map[string]interface{}))), - )...) - } - - if filters, filtersOk := d.GetOk("filter"); filtersOk { - input.Filters = append(input.Filters, BuildCustomFilterList( - filters.(*schema.Set), - )...) - } - - if len(input.Filters) == 0 { - input.Filters = nil - } - - output, err := FindSubnets(ctx, conn, input) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading EC2 Subnets: %s", err) - } - - if len(output) == 0 { - return sdkdiag.AppendErrorf(diags, "no matching EC2 Subnets found") - } - - var subnetIDs []string - - for _, v := range output { - subnetIDs = append(subnetIDs, aws.StringValue(v.SubnetId)) - } - - d.SetId(d.Get("vpc_id").(string)) - d.Set("ids", subnetIDs) - - return diags -} diff --git a/internal/service/ec2/vpc_subnet_ids_data_source_test.go b/internal/service/ec2/vpc_subnet_ids_data_source_test.go deleted file mode 100644 index bdcea2e2eb97..000000000000 --- a/internal/service/ec2/vpc_subnet_ids_data_source_test.go +++ /dev/null @@ -1,210 +0,0 @@ -package ec2_test - -import ( - "fmt" - "testing" - - "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" -) - -func TestAccVPCSubnetIDsDataSource_basic(t *testing.T) { - ctx := acctest.Context(t) - rInt := sdkacctest.RandIntRange(0, 256) - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckVPCDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccVPCSubnetIDsDataSourceConfig_basic(rName, rInt), - }, - { - Config: testAccVPCSubnetIDsDataSourceConfig_dataSource(rName, rInt), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_subnet_ids.selected", "ids.#", "3"), - resource.TestCheckResourceAttr("data.aws_subnet_ids.private", "ids.#", "2"), - ), - }, - }, - }) -} - -func TestAccVPCSubnetIDsDataSource_filter(t *testing.T) { - ctx := acctest.Context(t) - rInt := sdkacctest.RandIntRange(0, 256) - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckVPCDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccVPCSubnetIdsDataSourceConfig_filter(rName, rInt), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_subnet_ids.test", "ids.#", "2"), - ), - }, - }, - }) -} - -func testAccVPCSubnetIDsDataSourceConfig_dataSource(rName string, rInt int) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "172.%[2]d.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test_public_a" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.123.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - Tier = "Public" - } -} - -resource "aws_subnet" "test_private_a" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.125.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - Tier = "Private" - } -} - -resource "aws_subnet" "test_private_b" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.126.0/24" - availability_zone = data.aws_availability_zones.available.names[1] - - tags = { - Name = %[1]q - Tier = "Private" - } -} - -data "aws_subnet_ids" "selected" { - vpc_id = aws_vpc.test.id -} - -data "aws_subnet_ids" "private" { - vpc_id = aws_vpc.test.id - - tags = { - Tier = "Private" - } -} -`, rName, rInt)) -} - -func testAccVPCSubnetIDsDataSourceConfig_basic(rName string, rInt int) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "172.%[2]d.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test_public_a" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.123.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - Tier = "Public" - } -} - -resource "aws_subnet" "test_private_a" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.125.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - Tier = "Private" - } -} - -resource "aws_subnet" "test_private_b" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.126.0/24" - availability_zone = data.aws_availability_zones.available.names[1] - - tags = { - Name = %[1]q - Tier = "Private" - } -} -`, rName, rInt)) -} - -func testAccVPCSubnetIdsDataSourceConfig_filter(rName string, rInt int) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "172.%[2]d.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test_a_one" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.1.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test_a_two" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.2.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test_b" { - vpc_id = aws_vpc.test.id - cidr_block = "172.%[2]d.3.0/24" - availability_zone = data.aws_availability_zones.available.names[1] - - tags = { - Name = %[1]q - } -} - -data "aws_subnet_ids" "test" { - vpc_id = aws_subnet.test_a_two.vpc_id - - filter { - name = "availabilityZone" - values = [aws_subnet.test_a_one.availability_zone] - } -} -`, rName, rInt)) -} diff --git a/website/docs/d/subnet_ids.html.markdown b/website/docs/d/subnet_ids.html.markdown deleted file mode 100644 index b4b56f2f96de..000000000000 --- a/website/docs/d/subnet_ids.html.markdown +++ /dev/null @@ -1,93 +0,0 @@ ---- -subcategory: "VPC (Virtual Private Cloud)" -layout: "aws" -page_title: "AWS: aws_subnet_ids" -description: |- - Provides a set of subnet Ids for a VPC ---- - -# Data Source: aws_subnet_ids - -`aws_subnet_ids` provides a set of ids for a vpc_id - -This resource can be useful for getting back a set of subnet ids for a vpc. - -~> **NOTE:** The `aws_subnet_ids` data source has been deprecated and will be removed in a future version. Use the [`aws_subnets`](subnets.html) data source instead. - -## Example Usage - -The following shows outputting all cidr blocks for every subnet id in a vpc. - -```terraform -data "aws_subnet_ids" "example" { - vpc_id = var.vpc_id -} - -data "aws_subnet" "example" { - for_each = data.aws_subnet_ids.example.ids - id = each.value -} - -output "subnet_cidr_blocks" { - value = [for s in data.aws_subnet.example : s.cidr_block] -} -``` - -The following example retrieves a set of all subnets in a VPC with a custom -tag of `Tier` set to a value of "Private" so that the `aws_instance` resource -can loop through the subnets, putting instances across availability zones. - -```terraform -data "aws_subnet_ids" "private" { - vpc_id = var.vpc_id - - tags = { - Tier = "Private" - } -} - -resource "aws_instance" "app" { - for_each = data.aws_subnet_ids.private.ids - ami = var.ami - instance_type = "t2.micro" - subnet_id = each.value -} -``` - -## Argument Reference - -* `vpc_id` - (Required) VPC ID that you want to filter from. - -* `filter` - (Optional) Custom filter block as described below. - -* `tags` - (Optional) Map of tags, each pair of which must exactly match - a pair on the desired subnets. - -More complex filters can be expressed using one or more `filter` sub-blocks, -which take the following arguments: - -* `name` - (Required) Name of the field to filter by, as defined by - [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html). - For example, if matching against tag `Name`, use: - -```terraform -data "aws_subnet_ids" "selected" { - filter { - name = "tag:Name" - values = [""] # insert values here - } -} -``` - -* `values` - (Required) Set of values that are accepted for the given field. - Subnet IDs will be selected if any one of the given values match. - -## Attributes Reference - -* `ids` - Set of all the subnet ids found. This data source will fail if none are found. - -## Timeouts - -[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): - -- `read` - (Default `20m`) From 3ce568a7db83f3833a4907d8574f7106e6fec385 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:14:21 -0400 Subject: [PATCH 180/304] Add CHANGELOG entry. --- .changelog/#####.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..41283e588625 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +provider: The `aws_subnet_ids` data source has been removed +``` \ No newline at end of file From 5da8021bb032ee04851375529f6f00bda986fd65 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:18:09 -0400 Subject: [PATCH 181/304] d/aws_subnet_ids: Remove from acceptance test configurations. --- .../ec2/vpc_endpoint_connection_accepter_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go index 22e2f758f79b..5efa3b706050 100644 --- a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go @@ -187,15 +187,18 @@ resource "aws_subnet" "test_alternate3" { } } -data "aws_subnet_ids" "alternate_intersect" { +data "aws_subnets" "alternate_intersect" { provider = "awsalternate" - vpc_id = aws_vpc.test_alternate.id - filter { name = "availabilityZone" values = aws_vpc_endpoint_service.test.availability_zones } + + filter { + name = "vpc-id" + values = [aws_vpc.test_alternate.id] + } } resource "aws_lb" "test" { @@ -246,7 +249,7 @@ resource "aws_vpc_endpoint" "test" { vpc_id = aws_vpc.test_alternate.id service_name = aws_vpc_endpoint_service.test.service_name - subnet_ids = data.aws_subnet_ids.alternate_intersect.ids + subnet_ids = data.aws_subnets.alternate_intersect.ids vpc_endpoint_type = "Interface" private_dns_enabled = false From cf51f5d5f7fe4338850e2b21b330e6f3a6f84490 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 3 May 2023 17:31:48 +0000 Subject: [PATCH 182/304] Update CHANGELOG.md for #31112 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72f2be63e81c..7b9d2f2d5d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,9 @@ BREAKING CHANGES: * resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) * resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) +* resource/aws_rds_cluster: The `engine` argument is now required and has no default ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) * resource/aws_rds_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) +* resource/aws_rds_cluster_instance: The `engine` argument is now required and has no default ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) * resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_route: `instance_id` can no longer be set in configurations. Use `network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: `route.*.instance_id` can no longer be set in configurations. Use `route.*.network_interface_id` instead, for example, setting `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) @@ -59,6 +61,8 @@ NOTES: * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) +* resource/aws_rds_cluster: Configurations not including the `engine` argument must be updated to include `engine` as it is now required. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) +* resource/aws_rds_cluster_instance: Configurations not including the `engine` argument must be updated to include `engine` as it is now required. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster instance ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) From 82f358a020d8722879500f047c6724bc22dae889 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:45:59 -0400 Subject: [PATCH 183/304] d/aws_subnet_ids: Remove from documentation examples. --- website/docs/r/apigatewayv2_vpc_link.html.markdown | 2 +- website/docs/r/elasticsearch_domain.html.markdown | 11 +++++++---- website/docs/r/opensearch_domain.html.markdown | 11 +++++++---- website/docs/r/spot_fleet_request.html.markdown | 7 +++++-- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/website/docs/r/apigatewayv2_vpc_link.html.markdown b/website/docs/r/apigatewayv2_vpc_link.html.markdown index 23d3d58de7c8..38aad822420e 100644 --- a/website/docs/r/apigatewayv2_vpc_link.html.markdown +++ b/website/docs/r/apigatewayv2_vpc_link.html.markdown @@ -19,7 +19,7 @@ To enable private integration for REST APIs, use the Amazon API Gateway Version resource "aws_apigatewayv2_vpc_link" "example" { name = "example" security_group_ids = [data.aws_security_group.example.id] - subnet_ids = data.aws_subnet_ids.example.ids + subnet_ids = data.aws_subnets.example.ids tags = { Usage = "example" diff --git a/website/docs/r/elasticsearch_domain.html.markdown b/website/docs/r/elasticsearch_domain.html.markdown index d976b6d315f5..c4e81949db4f 100644 --- a/website/docs/r/elasticsearch_domain.html.markdown +++ b/website/docs/r/elasticsearch_domain.html.markdown @@ -122,8 +122,11 @@ data "aws_vpc" "selected" { } } -data "aws_subnet_ids" "selected" { - vpc_id = data.aws_vpc.selected.id +data "aws_subnets" "selected" { + filter { + name = "vpc-id" + values = [data.aws_vpc.selected.id] + } tags = { Tier = "private" @@ -165,8 +168,8 @@ resource "aws_elasticsearch_domain" "es" { vpc_options { subnet_ids = [ - data.aws_subnet_ids.selected.ids[0], - data.aws_subnet_ids.selected.ids[1], + data.aws_subnets.selected.ids[0], + data.aws_subnets.selected.ids[1], ] security_group_ids = [aws_security_group.es.id] diff --git a/website/docs/r/opensearch_domain.html.markdown b/website/docs/r/opensearch_domain.html.markdown index af9c79e071d0..586cfa3a3489 100644 --- a/website/docs/r/opensearch_domain.html.markdown +++ b/website/docs/r/opensearch_domain.html.markdown @@ -143,8 +143,11 @@ data "aws_vpc" "example" { } } -data "aws_subnet_ids" "example" { - vpc_id = data.aws_vpc.example.id +data "aws_subnets" "example" { + filter { + name = "vpc-id" + values = [data.aws_vpc.example.id] + } tags = { Tier = "private" @@ -200,8 +203,8 @@ resource "aws_opensearch_domain" "example" { vpc_options { subnet_ids = [ - data.aws_subnet_ids.example.ids[0], - data.aws_subnet_ids.example.ids[1], + data.aws_subnets.example.ids[0], + data.aws_subnets.example.ids[1], ] security_group_ids = [aws_security_group.example.id] diff --git a/website/docs/r/spot_fleet_request.html.markdown b/website/docs/r/spot_fleet_request.html.markdown index 3a39b2337493..8d9b08cfc4ee 100644 --- a/website/docs/r/spot_fleet_request.html.markdown +++ b/website/docs/r/spot_fleet_request.html.markdown @@ -155,8 +155,11 @@ resource "aws_spot_fleet_request" "example" { ### Using multiple launch configurations ```terraform -data "aws_subnet_ids" "example" { - vpc_id = var.vpc_id +data "aws_subnets" "example" { + filter { + name = "vpc-id" + values = [var.vpc_id] + } } resource "aws_launch_template" "foo" { From 3ce1e95656349dcf71ae5a526a263a369ef16d38 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:50:32 -0400 Subject: [PATCH 184/304] d/aws_subnet_ids: Add removal to upgrade guide. --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 31d7aa9cc568..90e531bc19a9 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -18,6 +18,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) +- [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) @@ -80,6 +81,10 @@ The `status` attribute is superfluous and sometimes incorrect. It has been remov [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. The [`aws_redshift_service_account`](/docs/providers/aws/d/redshift_service_account.html) data source should now be considered deprecated and will be removed in a future version. +## Data Source: aws_subnet_ids + +The `aws_subnet_ids` data source has been removed. Use the [`aws_subnets`](/docs/providers/aws/d/subnets.html) data source instead. + ## EC2-Classic Retirement Following the retirement of EC2-Classic a number of resources and attributes have been removed. From a0d38d1825d2643b60a64ac371a4622fc61053ca Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 13:53:05 -0400 Subject: [PATCH 185/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31140.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31140.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31140.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31140.txt From 2c1232303ae1b53b0c2bea08fd30fcc4926fd6b8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 14:20:53 -0400 Subject: [PATCH 186/304] Update 30374.txt --- .changelog/30374.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/30374.txt b/.changelog/30374.txt index 116413b56c9e..7a6561e2d2ca 100644 --- a/.changelog/30374.txt +++ b/.changelog/30374.txt @@ -1,3 +1,3 @@ ```release-note:note -resource/aws_ce_anomaly_subscription: The `threshold` attribute have been removed to match the AWS Cost Explorer API documentation. +resource/aws_ce_anomaly_subscription: The `threshold` attribute has been removed ``` From 6308eb9681fc12ab390ae5cf0d177d03a83ebf0f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 14:21:09 -0400 Subject: [PATCH 187/304] Update 30374.txt --- .changelog/30374.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/30374.txt b/.changelog/30374.txt index 7a6561e2d2ca..f668518fe533 100644 --- a/.changelog/30374.txt +++ b/.changelog/30374.txt @@ -1,3 +1,3 @@ -```release-note:note +```release-note:breaking-change resource/aws_ce_anomaly_subscription: The `threshold` attribute has been removed ``` From adf245a1bebb7f0ec25b55fb6a10731f9470e96e Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 3 May 2023 18:28:21 +0000 Subject: [PATCH 188/304] Update CHANGELOG.md for #31140 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b9d2f2d5d68..4f1cae35ac3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BREAKING CHANGES: * data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: The `aws_subnet_ids` data source has been removed ([#31140](https://github.com/hashicorp/terraform-provider-aws/issues/31140)) * provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -22,6 +23,7 @@ BREAKING CHANGES: * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed ([#30452](https://github.com/hashicorp/terraform-provider-aws/issues/30452)) * resource/aws_docdb_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From 04ef61513029d5a96b9370f254c7c092fae10543 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 14:34:29 -0400 Subject: [PATCH 189/304] Add to v5 Upgrade Guide. --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 90e531bc19a9..c3e70a5fe731 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -20,6 +20,7 @@ Upgrade topics: - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) +- [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) @@ -76,6 +77,10 @@ provider "aws" { The `status` attribute is superfluous and sometimes incorrect. It has been removed. +## Resource: aws_ce_anomaly_subscription + +The `threshold` attribute has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From b325714c6a2afaba843796f8f593ed2f5e5e60d9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 14:47:19 -0400 Subject: [PATCH 190/304] firehose/delivery_stream: Make buffering args consistent --- internal/service/firehose/delivery_stream.go | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 4db91ec1ae36..c17a4928126c 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -137,14 +137,14 @@ func s3ConfigurationSchema() *schema.Schema { ValidateFunc: verify.ValidARN, }, - "buffer_size": { + "buffering_size": { Type: schema.TypeInt, Optional: true, Default: 5, ValidateFunc: validation.IntAtLeast(1), }, - "buffer_interval": { + "buffering_interval": { Type: schema.TypeInt, Optional: true, Default: 300, @@ -357,8 +357,8 @@ func flattenExtendedS3Configuration(description *firehose.ExtendedS3DestinationD } if description.BufferingHints != nil { - m["buffer_interval"] = int(aws.Int64Value(description.BufferingHints.IntervalInSeconds)) - m["buffer_size"] = int(aws.Int64Value(description.BufferingHints.SizeInMBs)) + m["buffering_interval"] = int(aws.Int64Value(description.BufferingHints.IntervalInSeconds)) + m["buffering_size"] = int(aws.Int64Value(description.BufferingHints.SizeInMBs)) } if description.EncryptionConfiguration != nil && description.EncryptionConfiguration.KMSEncryptionConfig != nil { @@ -433,8 +433,8 @@ func flattenS3Configuration(description *firehose.S3DestinationDescription) []ma } if description.BufferingHints != nil { - m["buffer_interval"] = int(aws.Int64Value(description.BufferingHints.IntervalInSeconds)) - m["buffer_size"] = int(aws.Int64Value(description.BufferingHints.SizeInMBs)) + m["buffering_interval"] = int(aws.Int64Value(description.BufferingHints.IntervalInSeconds)) + m["buffering_size"] = int(aws.Int64Value(description.BufferingHints.SizeInMBs)) } if description.EncryptionConfiguration != nil && description.EncryptionConfiguration.KMSEncryptionConfig != nil { @@ -1026,13 +1026,13 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: verify.ValidARN, }, - "buffer_size": { + "buffering_size": { Type: schema.TypeInt, Optional: true, Default: 5, }, - "buffer_interval": { + "buffering_interval": { Type: schema.TypeInt, Optional: true, Default: 300, @@ -1786,8 +1786,8 @@ func createS3Config(d *schema.ResourceData) *firehose.S3DestinationConfiguration BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64(int64(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64(int64(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64(int64(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64(int64(s3["buffering_size"].(int))), }, Prefix: extractPrefixConfiguration(s3), CompressionFormat: aws.String(s3["compression_format"].(string)), @@ -1817,8 +1817,8 @@ func expandS3BackupConfig(d map[string]interface{}) *firehose.S3DestinationConfi BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64(int64(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64(int64(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64(int64(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64(int64(s3["buffering_size"].(int))), }, Prefix: extractPrefixConfiguration(s3), CompressionFormat: aws.String(s3["compression_format"].(string)), @@ -1843,8 +1843,8 @@ func createExtendedS3Config(d *schema.ResourceData) *firehose.ExtendedS3Destinat BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64(int64(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64(int64(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64(int64(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64(int64(s3["buffering_size"].(int))), }, Prefix: extractPrefixConfiguration(s3), CompressionFormat: aws.String(s3["compression_format"].(string)), @@ -1883,8 +1883,8 @@ func updateS3Config(d *schema.ResourceData) *firehose.S3DestinationUpdate { BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64((int64)(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64((int64)(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64((int64)(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64((int64)(s3["buffering_size"].(int))), }, ErrorOutputPrefix: aws.String(s3["error_output_prefix"].(string)), Prefix: extractPrefixConfiguration(s3), @@ -1912,8 +1912,8 @@ func updateS3BackupConfig(d map[string]interface{}) *firehose.S3DestinationUpdat BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64((int64)(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64((int64)(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64((int64)(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64((int64)(s3["buffering_size"].(int))), }, ErrorOutputPrefix: aws.String(s3["error_output_prefix"].(string)), Prefix: extractPrefixConfiguration(s3), @@ -1936,8 +1936,8 @@ func updateExtendedS3Config(d *schema.ResourceData) *firehose.ExtendedS3Destinat BucketARN: aws.String(s3["bucket_arn"].(string)), RoleARN: aws.String(s3["role_arn"].(string)), BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64((int64)(s3["buffer_interval"].(int))), - SizeInMBs: aws.Int64((int64)(s3["buffer_size"].(int))), + IntervalInSeconds: aws.Int64((int64)(s3["buffering_interval"].(int))), + SizeInMBs: aws.Int64((int64)(s3["buffering_size"].(int))), }, ErrorOutputPrefix: aws.String(s3["error_output_prefix"].(string)), Prefix: extractPrefixConfiguration(s3), From a9bcb32ac461179bc3737c097c29bfd1126b18d1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 14:48:18 -0400 Subject: [PATCH 191/304] Update tests --- .../service/firehose/delivery_stream_test.go | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index bd4a59e85e1b..c8b8ba16f620 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -2657,8 +2657,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } } @@ -2765,8 +2765,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn # InvalidArgumentException: BufferingHints.SizeInMBs must be at least 64 when data format conversion is enabled. - buffer_size = 128 - role_arn = aws_iam_role.firehose.arn + buffering_size = 128 + role_arn = aws_iam_role.firehose.arn data_format_conversion_configuration { enabled = %[2]t @@ -2831,8 +2831,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn # InvalidArgumentException: BufferingHints.SizeInMBs must be at least 64 when data format conversion is enabled. - buffer_size = 128 - role_arn = aws_iam_role.firehose.arn + buffering_size = 128 + role_arn = aws_iam_role.firehose.arn data_format_conversion_configuration { input_format_configuration { @@ -2909,8 +2909,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn # InvalidArgumentException: BufferingHints.SizeInMBs must be at least 64 when data format conversion is enabled. - buffer_size = 128 - role_arn = aws_iam_role.firehose.arn + buffering_size = 128 + role_arn = aws_iam_role.firehose.arn data_format_conversion_configuration { input_format_configuration { @@ -2973,8 +2973,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn # InvalidArgumentException: BufferingHints.SizeInMBs must be at least 64 when data format conversion is enabled. - buffer_size = 128 - role_arn = aws_iam_role.firehose.arn + buffering_size = 128 + role_arn = aws_iam_role.firehose.arn data_format_conversion_configuration { input_format_configuration { @@ -3037,8 +3037,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { bucket_arn = aws_s3_bucket.bucket.arn # InvalidArgumentException: BufferingHints.SizeInMBs must be at least 64 when data format conversion is enabled. - buffer_size = 128 - role_arn = aws_iam_role.firehose.arn + buffering_size = 128 + role_arn = aws_iam_role.firehose.arn data_format_conversion_configuration { input_format_configuration { @@ -3182,7 +3182,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { bucket_arn = aws_s3_bucket.bucket.arn prefix = "custom-prefix/customerId=!{partitionKeyFromLambda:customerId}/year=!{timestamp:yyyy}/month=!{timestamp:MM}/day=!{timestamp:dd}/hour=!{timestamp:HH}/" error_output_prefix = "prefix1" - buffer_size = 64 + buffering_size = 64 dynamic_partitioning_configuration { enabled = true @@ -3237,7 +3237,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn error_output_prefix = "prefix1" - buffer_size = 64 + buffering_size = 64 } } `, rName)) @@ -3278,8 +3278,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } } - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" s3_backup_mode = "Enabled" @@ -3305,8 +3305,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" s3_backup_mode = "Enabled" @@ -3379,8 +3379,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -3458,8 +3458,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -3601,8 +3601,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -4426,8 +4426,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { extended_s3_configuration { role_arn = aws_iam_role.firehose.arn prefix = "tracking/autocomplete_stream/" - buffer_interval = 300 - buffer_size = 5 + buffering_interval = 300 + buffering_size = 5 compression_format = "GZIP" bucket_arn = aws_s3_bucket.bucket.arn } From 358eb205a3db15828285ff3fcedd84a6c9eeca38 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 14:48:41 -0400 Subject: [PATCH 192/304] Update docs for renamed arg --- ...sis_firehose_delivery_stream.html.markdown | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index f5b2ff234783..32735d67f7d0 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -107,7 +107,7 @@ resource "aws_kinesis_firehose_delivery_stream" "extended_s3_stream" { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 64 + buffering_size = 64 # https://docs.aws.amazon.com/firehose/latest/dev/dynamic-partitioning.html dynamic_partitioning_configuration { @@ -212,8 +212,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -230,8 +230,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_backup_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 15 - buffer_interval = 300 + buffering_size = 15 + buffering_interval = 300 compression_format = "GZIP" } } @@ -252,8 +252,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -375,8 +375,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -495,8 +495,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -520,8 +520,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffer_size = 10 - buffer_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -590,9 +590,9 @@ The `s3_configuration` object supports the following: * `role_arn` - (Required) The ARN of the AWS credentials. * `bucket_arn` - (Required) The ARN of the S3 bucket * `prefix` - (Optional) The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered S3 files. You can specify an extra prefix to be added in front of the time format prefix. Note that if the prefix ends with a slash, it appears as a folder in the S3 bucket -* `buffer_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. +* `buffering_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. We recommend setting SizeInMBs to a value greater than the amount of data you typically ingest into the delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec set SizeInMBs to be 10 MB or higher. -* `buffer_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300. +* `buffering_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300. * `compression_format` - (Optional) The compression format. If no value is specified, the default is `UNCOMPRESSED`. Other supported values are `GZIP`, `ZIP`, `Snappy`, & `HADOOP_SNAPPY`. * `error_output_prefix` - (Optional) Prefix added to failed records before writing them to S3. Not currently supported for `redshift` destination. This prefix appears immediately following the bucket name. For information about how to specify this prefix, see [Custom Prefixes for Amazon S3 Objects](https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). * `kms_key_arn` - (Optional) Specifies the KMS key ARN the stream will use to encrypt data. If not set, no encryption will @@ -729,7 +729,7 @@ resource "aws_kinesis_firehose_delivery_stream" "example" { # ... other configuration ... extended_s3_configuration { # Must be at least 64 - buffer_size = 128 + buffering_size = 128 # ... other configuration ... data_format_conversion_configuration { From 7795ad5488cf3decc373609c228883cf8f1537eb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 3 May 2023 14:56:41 -0400 Subject: [PATCH 193/304] Fixup acceptance test configurations. --- .../service/ce/anomaly_subscription_test.go | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/internal/service/ce/anomaly_subscription_test.go b/internal/service/ce/anomaly_subscription_test.go index 5399ee9a071f..2ae3e8d815d7 100644 --- a/internal/service/ce/anomaly_subscription_test.go +++ b/internal/service/ce/anomaly_subscription_test.go @@ -55,36 +55,6 @@ func TestAccCEAnomalySubscription_basic(t *testing.T) { }) } -func TestAccCEAnomalySubscription_thresholdExpression(t *testing.T) { - ctx := acctest.Context(t) - var subscription costexplorer.AnomalySubscription - resourceName := "aws_ce_anomaly_subscription.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - domain := acctest.RandomDomainName() - address := acctest.RandomEmailAddress(domain) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), - ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), - Steps: []resource.TestStep{ - { - Config: testAccAnomalySubscriptionConfig_thresholdExpression(rName, address), - Check: resource.ComposeTestCheckFunc( - testAccCheckAnomalySubscriptionExists(ctx, resourceName, &subscription), - resource.TestCheckResourceAttr(resourceName, "name", rName), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccCEAnomalySubscription_disappears(t *testing.T) { ctx := acctest.Context(t) var subscription costexplorer.AnomalySubscription @@ -399,26 +369,6 @@ resource "aws_ce_anomaly_subscription" "test" { type = "EMAIL" address = %[2]q } -} -`, rName, address)) -} - -func testAccAnomalySubscriptionConfig_thresholdExpression(rName string, address string) string { - return acctest.ConfigCompose( - testAccAnomalySubscriptionConfigBase(rName), - fmt.Sprintf(` -resource "aws_ce_anomaly_subscription" "test" { - name = %[1]q - frequency = "DAILY" - - monitor_arn_list = [ - aws_ce_anomaly_monitor.test.arn, - ] - - subscriber { - type = "EMAIL" - address = %[2]q - } threshold_expression { dimension { @@ -465,10 +415,19 @@ resource "aws_ce_anomaly_subscription" "test" { aws_ce_anomaly_monitor.test.arn, aws_ce_anomaly_monitor.test2.arn, ] + subscriber { type = "EMAIL" address = %[3]q } + + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } } `, rName, rName2, address)) } @@ -489,6 +448,14 @@ resource "aws_ce_anomaly_subscription" "test" { type = "EMAIL" address = %[3]q } + + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } } `, rName, rFrequency, address)) } @@ -509,10 +476,19 @@ resource "aws_ce_anomaly_subscription" "test" { type = "EMAIL" address = %[2]q } + subscriber { type = "EMAIL" address = %[3]q } + + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } } `, rName, address1, address2)) } @@ -605,6 +581,14 @@ resource "aws_ce_anomaly_subscription" "test" { address = aws_sns_topic.test.arn } + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } + depends_on = [ aws_sns_topic_policy.test, ] @@ -629,6 +613,14 @@ resource "aws_ce_anomaly_subscription" "test" { address = %[4]q } + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } + tags = { %[2]q = %[3]q } @@ -653,6 +645,14 @@ resource "aws_ce_anomaly_subscription" "test" { address = %[6]q } + threshold_expression { + dimension { + key = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + values = ["100.0"] + match_options = ["GREATER_THAN_OR_EQUAL"] + } + } + tags = { %[2]q = %[3]q %[4]q = %[5]q From d5d7c88bb245f449f73041d12e5db03cadddb09b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 3 May 2023 15:06:48 -0400 Subject: [PATCH 194/304] Add changelog --- .changelog/31141.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/31141.txt diff --git a/.changelog/31141.txt b/.changelog/31141.txt new file mode 100644 index 000000000000..083ba7a74b18 --- /dev/null +++ b/.changelog/31141.txt @@ -0,0 +1,11 @@ +```release-note:breaking-change +resource/aws_kinesis_firehose_delivery_stream: Rename `s3_configuration.0.buffer_size` and `s3_configuration.0.buffer_internval` to `s3_configuration.0.buffering_size` and `s3_configuration.0.buffering_internval`, respectively +``` + +```release-note:breaking-change +resource/aws_kinesis_firehose_delivery_stream: Rename `redshift_configuration.0.s3_backup_configuration.0.buffer_size` and `redshift_configuration.0.s3_backup_configuration.0.buffer_interval` to `redshift_configuration.0.s3_backup_configuration.0.buffering_size` and `redshift_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively +``` + +```release-note:breaking-change +resource/aws_kinesis_firehose_delivery_stream: Rename `extended_s3_configuration.0.s3_backup_configuration.0.buffer_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffer_interval` to `extended_s3_configuration.0.s3_backup_configuration.0.buffering_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively +``` \ No newline at end of file From d6f3d2cac78a51078cdfd8f6171cb25f2ae6c8f7 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 3 May 2023 21:14:30 +0000 Subject: [PATCH 195/304] Update CHANGELOG.md for #31141 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1cae35ac3e..561d59e8bbec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ BREAKING CHANGES: * resource/aws_api_gateway_rest_api: `minimum_compression_size` is now a string type to allow values set via the `body` attribute to be properly computed. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) +* resource/aws_ce_anomaly_subscription: The `threshold` attribute has been removed ([#30374](https://github.com/hashicorp/terraform-provider-aws/issues/30374)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed ([#30452](https://github.com/hashicorp/terraform-provider-aws/issues/30452)) @@ -30,6 +31,9 @@ BREAKING CHANGES: * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_replication_group: Remove `availability_zones`, `number_cache_clusters`, `replication_group_description` arguments -- use `preferred_cache_cluster_azs`, `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Remove `cluster_mode` configuration block -- use top-level `num_node_groups` and `replicas_per_node_group` instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_kinesis_firehose_delivery_stream: Rename `extended_s3_configuration.0.s3_backup_configuration.0.buffer_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffer_interval` to `extended_s3_configuration.0.s3_backup_configuration.0.buffering_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) +* resource/aws_kinesis_firehose_delivery_stream: Rename `redshift_configuration.0.s3_backup_configuration.0.buffer_size` and `redshift_configuration.0.s3_backup_configuration.0.buffer_interval` to `redshift_configuration.0.s3_backup_configuration.0.buffering_size` and `redshift_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) +* resource/aws_kinesis_firehose_delivery_stream: Rename `s3_configuration.0.buffer_size` and `s3_configuration.0.buffer_internval` to `s3_configuration.0.buffering_size` and `s3_configuration.0.buffering_internval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) * resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) * resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From 36e4fb6138e86ef0e8d156810bc5b331e681ba98 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Tue, 2 May 2023 15:47:27 -0500 Subject: [PATCH 196/304] add s3_configuration to attributes --- internal/service/firehose/delivery_stream.go | 59 ++++++++++---------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index c17a4928126c..74211d0b3910 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -128,7 +128,7 @@ func s3ConfigurationSchema() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, MaxItems: 1, - Optional: true, + Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket_arn": { @@ -1001,7 +1001,6 @@ func ResourceDeliveryStream() *schema.Resource { return strings.ToLower(value) }, ValidateFunc: validation.StringInSlice([]string{ - destinationTypeS3, destinationTypeExtendedS3, destinationTypeRedshift, destinationTypeElasticsearch, @@ -1011,8 +1010,6 @@ func ResourceDeliveryStream() *schema.Resource { }, false), }, - "s3_configuration": s3ConfigurationSchema(), - "extended_s3_configuration": { Type: schema.TypeList, Optional: true, @@ -1370,6 +1367,8 @@ func ResourceDeliveryStream() *schema.Resource { "s3_backup_configuration": s3ConfigurationSchema(), + "s3_configuration": s3ConfigurationSchema(), + "retry_duration": { Type: schema.TypeInt, Optional: true, @@ -1449,6 +1448,8 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: verify.ValidARN, }, + "s3_configuration": s3ConfigurationSchema(), + "s3_backup_mode": { Type: schema.TypeString, ForceNew: true, @@ -1560,6 +1561,8 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: verify.ValidARN, }, + "s3_configuration": s3ConfigurationSchema(), + "s3_backup_mode": { Type: schema.TypeString, ForceNew: true, @@ -1662,6 +1665,8 @@ func ResourceDeliveryStream() *schema.Resource { }, false), }, + "s3_configuration": s3ConfigurationSchema(), + "retry_duration": { Type: schema.TypeInt, Optional: true, @@ -1719,6 +1724,8 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: validation.StringInSlice(firehose.HttpEndpointS3BackupMode_Values(), false), }, + "s3_configuration": s3ConfigurationSchema(), + "retry_duration": { Type: schema.TypeInt, Optional: true, @@ -1779,8 +1786,8 @@ func createSourceConfig(source map[string]interface{}) *firehose.KinesisStreamSo return configuration } -func createS3Config(d *schema.ResourceData) *firehose.S3DestinationConfiguration { - s3 := d.Get("s3_configuration").([]interface{})[0].(map[string]interface{}) +func createS3Config(tfList []interface{}) *firehose.S3DestinationConfiguration { + s3 := tfList[0].(map[string]interface{}) configuration := &firehose.S3DestinationConfiguration{ BucketARN: aws.String(s3["bucket_arn"].(string)), @@ -2284,7 +2291,7 @@ func extractPrefixConfiguration(s3 map[string]interface{}) *string { return nil } -func createRedshiftConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.RedshiftDestinationConfiguration, error) { +func createRedshiftConfig(d *schema.ResourceData) (*firehose.RedshiftDestinationConfiguration, error) { redshiftRaw, ok := d.GetOk("redshift_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("redshift_configuration", destinationTypeRedshift) @@ -2300,7 +2307,7 @@ func createRedshiftConfig(d *schema.ResourceData, s3Config *firehose.S3Destinati Username: aws.String(redshift["username"].(string)), RoleARN: aws.String(redshift["role_arn"].(string)), CopyCommand: extractCopyCommandConfiguration(redshift), - S3Configuration: s3Config, + S3Configuration: createS3Config(redshift["s3_configuration"].([]interface{})), } if _, ok := redshift["cloudwatch_logging_options"]; ok { @@ -2360,7 +2367,7 @@ func elasticsearchDestinationRequiredParamErr(param, destination string) error { return fmt.Errorf(`%q is required when "destination" is %q`, param, destination) } -func createElasticsearchConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.ElasticsearchDestinationConfiguration, error) { +func createElasticsearchConfig(d *schema.ResourceData) (*firehose.ElasticsearchDestinationConfiguration, error) { esConfig, ok := d.GetOk("elasticsearch_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("elasticsearch_configuration", destinationTypeElasticsearch) @@ -2375,7 +2382,7 @@ func createElasticsearchConfig(d *schema.ResourceData, s3Config *firehose.S3Dest RetryOptions: extractElasticsearchRetryOptions(es), RoleARN: aws.String(es["role_arn"].(string)), TypeName: aws.String(es["type_name"].(string)), - S3Configuration: s3Config, + S3Configuration: createS3Config(es["s3_configuration"].([]interface{})), } if v, ok := es["domain_arn"]; ok && v.(string) != "" { @@ -2449,7 +2456,7 @@ func updateElasticsearchConfig(d *schema.ResourceData, s3Update *firehose.S3Dest return update, nil } -func createOpensearchConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.AmazonopensearchserviceDestinationConfiguration, error) { +func createOpensearchConfig(d *schema.ResourceData) (*firehose.AmazonopensearchserviceDestinationConfiguration, error) { esConfig, ok := d.GetOk("opensearch_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("opensearch_configuration", destinationTypeOpensearch) @@ -2464,7 +2471,7 @@ func createOpensearchConfig(d *schema.ResourceData, s3Config *firehose.S3Destina RetryOptions: extractOpensearchRetryOptions(es), RoleARN: aws.String(es["role_arn"].(string)), TypeName: aws.String(es["type_name"].(string)), - S3Configuration: s3Config, + S3Configuration: createS3Config(es["s3_configuration"].([]interface{})), } if v, ok := es["domain_arn"]; ok && v.(string) != "" { @@ -2538,7 +2545,7 @@ func updateOpensearchConfig(d *schema.ResourceData, s3Update *firehose.S3Destina return update, nil } -func createSplunkConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.SplunkDestinationConfiguration, error) { +func createSplunkConfig(d *schema.ResourceData) (*firehose.SplunkDestinationConfiguration, error) { splunkRaw, ok := d.GetOk("splunk_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("splunk_configuration", destinationTypeSplunk) @@ -2553,7 +2560,7 @@ func createSplunkConfig(d *schema.ResourceData, s3Config *firehose.S3Destination HECEndpoint: aws.String(splunk["hec_endpoint"].(string)), HECAcknowledgmentTimeoutInSeconds: aws.Int64(int64(splunk["hec_acknowledgment_timeout"].(int))), RetryOptions: extractSplunkRetryOptions(splunk), - S3Configuration: s3Config, + S3Configuration: createS3Config(splunk["s3_configuration"].([]interface{})), } if _, ok := splunk["processing_configuration"]; ok { @@ -2602,7 +2609,7 @@ func updateSplunkConfig(d *schema.ResourceData, s3Update *firehose.S3Destination return configuration, nil } -func createHTTPEndpointConfig(d *schema.ResourceData, s3Config *firehose.S3DestinationConfiguration) (*firehose.HttpEndpointDestinationConfiguration, error) { +func createHTTPEndpointConfig(d *schema.ResourceData) (*firehose.HttpEndpointDestinationConfiguration, error) { HttpEndpointRaw, ok := d.GetOk("http_endpoint_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("http_endpoint_configuration", destinationTypeHTTPEndpoint) @@ -2614,7 +2621,7 @@ func createHTTPEndpointConfig(d *schema.ResourceData, s3Config *firehose.S3Desti configuration := &firehose.HttpEndpointDestinationConfiguration{ RetryOptions: extractHTTPEndpointRetryOptions(HttpEndpoint), RoleARN: aws.String(HttpEndpoint["role_arn"].(string)), - S3Configuration: s3Config, + S3Configuration: createS3Config(HttpEndpoint["s3_configuration"].([]interface{})), } configuration.EndpointConfiguration = extractHTTPEndpointConfiguration(HttpEndpoint) @@ -2862,40 +2869,36 @@ func resourceDeliveryStreamCreate(ctx context.Context, d *schema.ResourceData, m extendedS3Config := createExtendedS3Config(d) input.ExtendedS3DestinationConfiguration = extendedS3Config } else { - s3Config := createS3Config(d) - - if d.Get("destination").(string) == destinationTypeS3 { - input.S3DestinationConfiguration = s3Config - } else if d.Get("destination").(string) == destinationTypeElasticsearch { - esConfig, err := createElasticsearchConfig(d, s3Config) + if d.Get("destination").(string) == destinationTypeElasticsearch { + esConfig, err := createElasticsearchConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "creating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } input.ElasticsearchDestinationConfiguration = esConfig } else if d.Get("destination").(string) == destinationTypeOpensearch { - osConfig, err := createOpensearchConfig(d, s3Config) + osConfig, err := createOpensearchConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "creating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } input.AmazonopensearchserviceDestinationConfiguration = osConfig } else if d.Get("destination").(string) == destinationTypeRedshift { - rc, err := createRedshiftConfig(d, s3Config) + rc, err := createRedshiftConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "creating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } input.RedshiftDestinationConfiguration = rc } else if d.Get("destination").(string) == destinationTypeSplunk { - rc, err := createSplunkConfig(d, s3Config) + spConfig, err := createSplunkConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "creating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } - input.SplunkDestinationConfiguration = rc + input.SplunkDestinationConfiguration = spConfig } else if d.Get("destination").(string) == destinationTypeHTTPEndpoint { - rc, err := createHTTPEndpointConfig(d, s3Config) + httpConfig, err := createHTTPEndpointConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "creating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } - input.HttpEndpointDestinationConfiguration = rc + input.HttpEndpointDestinationConfiguration = httpConfig } } From b330e375688c717903760503c2e8ecfa6d895826 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 10:20:39 -0500 Subject: [PATCH 197/304] s3_configuration in update func --- internal/service/firehose/delivery_stream.go | 52 +++++++++----------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 74211d0b3910..c8b31eb42ca5 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -1883,8 +1883,8 @@ func createExtendedS3Config(d *schema.ResourceData) *firehose.ExtendedS3Destinat return configuration } -func updateS3Config(d *schema.ResourceData) *firehose.S3DestinationUpdate { - s3 := d.Get("s3_configuration").([]interface{})[0].(map[string]interface{}) +func updateS3Config(tfList []interface{}) *firehose.S3DestinationUpdate { + s3 := tfList[0].(map[string]interface{}) configuration := &firehose.S3DestinationUpdate{ BucketARN: aws.String(s3["bucket_arn"].(string)), @@ -2324,7 +2324,7 @@ func createRedshiftConfig(d *schema.ResourceData) (*firehose.RedshiftDestination return configuration, nil } -func updateRedshiftConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.RedshiftDestinationUpdate, error) { +func updateRedshiftConfig(d *schema.ResourceData) (*firehose.RedshiftDestinationUpdate, error) { redshiftRaw, ok := d.GetOk("redshift_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("redshift_configuration", destinationTypeRedshift) @@ -2340,9 +2340,15 @@ func updateRedshiftConfig(d *schema.ResourceData, s3Update *firehose.S3Destinati Username: aws.String(redshift["username"].(string)), RoleARN: aws.String(redshift["role_arn"].(string)), CopyCommand: extractCopyCommandConfiguration(redshift), - S3Update: s3Update, } + s3Config := updateS3Config(redshift["s3_configuration"].([]interface{})) + // Redshift does not currently support ErrorOutputPrefix, + // which is set to the empty string within "updateS3Config", + // thus we must remove it here to avoid an InvalidArgumentException. + s3Config.ErrorOutputPrefix = nil + configuration.S3Update = s3Config + if _, ok := redshift["cloudwatch_logging_options"]; ok { configuration.CloudWatchLoggingOptions = extractCloudWatchLoggingConfiguration(redshift) } @@ -2415,7 +2421,7 @@ func createElasticsearchConfig(d *schema.ResourceData) (*firehose.ElasticsearchD return config, nil } -func updateElasticsearchConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.ElasticsearchDestinationUpdate, error) { +func updateElasticsearchConfig(d *schema.ResourceData) (*firehose.ElasticsearchDestinationUpdate, error) { esConfig, ok := d.GetOk("elasticsearch_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("elasticsearch_configuration", destinationTypeElasticsearch) @@ -2430,7 +2436,7 @@ func updateElasticsearchConfig(d *schema.ResourceData, s3Update *firehose.S3Dest RetryOptions: extractElasticsearchRetryOptions(es), RoleARN: aws.String(es["role_arn"].(string)), TypeName: aws.String(es["type_name"].(string)), - S3Update: s3Update, + S3Update: updateS3Config(es["s3_configuration"].([]interface{})), } if v, ok := es["domain_arn"]; ok && v.(string) != "" { @@ -2504,7 +2510,7 @@ func createOpensearchConfig(d *schema.ResourceData) (*firehose.Amazonopensearchs return config, nil } -func updateOpensearchConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.AmazonopensearchserviceDestinationUpdate, error) { +func updateOpensearchConfig(d *schema.ResourceData) (*firehose.AmazonopensearchserviceDestinationUpdate, error) { esConfig, ok := d.GetOk("opensearch_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("elasticsearch_configuration", destinationTypeOpensearch) @@ -2519,7 +2525,7 @@ func updateOpensearchConfig(d *schema.ResourceData, s3Update *firehose.S3Destina RetryOptions: extractOpensearchRetryOptions(es), RoleARN: aws.String(es["role_arn"].(string)), TypeName: aws.String(es["type_name"].(string)), - S3Update: s3Update, + S3Update: updateS3Config(es["s3_configuration"].([]interface{})), } if v, ok := es["domain_arn"]; ok && v.(string) != "" { @@ -2577,7 +2583,7 @@ func createSplunkConfig(d *schema.ResourceData) (*firehose.SplunkDestinationConf return configuration, nil } -func updateSplunkConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.SplunkDestinationUpdate, error) { +func updateSplunkConfig(d *schema.ResourceData) (*firehose.SplunkDestinationUpdate, error) { splunkRaw, ok := d.GetOk("splunk_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("splunk_configuration", destinationTypeSplunk) @@ -2592,7 +2598,7 @@ func updateSplunkConfig(d *schema.ResourceData, s3Update *firehose.S3Destination HECEndpoint: aws.String(splunk["hec_endpoint"].(string)), HECAcknowledgmentTimeoutInSeconds: aws.Int64(int64(splunk["hec_acknowledgment_timeout"].(int))), RetryOptions: extractSplunkRetryOptions(splunk), - S3Update: s3Update, + S3Update: updateS3Config(splunk["s3_configuration"].([]interface{})), } if _, ok := splunk["processing_configuration"]; ok { @@ -2654,7 +2660,7 @@ func createHTTPEndpointConfig(d *schema.ResourceData) (*firehose.HttpEndpointDes return configuration, nil } -func updateHTTPEndpointConfig(d *schema.ResourceData, s3Update *firehose.S3DestinationUpdate) (*firehose.HttpEndpointDestinationUpdate, error) { +func updateHTTPEndpointConfig(d *schema.ResourceData) (*firehose.HttpEndpointDestinationUpdate, error) { HttpEndpointRaw, ok := d.GetOk("http_endpoint_configuration") if !ok { return nil, elasticsearchDestinationRequiredParamErr("http_endpoint_configuration", destinationTypeHTTPEndpoint) @@ -2666,7 +2672,7 @@ func updateHTTPEndpointConfig(d *schema.ResourceData, s3Update *firehose.S3Desti configuration := &firehose.HttpEndpointDestinationUpdate{ RetryOptions: extractHTTPEndpointRetryOptions(HttpEndpoint), RoleARN: aws.String(HttpEndpoint["role_arn"].(string)), - S3Update: s3Update, + S3Update: updateS3Config(HttpEndpoint["s3_configuration"].([]interface{})), } configuration.EndpointConfiguration = extractHTTPEndpointConfiguration(HttpEndpoint) @@ -3020,42 +3026,32 @@ func resourceDeliveryStreamUpdate(ctx context.Context, d *schema.ResourceData, m extendedS3Config := updateExtendedS3Config(d) updateInput.ExtendedS3DestinationUpdate = extendedS3Config } else { - s3Config := updateS3Config(d) - - if d.Get("destination").(string) == destinationTypeS3 { - updateInput.S3DestinationUpdate = s3Config - } else if d.Get("destination").(string) == destinationTypeElasticsearch { - esUpdate, err := updateElasticsearchConfig(d, s3Config) + if d.Get("destination").(string) == destinationTypeElasticsearch { + esUpdate, err := updateElasticsearchConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } updateInput.ElasticsearchDestinationUpdate = esUpdate } else if d.Get("destination").(string) == destinationTypeOpensearch { - esUpdate, err := updateOpensearchConfig(d, s3Config) + esUpdate, err := updateOpensearchConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } updateInput.AmazonopensearchserviceDestinationUpdate = esUpdate } else if d.Get("destination").(string) == destinationTypeRedshift { - // Redshift does not currently support ErrorOutputPrefix, - // which is set to the empty string within "updateS3Config", - // thus we must remove it here to avoid an InvalidArgumentException. - if s3Config != nil { - s3Config.ErrorOutputPrefix = nil - } - rc, err := updateRedshiftConfig(d, s3Config) + rc, err := updateRedshiftConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } updateInput.RedshiftDestinationUpdate = rc } else if d.Get("destination").(string) == destinationTypeSplunk { - rc, err := updateSplunkConfig(d, s3Config) + rc, err := updateSplunkConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } updateInput.SplunkDestinationUpdate = rc } else if d.Get("destination").(string) == destinationTypeHTTPEndpoint { - rc, err := updateHTTPEndpointConfig(d, s3Config) + rc, err := updateHTTPEndpointConfig(d) if err != nil { return sdkdiag.AppendErrorf(diags, "updating Kinesis Firehose Delivery Stream (%s): %s", sn, err) } From db7086edfe1268bbce05d5253db4281f4386c7c9 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 10:31:20 -0500 Subject: [PATCH 198/304] s3_configuration in read --- internal/service/firehose/delivery_stream.go | 25 ++++---------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index c8b31eb42ca5..4963ada25253 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -261,6 +261,7 @@ func flattenElasticsearchConfiguration(description *firehose.ElasticsearchDestin "type_name": aws.StringValue(description.TypeName), "index_name": aws.StringValue(description.IndexName), "s3_backup_mode": aws.StringValue(description.S3BackupMode), + "s3_configuration": flattenS3Configuration(description.S3DestinationDescription), "index_rotation_period": aws.StringValue(description.IndexRotationPeriod), "vpc_config": flattenVPCConfiguration(description.VpcConfigurationDescription), "processing_configuration": flattenProcessingConfiguration(description.ProcessingConfiguration, aws.StringValue(description.RoleARN)), @@ -297,6 +298,7 @@ func flattenOpensearchConfiguration(description *firehose.Amazonopensearchservic "type_name": aws.StringValue(description.TypeName), "index_name": aws.StringValue(description.IndexName), "s3_backup_mode": aws.StringValue(description.S3BackupMode), + "s3_configuration": flattenS3Configuration(description.S3DestinationDescription), "index_rotation_period": aws.StringValue(description.IndexRotationPeriod), "vpc_config": flattenVPCConfiguration(description.VpcConfigurationDescription), "processing_configuration": flattenProcessingConfiguration(description.ProcessingConfiguration, aws.StringValue(description.RoleARN)), @@ -381,6 +383,7 @@ func flattenRedshiftConfiguration(description *firehose.RedshiftDestinationDescr "role_arn": aws.StringValue(description.RoleARN), "s3_backup_configuration": flattenS3Configuration(description.S3BackupDescription), "s3_backup_mode": aws.StringValue(description.S3BackupMode), + "s3_configuration": flattenS3Configuration(description.S3DestinationDescription), "username": aws.StringValue(description.Username), } @@ -409,6 +412,7 @@ func flattenSplunkConfiguration(description *firehose.SplunkDestinationDescripti "hec_token": aws.StringValue(description.HECToken), "processing_configuration": flattenProcessingConfiguration(description.ProcessingConfiguration, ""), "s3_backup_mode": aws.StringValue(description.S3BackupMode), + "s3_configuration": flattenS3Configuration(description.S3DestinationDescription), } if description.RetryOptions != nil { @@ -808,47 +812,27 @@ func flattenDeliveryStream(d *schema.ResourceData, s *firehose.DeliveryStreamDes if err := d.Set("redshift_configuration", flattenRedshiftConfiguration(destination.RedshiftDestinationDescription, configuredPassword)); err != nil { return fmt.Errorf("setting redshift_configuration: %s", err) } - if err := d.Set("s3_configuration", flattenS3Configuration(destination.RedshiftDestinationDescription.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } } else if destination.ElasticsearchDestinationDescription != nil { d.Set("destination", destinationTypeElasticsearch) if err := d.Set("elasticsearch_configuration", flattenElasticsearchConfiguration(destination.ElasticsearchDestinationDescription)); err != nil { return fmt.Errorf("setting elasticsearch_configuration: %s", err) } - if err := d.Set("s3_configuration", flattenS3Configuration(destination.ElasticsearchDestinationDescription.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } } else if destination.AmazonopensearchserviceDestinationDescription != nil { d.Set("destination", destinationTypeOpensearch) if err := d.Set("opensearch_configuration", flattenOpensearchConfiguration(destination.AmazonopensearchserviceDestinationDescription)); err != nil { return fmt.Errorf("setting opensearch_configuration: %s", err) } - if err := d.Set("s3_configuration", flattenS3Configuration(destination.AmazonopensearchserviceDestinationDescription.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } } else if destination.SplunkDestinationDescription != nil { d.Set("destination", destinationTypeSplunk) if err := d.Set("splunk_configuration", flattenSplunkConfiguration(destination.SplunkDestinationDescription)); err != nil { return fmt.Errorf("setting splunk_configuration: %s", err) } - if err := d.Set("s3_configuration", flattenS3Configuration(destination.SplunkDestinationDescription.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } } else if destination.HttpEndpointDestinationDescription != nil { d.Set("destination", destinationTypeHTTPEndpoint) configuredAccessKey := d.Get("http_endpoint_configuration.0.access_key").(string) if err := d.Set("http_endpoint_configuration", flattenHTTPEndpointConfiguration(destination.HttpEndpointDestinationDescription, configuredAccessKey)); err != nil { return fmt.Errorf("setting http_endpoint_configuration: %s", err) } - if err := d.Set("s3_configuration", flattenS3Configuration(destination.HttpEndpointDestinationDescription.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } - } else if d.Get("destination").(string) == destinationTypeS3 { - d.Set("destination", destinationTypeS3) - if err := d.Set("s3_configuration", flattenS3Configuration(destination.S3DestinationDescription)); err != nil { - return fmt.Errorf("setting s3_configuration: %s", err) - } } else { d.Set("destination", destinationTypeExtendedS3) if err := d.Set("extended_s3_configuration", flattenExtendedS3Configuration(destination.ExtendedS3DestinationDescription)); err != nil { @@ -871,6 +855,7 @@ func flattenHTTPEndpointConfiguration(description *firehose.HttpEndpointDestinat "name": aws.StringValue(description.EndpointConfiguration.Name), "role_arn": aws.StringValue(description.RoleARN), "s3_backup_mode": aws.StringValue(description.S3BackupMode), + "s3_configuration": flattenS3Configuration(description.S3DestinationDescription), "request_configuration": flattenRequestConfiguration(description.RequestConfiguration), "cloudwatch_logging_options": flattenCloudWatchLoggingOptions(description.CloudWatchLoggingOptions), "processing_configuration": flattenProcessingConfiguration(description.ProcessingConfiguration, aws.StringValue(description.RoleARN)), From 7c5baff42ee89cd9a11772f71cf85e2a3815d2a6 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 10:40:46 -0500 Subject: [PATCH 199/304] arrange alphabetically --- internal/service/firehose/delivery_stream.go | 61 ++++++++++---------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 4963ada25253..594e9572eb91 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -1319,12 +1319,24 @@ func ResourceDeliveryStream() *schema.Resource { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), + "cluster_jdbcurl": { Type: schema.TypeString, Required: true, }, - "username": { + "copy_options": { + Type: schema.TypeString, + Optional: true, + }, + + "data_table_columns": { + Type: schema.TypeString, + Optional: true, + }, + + "data_table_name": { Type: schema.TypeString, Required: true, }, @@ -1337,6 +1349,13 @@ func ResourceDeliveryStream() *schema.Resource { "processing_configuration": processingConfigurationSchema(), + "retry_duration": { + Type: schema.TypeInt, + Optional: true, + Default: 3600, + ValidateFunc: validation.IntBetween(0, 7200), + }, + "role_arn": { Type: schema.TypeString, Required: true, @@ -1354,29 +1373,10 @@ func ResourceDeliveryStream() *schema.Resource { "s3_configuration": s3ConfigurationSchema(), - "retry_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 3600, - ValidateFunc: validation.IntBetween(0, 7200), - }, - - "copy_options": { - Type: schema.TypeString, - Optional: true, - }, - - "data_table_columns": { - Type: schema.TypeString, - Optional: true, - }, - - "data_table_name": { + "username": { Type: schema.TypeString, Required: true, }, - - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), }, }, }, @@ -1401,6 +1401,14 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: validation.IntBetween(1, 100), }, + "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), + + "cluster_endpoint": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"elasticsearch_configuration.0.domain_arn"}, + }, + "domain_arn": { Type: schema.TypeString, Optional: true, @@ -1420,6 +1428,8 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: validation.StringInSlice(firehose.ElasticsearchIndexRotationPeriod_Values(), false), }, + "processing_configuration": processingConfigurationSchema(), + "retry_duration": { Type: schema.TypeInt, Optional: true, @@ -1481,15 +1491,6 @@ func ResourceDeliveryStream() *schema.Resource { }, }, }, - - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), - - "processing_configuration": processingConfigurationSchema(), - "cluster_endpoint": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"elasticsearch_configuration.0.domain_arn"}, - }, }, }, }, From 034057ec0dc2ce68a792067c06569d0edcc7f0d2 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 10:43:04 -0500 Subject: [PATCH 200/304] arrange alphabetically --- internal/service/firehose/delivery_stream.go | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 594e9572eb91..e6c91e457f0c 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -1641,6 +1641,13 @@ func ResourceDeliveryStream() *schema.Resource { Required: true, }, + "retry_duration": { + Type: schema.TypeInt, + Optional: true, + Default: 3600, + ValidateFunc: validation.IntBetween(0, 7200), + }, + "s3_backup_mode": { Type: schema.TypeString, Optional: true, @@ -1653,13 +1660,6 @@ func ResourceDeliveryStream() *schema.Resource { "s3_configuration": s3ConfigurationSchema(), - "retry_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 3600, - ValidateFunc: validation.IntBetween(0, 7200), - }, - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), "processing_configuration": processingConfigurationSchema(), @@ -1697,6 +1697,13 @@ func ResourceDeliveryStream() *schema.Resource { Sensitive: true, }, + "retry_duration": { + Type: schema.TypeInt, + Optional: true, + Default: 300, + ValidateFunc: validation.IntBetween(0, 7200), + }, + "role_arn": { Type: schema.TypeString, Optional: true, @@ -1712,13 +1719,6 @@ func ResourceDeliveryStream() *schema.Resource { "s3_configuration": s3ConfigurationSchema(), - "retry_duration": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - ValidateFunc: validation.IntBetween(0, 7200), - }, - "buffering_interval": { Type: schema.TypeInt, Optional: true, From acce44d8d6454688f037b72efff418e5066908ab Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 11:05:42 -0500 Subject: [PATCH 201/304] cleanup: remove test for s3 destination --- internal/service/firehose/delivery_stream.go | 7 +- .../service/firehose/delivery_stream_test.go | 544 ++---------------- 2 files changed, 66 insertions(+), 485 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index e6c91e457f0c..1735cb4f9a71 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -996,10 +996,9 @@ func ResourceDeliveryStream() *schema.Resource { }, "extended_s3_configuration": { - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{"s3_configuration"}, - MaxItems: 1, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket_arn": { diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index c8b8ba16f620..601dd58ca35a 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -125,249 +125,6 @@ func TestAccFirehoseDeliveryStream_tags(t *testing.T) { }) } -func TestAccFirehoseDeliveryStream_s3basic(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3basic(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - ), - }, - }, - }) -} - -func TestAccFirehoseDeliveryStream_s3basicWithPrefixes(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3basicPrefixes(rName, "logs/", ""), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.prefix", "logs/"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicPrefixes(rName, "logs/", "errors/"), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.prefix", "logs/"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "errors/"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicPrefixes(rName, "logs/{timestamp:yyyy-MM-dd}/", "errors/{timestamp:yyyy-MM-dd}/"), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.prefix", "logs/{timestamp:yyyy-MM-dd}/"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "errors/{timestamp:yyyy-MM-dd}/"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicPrefixes(rName, "", ""), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.prefix", ""), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), - ), - }, - }, - }) -} - -func TestAccFirehoseDeliveryStream_s3basicWithSSE(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3basicSSE(rName, true), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", "AWS_OWNED_CMK"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicSSE(rName, false), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "false"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basic(rName), - PlanOnly: true, - }, - { - Config: testAccDeliveryStreamConfig_s3basicSSE(rName, true), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", "AWS_OWNED_CMK"), - ), - }, - }, - }) -} - -func TestAccFirehoseDeliveryStream_s3basicWithSSEAndKeyARN(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3BasicSSEAndKeyARN(rName, true), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", firehose.KeyTypeCustomerManagedCmk), - resource.TestCheckResourceAttrPair(resourceName, "server_side_encryption.0.key_arn", "aws_kms_key.test", "arn"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicSSE(rName, false), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "false"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3BasicSSEAndKeyARN(rName, true), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", firehose.KeyTypeCustomerManagedCmk), - resource.TestCheckResourceAttrPair(resourceName, "server_side_encryption.0.key_arn", "aws_kms_key.test", "arn"), - ), - }, - }, - }) -} - -func TestAccFirehoseDeliveryStream_s3basicWithSSEAndKeyType(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3basicSSEAndKeyType(rName, true, firehose.KeyTypeAwsOwnedCmk), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", firehose.KeyTypeAwsOwnedCmk), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicSSE(rName, false), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "false"), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3basicSSEAndKeyType(rName, true, firehose.KeyTypeAwsOwnedCmk), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.key_type", firehose.KeyTypeAwsOwnedCmk), - ), - }, - }, - }) -} - -func TestAccFirehoseDeliveryStream_s3KinesisStreamSource(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3Source(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - ), - }, - }, - }) -} - func TestAccFirehoseDeliveryStream_s3WithCloudWatchLogging(t *testing.T) { ctx := acctest.Context(t) var stream firehose.DeliveryStreamDescription @@ -391,43 +148,6 @@ func TestAccFirehoseDeliveryStream_s3WithCloudWatchLogging(t *testing.T) { }) } -func TestAccFirehoseDeliveryStream_s3Updates(t *testing.T) { - ctx := acctest.Context(t) - var stream firehose.DeliveryStreamDescription - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_kinesis_firehose_delivery_stream.test" - - updatedS3DestinationConfig := &firehose.S3DestinationDescription{ - BufferingHints: &firehose.BufferingHints{ - IntervalInSeconds: aws.Int64(400), - SizeInMBs: aws.Int64(10), - }, - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccDeliveryStreamConfig_s3basic(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - ), - }, - { - Config: testAccDeliveryStreamConfig_s3Updates(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - testAccCheckDeliveryStreamAttributes(&stream, updatedS3DestinationConfig, nil, nil, nil, nil, nil, nil), - ), - }, - }, - }) -} - func TestAccFirehoseDeliveryStream_extendedS3basic(t *testing.T) { ctx := acctest.Context(t) var stream firehose.DeliveryStreamDescription @@ -2471,9 +2191,9 @@ resource "aws_cloudwatch_log_stream" "test" { resource "aws_kinesis_firehose_delivery_stream" "test" { depends_on = [aws_iam_role_policy.firehose] name = %[1]q - destination = "s3" + destination = "extended_s3" - s3_configuration { + extended_s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn @@ -2487,111 +2207,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { `, rName) } -func testAccDeliveryStreamConfig_s3basic(rName string) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } -} -`, rName)) -} - -func testAccDeliveryStreamConfig_s3basicPrefixes(rName, prefix, errorOutputPrefix string) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = ["aws_iam_role_policy.firehose"] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - prefix = %[2]q - error_output_prefix = %[3]q - } -} -`, rName, prefix, errorOutputPrefix)) -} - -func testAccDeliveryStreamConfig_s3basicSSE(rName string, sseEnabled bool) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - - server_side_encryption { - enabled = %[2]t - } -} -`, rName, sseEnabled)) -} - -func testAccDeliveryStreamConfig_s3BasicSSEAndKeyARN(rName string, sseEnabled bool) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kms_key" "test" { - deletion_window_in_days = 7 - description = %[1]q -} - -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - - server_side_encryption { - enabled = %[2]t - key_arn = aws_kms_key.test.arn - key_type = "CUSTOMER_MANAGED_CMK" - } -} -`, rName, sseEnabled)) -} - -func testAccDeliveryStreamConfig_s3basicSSEAndKeyType(rName string, sseEnabled bool, keyType string) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - - server_side_encryption { - enabled = %[2]t - key_type = %[3]q - } -} -`, rName, sseEnabled, keyType)) -} - func testAccDeliveryStreamConfig_tags1(rName, tagKey1, tagValue1 string) string { return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` resource "aws_kinesis_firehose_delivery_stream" "test" { depends_on = [aws_iam_role_policy.firehose] name = %[1]q - destination = "s3" + destination = "extended_s3" - s3_configuration { + extended_s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn } @@ -2608,9 +2231,9 @@ func testAccDeliveryStreamConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagVa resource "aws_kinesis_firehose_delivery_stream" "test" { depends_on = [aws_iam_role_policy.firehose] name = %[1]q - destination = "s3" + destination = "extended_s3" - s3_configuration { + extended_s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn } @@ -2623,48 +2246,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { `, rName, tagKey1, tagValue1, tagKey2, tagValue2)) } -func testAccDeliveryStreamConfig_s3Source(rName string) string { - return acctest.ConfigCompose( - testAccDeliveryStreamConfig_base(rName), - testAccDeliveryStreamConfig_baseKinesisStreamSource(rName), - fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose, aws_iam_role_policy.kinesis_source] - name = %[1]q - - kinesis_source_configuration { - kinesis_stream_arn = aws_kinesis_stream.source.arn - role_arn = aws_iam_role.kinesis_source.arn - } - - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } -} -`, rName)) -} - -func testAccDeliveryStreamConfig_s3Updates(rName string) string { - return acctest.ConfigCompose(testAccDeliveryStreamConfig_base(rName), fmt.Sprintf(` -resource "aws_kinesis_firehose_delivery_stream" "test" { - depends_on = [aws_iam_role_policy.firehose] - name = %[1]q - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } -} -`, rName)) -} - func testAccDeliveryStreamConfig_extendedS3basic(rName string) string { return acctest.ConfigCompose( testAccDeliveryStreamConfig_baseLambda(rName), @@ -3351,17 +2932,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "redshift" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - redshift_configuration { role_arn = aws_iam_role.firehose.arn cluster_jdbcurl = "jdbc:redshift://${aws_redshift_cluster.test.endpoint}/${aws_redshift_cluster.test.database_name}" username = "testuser" password = "T3stPass" data_table_name = "test-table" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3376,14 +2957,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "redshift" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - redshift_configuration { role_arn = aws_iam_role.firehose.arn cluster_jdbcurl = "jdbc:redshift://${aws_redshift_cluster.test.endpoint}/${aws_redshift_cluster.test.database_name}" @@ -3396,6 +2969,15 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { bucket_arn = aws_s3_bucket.bucket.arn } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + + data_table_name = "test-table" copy_options = "GZIP" data_table_columns = "test-col" @@ -3432,14 +3014,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "splunk" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - splunk_configuration { hec_endpoint = "https://input-test.com:443" hec_token = "51D4DA16-C61B-4F5F-8EC7-ED4301342A4A" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3455,14 +3037,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "splunk" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - splunk_configuration { hec_endpoint = "https://input-test.com:443" hec_token = "51D4DA16-C61B-4F5F-8EC7-ED4301342A4A" @@ -3470,6 +3044,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { hec_endpoint_type = "Event" s3_backup_mode = "FailedEventsOnly" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + processing_configuration { enabled = true @@ -3509,15 +3091,15 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "splunk" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - error_output_prefix = %[2]q - } - splunk_configuration { hec_endpoint = "https://input-test.com:443" hec_token = "51D4DA16-C61B-4F5F-8EC7-ED4301342A4A" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + error_output_prefix = %[2]q + } } } `, rName, errorOutputPrefix)) @@ -3530,15 +3112,15 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "http_endpoint" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - http_endpoint_configuration { url = "https://input-test.com:443" name = "HTTP_test" role_arn = aws_iam_role.firehose.arn + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3551,16 +3133,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "http_endpoint" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - error_output_prefix = %[2]q - } - http_endpoint_configuration { url = "https://input-test.com:443" name = "HTTP_test" role_arn = aws_iam_role.firehose.arn + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + error_output_prefix = %[2]q + } } } `, rName, errorOutputPrefix)) @@ -3573,16 +3155,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "http_endpoint" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - http_endpoint_configuration { url = "https://input-test.com:443" name = "HTTP_test" retry_duration = %[2]d role_arn = aws_iam_role.firehose.arn + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName, retryDuration)) @@ -3598,14 +3180,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "http_endpoint" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - http_endpoint_configuration { url = "https://input-test.com:443" name = "HTTP_test" @@ -3613,6 +3187,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn s3_backup_mode = "FailedDataOnly" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + processing_configuration { enabled = true From 82b1f91bbe08b11530ddad0e7eb94a0b75414ffe Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 12:45:14 -0500 Subject: [PATCH 202/304] test: check correct attribute locations --- internal/service/firehose/delivery_stream.go | 125 ++++++------ .../service/firehose/delivery_stream_test.go | 190 +++++++++--------- 2 files changed, 156 insertions(+), 159 deletions(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index 1735cb4f9a71..a6a14dd48b7a 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -124,65 +124,78 @@ func requestConfigurationSchema() *schema.Schema { } } +func s3BackupConfigurationSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: s3ConfigurationElem(), + } +} + func s3ConfigurationSchema() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, MaxItems: 1, Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bucket_arn": { - Type: schema.TypeString, - Required: true, - ValidateFunc: verify.ValidARN, - }, + Elem: s3ConfigurationElem(), + } +} - "buffering_size": { - Type: schema.TypeInt, - Optional: true, - Default: 5, - ValidateFunc: validation.IntAtLeast(1), - }, +func s3ConfigurationElem() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: verify.ValidARN, + }, - "buffering_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 300, - ValidateFunc: validation.IntAtLeast(60), - }, + "buffering_size": { + Type: schema.TypeInt, + Optional: true, + Default: 5, + ValidateFunc: validation.IntAtLeast(1), + }, - "compression_format": { - Type: schema.TypeString, - Optional: true, - Default: firehose.CompressionFormatUncompressed, - ValidateFunc: validation.StringInSlice(firehose.CompressionFormat_Values(), false), - }, + "buffering_interval": { + Type: schema.TypeInt, + Optional: true, + Default: 300, + ValidateFunc: validation.IntAtLeast(60), + }, - "error_output_prefix": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringLenBetween(0, 1024), - }, + "compression_format": { + Type: schema.TypeString, + Optional: true, + Default: firehose.CompressionFormatUncompressed, + ValidateFunc: validation.StringInSlice(firehose.CompressionFormat_Values(), false), + }, - "kms_key_arn": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: verify.ValidARN, - }, + "error_output_prefix": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(0, 1024), + }, - "role_arn": { - Type: schema.TypeString, - Required: true, - ValidateFunc: verify.ValidARN, - }, + "kms_key_arn": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: verify.ValidARN, + }, - "prefix": { - Type: schema.TypeString, - Optional: true, - }, + "role_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: verify.ValidARN, + }, - "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), + "prefix": { + Type: schema.TypeString, + Optional: true, }, + + "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), }, } } @@ -1301,7 +1314,7 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: validation.StringInSlice(firehose.S3BackupMode_Values(), false), }, - "s3_backup_configuration": s3ConfigurationSchema(), + "s3_backup_configuration": s3BackupConfigurationSchema(), "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), @@ -1368,7 +1381,7 @@ func ResourceDeliveryStream() *schema.Resource { ValidateFunc: validation.StringInSlice(firehose.S3BackupMode_Values(), false), }, - "s3_backup_configuration": s3ConfigurationSchema(), + "s3_backup_configuration": s3BackupConfigurationSchema(), "s3_configuration": s3ConfigurationSchema(), @@ -2960,28 +2973,12 @@ func resourceDeliveryStreamCreate(ctx context.Context, d *schema.ResourceData, m } func validateSchema(d *schema.ResourceData) error { - _, s3Exists := d.GetOk("s3_configuration") _, extendedS3Exists := d.GetOk("extended_s3_configuration") if d.Get("destination").(string) == destinationTypeExtendedS3 { if !extendedS3Exists { return fmt.Errorf( - "When destination is 'extended_s3', extended_s3_configuration is required", - ) - } else if s3Exists { - return fmt.Errorf( - "When destination is 'extended_s3', s3_configuration must not be set", - ) - } - } else { - if !s3Exists { - return fmt.Errorf( - "When destination is %s, s3_configuration is required", - d.Get("destination").(string), - ) - } else if extendedS3Exists { - return fmt.Errorf( - "extended_s3_configuration can only be used when destination is 'extended_s3'", + "when destination is 'extended_s3', extended_s3_configuration is required", ) } } diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index 601dd58ca35a..4b19019312fc 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -956,8 +956,8 @@ func TestAccFirehoseDeliveryStream_Splunk_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_splunkErrorOutputPrefix(rName, "prefix1"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix1"), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.0.error_output_prefix", "prefix1"), ), }, { @@ -969,8 +969,8 @@ func TestAccFirehoseDeliveryStream_Splunk_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_splunkErrorOutputPrefix(rName, "prefix2"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix2"), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.0.error_output_prefix", "prefix2"), ), }, { @@ -982,8 +982,8 @@ func TestAccFirehoseDeliveryStream_Splunk_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_splunkErrorOutputPrefix(rName, ""), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "splunk_configuration.0.s3_configuration.0.error_output_prefix", ""), ), }, }, @@ -1063,8 +1063,8 @@ func TestAccFirehoseDeliveryStream_HTTPEndpoint_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_httpEndpointErrorOutputPrefix(rName, "prefix1"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix1"), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.0.error_output_prefix", "prefix1"), ), }, { @@ -1076,8 +1076,8 @@ func TestAccFirehoseDeliveryStream_HTTPEndpoint_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_httpEndpointErrorOutputPrefix(rName, "prefix2"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix2"), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.0.error_output_prefix", "prefix2"), ), }, { @@ -1089,8 +1089,8 @@ func TestAccFirehoseDeliveryStream_HTTPEndpoint_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_httpEndpointErrorOutputPrefix(rName, ""), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "http_endpoint_configuration.0.s3_configuration.0.error_output_prefix", ""), ), }, }, @@ -1321,8 +1321,8 @@ func TestAccFirehoseDeliveryStream_Elasticsearch_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_elasticsearchErrorOutputPrefix(rName, "prefix1"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix1"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.0.error_output_prefix", "prefix1"), ), }, { @@ -1334,8 +1334,8 @@ func TestAccFirehoseDeliveryStream_Elasticsearch_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_elasticsearchErrorOutputPrefix(rName, "prefix2"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix2"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.0.error_output_prefix", "prefix2"), ), }, { @@ -1347,8 +1347,8 @@ func TestAccFirehoseDeliveryStream_Elasticsearch_ErrorOutputPrefix(t *testing.T) Config: testAccDeliveryStreamConfig_elasticsearchErrorOutputPrefix(rName, ""), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.s3_configuration.0.error_output_prefix", ""), ), }, }, @@ -1558,8 +1558,8 @@ func TestAccFirehoseDeliveryStream_Opensearch_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_opensearchErrorOutputPrefix(rName, "prefix1"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix1"), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.0.error_output_prefix", "prefix1"), ), }, { @@ -1571,8 +1571,8 @@ func TestAccFirehoseDeliveryStream_Opensearch_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_opensearchErrorOutputPrefix(rName, "prefix2"), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", "prefix2"), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.0.error_output_prefix", "prefix2"), ), }, { @@ -1584,8 +1584,8 @@ func TestAccFirehoseDeliveryStream_Opensearch_ErrorOutputPrefix(t *testing.T) { Config: testAccDeliveryStreamConfig_opensearchErrorOutputPrefix(rName, ""), Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.#", "1"), - resource.TestCheckResourceAttr(resourceName, "s3_configuration.0.error_output_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "opensearch_configuration.0.s3_configuration.0.error_output_prefix", ""), ), }, }, @@ -3346,16 +3346,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" type_name = "test" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3369,17 +3369,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - error_output_prefix = %[2]q - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" type_name = "test" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + error_output_prefix = %[2]q + } } } `, rName, errorOutputPrefix)) @@ -3393,17 +3393,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" type_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = aws_subnet.test[*].id security_group_ids = aws_security_group.test[*].id @@ -3425,11 +3425,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn @@ -3437,6 +3432,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + processing_configuration { enabled = false @@ -3473,11 +3473,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn @@ -3485,6 +3480,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = aws_subnet.test[*].id security_group_ids = aws_security_group.test[*].id @@ -3521,16 +3521,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { cluster_endpoint = "https://${aws_elasticsearch_domain.test_cluster.endpoint}" role_arn = aws_iam_role.firehose.arn index_name = "test" type_name = "test" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } }`, rName)) } @@ -3546,11 +3546,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - elasticsearch_configuration { cluster_endpoint = "https://${aws_elasticsearch_domain.test_cluster.endpoint}" role_arn = aws_iam_role.firehose.arn @@ -3558,6 +3553,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + processing_configuration { enabled = false @@ -3706,15 +3706,15 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3728,15 +3728,15 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { cluster_endpoint = "https://${aws_opensearch_domain.test_cluster.endpoint}" role_arn = aws_iam_role.firehose.arn index_name = "test" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } }`, rName)) } @@ -3752,17 +3752,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { cluster_endpoint = "https://${aws_opensearch_domain.test_cluster.endpoint}" role_arn = aws_iam_role.firehose.arn index_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + processing_configuration { enabled = false @@ -3795,16 +3795,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" + opensearch_configuration { + domain_arn = aws_opensearch_domain.test_cluster.arn + role_arn = aws_iam_role.firehose.arn + index_name = "test" + s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn error_output_prefix = %[2]q } - - opensearch_configuration { - domain_arn = aws_opensearch_domain.test_cluster.arn - role_arn = aws_iam_role.firehose.arn - index_name = "test" } } `, rName, errorOutputPrefix)) @@ -3818,16 +3818,16 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = aws_subnet.test[*].id security_group_ids = aws_security_group.test[*].id @@ -3849,17 +3849,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + processing_configuration { enabled = false @@ -3896,17 +3896,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } - opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" buffering_interval = 500 + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = aws_subnet.test[*].id security_group_ids = aws_security_group.test[*].id From 5b1742f32c04b2f1905359c81ff86b3fcdb283da Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 16:19:37 -0500 Subject: [PATCH 203/304] linter: fix acctest fmt --- .../service/firehose/delivery_stream_test.go | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index 4b19019312fc..0def277192da 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -3352,10 +3352,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" type_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3375,11 +3375,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" type_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - error_output_prefix = %[2]q - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + error_output_prefix = %[2]q + } } } `, rName, errorOutputPrefix)) @@ -3399,10 +3399,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" type_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } vpc_config { subnet_ids = aws_subnet.test[*].id @@ -3432,10 +3432,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } processing_configuration { enabled = false @@ -3480,10 +3480,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } vpc_config { subnet_ids = aws_subnet.test[*].id @@ -3527,10 +3527,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" type_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } }`, rName)) } @@ -3553,10 +3553,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { type_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } processing_configuration { enabled = false @@ -3711,10 +3711,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn index_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } } `, rName)) @@ -3733,10 +3733,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn index_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } } }`, rName)) } @@ -3758,10 +3758,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } processing_configuration { enabled = false @@ -3800,11 +3800,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn index_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - error_output_prefix = %[2]q - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + error_output_prefix = %[2]q + } } } `, rName, errorOutputPrefix)) @@ -3823,10 +3823,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn index_name = "test" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } vpc_config { subnet_ids = aws_subnet.test[*].id @@ -3855,10 +3855,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } processing_configuration { enabled = false @@ -3902,10 +3902,10 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { index_name = "test" buffering_interval = 500 - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } vpc_config { subnet_ids = aws_subnet.test[*].id From a4ab9f39ec687c7b98f42794c3fd20f289a62ed0 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 16:33:35 -0500 Subject: [PATCH 204/304] fmt --- internal/service/firehose/delivery_stream_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index 0def277192da..ddb2dcd4c6cb 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -2972,8 +2972,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -3047,8 +3047,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } @@ -3190,8 +3190,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { s3_configuration { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 + buffering_size = 10 + buffering_interval = 400 compression_format = "GZIP" } From 755dc694ee93e0e03f4d7285cb919ef84557e464 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 16:46:31 -0500 Subject: [PATCH 205/304] add CHANGELOG entry --- .changelog/31138.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/31138.txt diff --git a/.changelog/31138.txt b/.changelog/31138.txt new file mode 100644 index 000000000000..66426549653a --- /dev/null +++ b/.changelog/31138.txt @@ -0,0 +1,11 @@ +```release-note:breaking-change +resource/aws_kinesis_firehose_delivery_stream: Remove `s3` as an option for `destination`. Use `extended_s3` instead +``` + +```release-note:breaking-change +resource/aws_kinesis_firehose_delivery_stream: Remove `s3_configuration` attribute from the root of the resource. `s3_configuration` is now a part of the following blocks: `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` +``` + +```release-note:enhancement +resource/aws_kinesis_firehose_delivery_stream: Add `s3_configuration` to `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` +``` \ No newline at end of file From 1509ac50328997c51f07f5e6bb87f6c6401532e1 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 16:49:09 -0500 Subject: [PATCH 206/304] docs: remove statemux from docs (#31143) --- .../docs/r/medialive_multiplex_program.html.markdown | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/website/docs/r/medialive_multiplex_program.html.markdown b/website/docs/r/medialive_multiplex_program.html.markdown index 374ede89cc25..b1c1691de2a8 100644 --- a/website/docs/r/medialive_multiplex_program.html.markdown +++ b/website/docs/r/medialive_multiplex_program.html.markdown @@ -10,8 +10,6 @@ description: |- Terraform resource for managing an AWS MediaLive MultiplexProgram. -~> **Note** Attribute `statemux_settings` has been deprecated and will be removed in a future major release. Please use `statmux_settings` instead. - ## Example Usage ### Basic Usage @@ -79,8 +77,7 @@ The following arguments are optional: ### Video Settings * `constant_bitrate` - (Optional) Constant bitrate value. -* `statemux_settings` - (Optional, **Deprecated**) Statemux settings. See [Statmux Settings](#statemux-settings) for more details. Settings from this attribute will apply to `statmux_settings`. Conflicts with `statmux_settings`. -* `statmux_settings` - (Optional) Statmux settings. See [Statmux Settings](#statmux-settings) for more details Conflicts with `statemux_settings`. +* `statmux_settings` - (Optional) Statmux settings. See [Statmux Settings](#statmux-settings) for more details. ### Statmux Settings @@ -88,12 +85,6 @@ The following arguments are optional: * `maximum_bitrate` - (Optional) Maximum bitrate. * `priority` - (Optional) Priority value. -### Statemux Settings - -* `minimum_bitrate` - (Optional) Minimum bitrate. -* `maximum_bitrate` - (Optional) Maximum bitrate. -* `priority` - (Optional) Priority value. - ## Attributes Reference In addition to all arguments above, the following attributes are exported: From 7728255bc7950003a942aa7dbc223eba87126257 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 17:04:34 -0500 Subject: [PATCH 207/304] docs: update documentation --- ...sis_firehose_delivery_stream.html.markdown | 179 +++++++----------- 1 file changed, 72 insertions(+), 107 deletions(-) diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index 32735d67f7d0..88622ef89c6f 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -152,47 +152,6 @@ resource "aws_kinesis_firehose_delivery_stream" "extended_s3_stream" { } ``` -### S3 Destination (deprecated) - -```terraform -resource "aws_s3_bucket" "bucket" { - bucket = "tf-test-bucket" -} - -resource "aws_s3_bucket_acl" "bucket_acl" { - bucket = aws_s3_bucket.bucket.id - acl = "private" -} - -data "aws_iam_policy_document" "assume_role" { - statement { - effect = "Allow" - - principals { - type = "Service" - identifiers = ["firehose.amazonaws.com"] - } - - actions = ["sts:AssumeRole"] - } -} - -resource "aws_iam_role" "firehose_role" { - name = "firehose_test_role" - assume_role_policy = data.aws_iam_policy_document.assume_role.json -} - -resource "aws_kinesis_firehose_delivery_stream" "test_stream" { - name = "terraform-kinesis-firehose-test-stream" - destination = "s3" - - s3_configuration { - role_arn = aws_iam_role.firehose_role.arn - bucket_arn = aws_s3_bucket.bucket.arn - } -} -``` - ### Redshift Destination ```terraform @@ -209,14 +168,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "redshift" - s3_configuration { - role_arn = aws_iam_role.firehose_role.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - redshift_configuration { role_arn = aws_iam_role.firehose_role.arn cluster_jdbcurl = "jdbc:redshift://${aws_redshift_cluster.test_cluster.endpoint}/${aws_redshift_cluster.test_cluster.database_name}" @@ -227,6 +178,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { data_table_columns = "test-col" s3_backup_mode = "Enabled" + s3_configuration { + role_arn = aws_iam_role.firehose_role.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + s3_backup_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn @@ -249,20 +208,20 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose_role.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose_role.arn index_name = "test" type_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose_role.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + processing_configuration { enabled = "true" @@ -342,16 +301,18 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = "terraform-kinesis-firehose-es" destination = "elasticsearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + elasticsearch_configuration { domain_arn = aws_elasticsearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" type_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = [aws_subnet.first.id, aws_subnet.second.id] security_group_ids = [aws_security_group.first.id] @@ -372,19 +333,19 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose_role.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose_role.arn index_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose_role.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + processing_configuration { enabled = "true" @@ -467,15 +428,17 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { name = "terraform-kinesis-firehose-os" destination = "opensearch" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - } + opensearch_configuration { domain_arn = aws_opensearch_domain.test_cluster.arn role_arn = aws_iam_role.firehose.arn index_name = "test" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + } + vpc_config { subnet_ids = [aws_subnet.first.id, aws_subnet.second.id] security_group_ids = [aws_security_group.first.id] @@ -492,20 +455,20 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "splunk" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - splunk_configuration { hec_endpoint = "https://http-inputs-mydomain.splunkcloud.com:443" hec_token = "51D4DA16-C61B-4F5F-8EC7-ED4301342A4A" hec_acknowledgment_timeout = 600 hec_endpoint_type = "Event" s3_backup_mode = "FailedEventsOnly" + + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } } } ``` @@ -517,14 +480,6 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "http_endpoint" - s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = aws_s3_bucket.bucket.arn - buffering_size = 10 - buffering_interval = 400 - compression_format = "GZIP" - } - http_endpoint_configuration { url = "https://aws-api.newrelic.com/firehose/v1" name = "New Relic" @@ -534,6 +489,14 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { role_arn = aws_iam_role.firehose.arn s3_backup_mode = "FailedDataOnly" + s3_configuration { + role_arn = aws_iam_role.firehose.arn + bucket_arn = aws_s3_bucket.bucket.arn + buffering_size = 10 + buffering_interval = 400 + compression_format = "GZIP" + } + request_configuration { content_encoding = "GZIP" @@ -561,7 +524,6 @@ The following arguments are supported: * `server_side_encryption` - (Optional) Encrypt at rest options. Server-side encryption should not be enabled when a kinesis stream is configured as the source of the firehose delivery stream. * `destination` – (Required) This is the destination to where the data is delivered. The only options are `s3` (Deprecated, use `extended_s3` instead), `extended_s3`, `redshift`, `elasticsearch`, `splunk`, `http_endpoint` and `opensearch`. -* `s3_configuration` - (Optional) Required for non-S3 destinations. For S3 destination, use `extended_s3_configuration` instead. Configuration options for the s3 destination (or the intermediate bucket if the destination is redshift). More details are given below. * `extended_s3_configuration` - (Optional, only Required when `destination` is `extended_s3`) Enhanced configuration options for the s3 destination. More details are given below. * `redshift_configuration` - (Optional) Configuration options if redshift is the destination. @@ -583,23 +545,7 @@ The `server_side_encryption` object supports the following: * `key_type`- (Optional) Type of encryption key. Default is `AWS_OWNED_CMK`. Valid values are `AWS_OWNED_CMK` and `CUSTOMER_MANAGED_CMK` * `key_arn` - (Optional) Amazon Resource Name (ARN) of the encryption key. Required when `key_type` is `CUSTOMER_MANAGED_CMK`. -The `s3_configuration` object supports the following: - -~> **NOTE:** This configuration block is deprecated for the `s3` destination. - -* `role_arn` - (Required) The ARN of the AWS credentials. -* `bucket_arn` - (Required) The ARN of the S3 bucket -* `prefix` - (Optional) The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered S3 files. You can specify an extra prefix to be added in front of the time format prefix. Note that if the prefix ends with a slash, it appears as a folder in the S3 bucket -* `buffering_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. - We recommend setting SizeInMBs to a value greater than the amount of data you typically ingest into the delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec set SizeInMBs to be 10 MB or higher. -* `buffering_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300. -* `compression_format` - (Optional) The compression format. If no value is specified, the default is `UNCOMPRESSED`. Other supported values are `GZIP`, `ZIP`, `Snappy`, & `HADOOP_SNAPPY`. -* `error_output_prefix` - (Optional) Prefix added to failed records before writing them to S3. Not currently supported for `redshift` destination. This prefix appears immediately following the bucket name. For information about how to specify this prefix, see [Custom Prefixes for Amazon S3 Objects](https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). -* `kms_key_arn` - (Optional) Specifies the KMS key ARN the stream will use to encrypt data. If not set, no encryption will -be used. -* `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below - -The `extended_s3_configuration` object supports the same fields from `s3_configuration` as well as the following: +The `extended_s3_configuration` object supports the same fields from [s3_configuration](#s3configuration) as well as the following: * `data_format_conversion_configuration` - (Optional) Nested argument for the serializer, deserializer, and schema for converting data from the JSON format to the Parquet or ORC format before writing it to Amazon S3. More details given below. * `processing_configuration` - (Optional) The data processing configuration. More details are given below. @@ -614,6 +560,7 @@ The `redshift_configuration` object supports the following: * `password` - (Required) The password for the username above. * `retry_duration` - (Optional) The length of time during which Firehose retries delivery after a failure, starting from the initial request and including the first attempt. The default value is 3600 seconds (60 minutes). Firehose does not retry if the value of DurationInSeconds is 0 (zero) or if the first delivery attempt takes longer than the current value. * `role_arn` - (Required) The arn of the role the stream assumes. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. * `s3_backup_mode` - (Optional) The Amazon S3 backup mode. Valid values are `Disabled` and `Enabled`. Default value is `Disabled`. * `s3_backup_configuration` - (Optional) The configuration for backup in Amazon S3. Required if `s3_backup_mode` is `Enabled`. Supports the same fields as `s3_configuration` object. * `data_table_name` - (Required) The name of the table in the redshift cluster that the s3 bucket will copy to. @@ -632,6 +579,7 @@ The `elasticsearch_configuration` object supports the following: * `index_rotation_period` - (Optional) The Elasticsearch index rotation period. Index rotation appends a timestamp to the IndexName to facilitate expiration of old data. Valid values are `NoRotation`, `OneHour`, `OneDay`, `OneWeek`, and `OneMonth`. The default value is `OneDay`. * `retry_duration` - (Optional) After an initial failure to deliver to Amazon Elasticsearch, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `role_arn` - (Required) The ARN of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. The IAM role must have permission for `DescribeElasticsearchDomain`, `DescribeElasticsearchDomains`, and `DescribeElasticsearchDomainConfig`. The pattern needs to be `arn:.*`. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDocumentsOnly` and `AllDocuments`. Default value is `FailedDocumentsOnly`. * `type_name` - (Optional) The Elasticsearch type name with maximum length of 100 characters. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below @@ -648,6 +596,7 @@ The `opensearch_configuration` object supports the following: * `index_rotation_period` - (Optional) The Opensearch index rotation period. Index rotation appends a timestamp to the IndexName to facilitate expiration of old data. Valid values are `NoRotation`, `OneHour`, `OneDay`, `OneWeek`, and `OneMonth`. The default value is `OneDay`. * `retry_duration` - (Optional) After an initial failure to deliver to Amazon OpenSearch, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `role_arn` - (Required) The ARN of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. The IAM role must have permission for `DescribeDomain`, `DescribeDomains`, and `DescribeDomainConfig`. The pattern needs to be `arn:.*`. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDocumentsOnly` and `AllDocuments`. Default value is `FailedDocumentsOnly`. * `type_name` - (Optional) The Elasticsearch type name with maximum length of 100 characters. Types are deprecated in OpenSearch_1.1. TypeName must be empty. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below @@ -660,6 +609,7 @@ The `splunk_configuration` objects supports the following: * `hec_endpoint` - (Required) The HTTP Event Collector (HEC) endpoint to which Kinesis Firehose sends your data. * `hec_endpoint_type` - (Optional) The HEC endpoint type. Valid values are `Raw` or `Event`. The default value is `Raw`. * `hec_token` - (Required) The GUID that you obtain from your Splunk cluster when you create a new HEC endpoint. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedEventsOnly` and `AllEvents`. Default value is `FailedEventsOnly`. * `retry_duration` - (Optional) After an initial failure to deliver to Splunk, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below. @@ -671,6 +621,7 @@ The `http_endpoint_configuration` objects supports the following: * `name` - (Optional) The HTTP endpoint name. * `access_key` - (Optional) The access key required for Kinesis Firehose to authenticate with the HTTP endpoint selected as the destination. * `role_arn` - (Required) Kinesis Data Firehose uses this IAM role for all the permissions that the delivery stream needs. The pattern needs to be `arn:.*`. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDataOnly` and `AllData`. Default value is `FailedDataOnly`. * `buffering_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. * `buffering_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300 (5 minutes). @@ -760,6 +711,20 @@ resource "aws_kinesis_firehose_delivery_stream" "example" { * `schema_configuration` - (Required) Nested argument that specifies the AWS Glue Data Catalog table that contains the column information. More details below. * `enabled` - (Optional) Defaults to `true`. Set it to `false` if you want to disable format conversion while preserving the configuration details. +#### s3_configuration + +* `role_arn` - (Required) The ARN of the AWS credentials. +* `bucket_arn` - (Required) The ARN of the S3 bucket +* `prefix` - (Optional) The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered S3 files. You can specify an extra prefix to be added in front of the time format prefix. Note that if the prefix ends with a slash, it appears as a folder in the S3 bucket +* `buffering_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. + We recommend setting SizeInMBs to a value greater than the amount of data you typically ingest into the delivery stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec set SizeInMBs to be 10 MB or higher. +* `buffering_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300. +* `compression_format` - (Optional) The compression format. If no value is specified, the default is `UNCOMPRESSED`. Other supported values are `GZIP`, `ZIP`, `Snappy`, & `HADOOP_SNAPPY`. +* `error_output_prefix` - (Optional) Prefix added to failed records before writing them to S3. Not currently supported for `redshift` destination. This prefix appears immediately following the bucket name. For information about how to specify this prefix, see [Custom Prefixes for Amazon S3 Objects](https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). +* `kms_key_arn` - (Optional) Specifies the KMS key ARN the stream will use to encrypt data. If not set, no encryption will + be used. +* `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below + #### input_format_configuration * `deserializer` - (Required) Nested argument that specifies which deserializer to use. You can choose either the Apache Hive JSON SerDe or the OpenX JSON SerDe. More details below. From 4a0dd95addbcdd08248440f56a547cac6755295d Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 17:16:43 -0500 Subject: [PATCH 208/304] linter: website lint fix --- .../r/kinesis_firehose_delivery_stream.html.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index 88622ef89c6f..6070538fd280 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -185,7 +185,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { buffering_interval = 400 compression_format = "GZIP" } - + s3_backup_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn @@ -221,7 +221,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { buffering_interval = 400 compression_format = "GZIP" } - + processing_configuration { enabled = "true" @@ -312,7 +312,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn } - + vpc_config { subnet_ids = [aws_subnet.first.id, aws_subnet.second.id] security_group_ids = [aws_security_group.first.id] @@ -345,7 +345,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { buffering_interval = 400 compression_format = "GZIP" } - + processing_configuration { enabled = "true" @@ -438,7 +438,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = aws_iam_role.firehose.arn bucket_arn = aws_s3_bucket.bucket.arn } - + vpc_config { subnet_ids = [aws_subnet.first.id, aws_subnet.second.id] security_group_ids = [aws_security_group.first.id] @@ -496,7 +496,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { buffering_interval = 400 compression_format = "GZIP" } - + request_configuration { content_encoding = "GZIP" From f122b0d73c1fe723f2f39c9cba3145f111625753 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 17:29:27 -0500 Subject: [PATCH 209/304] fix link in docs --- internal/service/firehose/delivery_stream_test.go | 4 ++-- .../kinesis_firehose_delivery_stream.html.markdown | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index ddb2dcd4c6cb..c3c364e42c12 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -1279,7 +1279,7 @@ func TestAccFirehoseDeliveryStream_elasticSearchWithVPCUpdates(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil, nil, nil), - resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", "aws_vpc.elasticsearch_in_vpc", "id"), + resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", "aws_vpc.test", "id"), resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.subnet_ids.#", "2"), resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.security_group_ids.#", "2"), resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.role_arn", "aws_iam_role.firehose", "arn"), @@ -1295,7 +1295,7 @@ func TestAccFirehoseDeliveryStream_elasticSearchWithVPCUpdates(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckDeliveryStreamExists(ctx, resourceName, &stream), testAccCheckDeliveryStreamAttributes(&stream, nil, nil, nil, updatedElasticsearchConfig, nil, nil, nil), - resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", "aws_vpc.elasticsearch_in_vpc", "id"), + resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", "aws_vpc.test", "id"), resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.subnet_ids.#", "2"), resource.TestCheckResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.security_group_ids.#", "2"), resource.TestCheckResourceAttrPair(resourceName, "elasticsearch_configuration.0.vpc_config.0.role_arn", "aws_iam_role.firehose", "arn"), diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index 6070538fd280..0bbfe569316a 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -545,7 +545,7 @@ The `server_side_encryption` object supports the following: * `key_type`- (Optional) Type of encryption key. Default is `AWS_OWNED_CMK`. Valid values are `AWS_OWNED_CMK` and `CUSTOMER_MANAGED_CMK` * `key_arn` - (Optional) Amazon Resource Name (ARN) of the encryption key. Required when `key_type` is `CUSTOMER_MANAGED_CMK`. -The `extended_s3_configuration` object supports the same fields from [s3_configuration](#s3configuration) as well as the following: +The `extended_s3_configuration` object supports the same fields from [s3_configuration](#s3-configuration) as well as the following: * `data_format_conversion_configuration` - (Optional) Nested argument for the serializer, deserializer, and schema for converting data from the JSON format to the Parquet or ORC format before writing it to Amazon S3. More details given below. * `processing_configuration` - (Optional) The data processing configuration. More details are given below. @@ -560,7 +560,7 @@ The `redshift_configuration` object supports the following: * `password` - (Required) The password for the username above. * `retry_duration` - (Optional) The length of time during which Firehose retries delivery after a failure, starting from the initial request and including the first attempt. The default value is 3600 seconds (60 minutes). Firehose does not retry if the value of DurationInSeconds is 0 (zero) or if the first delivery attempt takes longer than the current value. * `role_arn` - (Required) The arn of the role the stream assumes. -* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3-configuration) for more details. * `s3_backup_mode` - (Optional) The Amazon S3 backup mode. Valid values are `Disabled` and `Enabled`. Default value is `Disabled`. * `s3_backup_configuration` - (Optional) The configuration for backup in Amazon S3. Required if `s3_backup_mode` is `Enabled`. Supports the same fields as `s3_configuration` object. * `data_table_name` - (Required) The name of the table in the redshift cluster that the s3 bucket will copy to. @@ -579,7 +579,7 @@ The `elasticsearch_configuration` object supports the following: * `index_rotation_period` - (Optional) The Elasticsearch index rotation period. Index rotation appends a timestamp to the IndexName to facilitate expiration of old data. Valid values are `NoRotation`, `OneHour`, `OneDay`, `OneWeek`, and `OneMonth`. The default value is `OneDay`. * `retry_duration` - (Optional) After an initial failure to deliver to Amazon Elasticsearch, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `role_arn` - (Required) The ARN of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. The IAM role must have permission for `DescribeElasticsearchDomain`, `DescribeElasticsearchDomains`, and `DescribeElasticsearchDomainConfig`. The pattern needs to be `arn:.*`. -* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3-configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDocumentsOnly` and `AllDocuments`. Default value is `FailedDocumentsOnly`. * `type_name` - (Optional) The Elasticsearch type name with maximum length of 100 characters. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below @@ -596,7 +596,7 @@ The `opensearch_configuration` object supports the following: * `index_rotation_period` - (Optional) The Opensearch index rotation period. Index rotation appends a timestamp to the IndexName to facilitate expiration of old data. Valid values are `NoRotation`, `OneHour`, `OneDay`, `OneWeek`, and `OneMonth`. The default value is `OneDay`. * `retry_duration` - (Optional) After an initial failure to deliver to Amazon OpenSearch, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `role_arn` - (Required) The ARN of the IAM role to be assumed by Firehose for calling the Amazon ES Configuration API and for indexing documents. The IAM role must have permission for `DescribeDomain`, `DescribeDomains`, and `DescribeDomainConfig`. The pattern needs to be `arn:.*`. -* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3-configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDocumentsOnly` and `AllDocuments`. Default value is `FailedDocumentsOnly`. * `type_name` - (Optional) The Elasticsearch type name with maximum length of 100 characters. Types are deprecated in OpenSearch_1.1. TypeName must be empty. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below @@ -609,7 +609,7 @@ The `splunk_configuration` objects supports the following: * `hec_endpoint` - (Required) The HTTP Event Collector (HEC) endpoint to which Kinesis Firehose sends your data. * `hec_endpoint_type` - (Optional) The HEC endpoint type. Valid values are `Raw` or `Event`. The default value is `Raw`. * `hec_token` - (Required) The GUID that you obtain from your Splunk cluster when you create a new HEC endpoint. -* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3-configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedEventsOnly` and `AllEvents`. Default value is `FailedEventsOnly`. * `retry_duration` - (Optional) After an initial failure to deliver to Splunk, the total amount of time, in seconds between 0 to 7200, during which Firehose re-attempts delivery (including the first attempt). After this time has elapsed, the failed documents are written to Amazon S3. The default value is 300s. There will be no retry if the value is 0. * `cloudwatch_logging_options` - (Optional) The CloudWatch Logging Options for the delivery stream. More details are given below. @@ -621,7 +621,7 @@ The `http_endpoint_configuration` objects supports the following: * `name` - (Optional) The HTTP endpoint name. * `access_key` - (Optional) The access key required for Kinesis Firehose to authenticate with the HTTP endpoint selected as the destination. * `role_arn` - (Required) Kinesis Data Firehose uses this IAM role for all the permissions that the delivery stream needs. The pattern needs to be `arn:.*`. -* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3configuration) for more details. +* `s3_configuration` - (Required) The S3 Configuration. See [s3_configuration](#s3-configuration) for more details. * `s3_backup_mode` - (Optional) Defines how documents should be delivered to Amazon S3. Valid values are `FailedDataOnly` and `AllData`. Default value is `FailedDataOnly`. * `buffering_size` - (Optional) Buffer incoming data to the specified size, in MBs, before delivering it to the destination. The default value is 5. * `buffering_interval` - (Optional) Buffer incoming data for the specified period of time, in seconds, before delivering it to the destination. The default value is 300 (5 minutes). @@ -711,7 +711,7 @@ resource "aws_kinesis_firehose_delivery_stream" "example" { * `schema_configuration` - (Required) Nested argument that specifies the AWS Glue Data Catalog table that contains the column information. More details below. * `enabled` - (Optional) Defaults to `true`. Set it to `false` if you want to disable format conversion while preserving the configuration details. -#### s3_configuration +#### S3 Configuration * `role_arn` - (Required) The ARN of the AWS credentials. * `bucket_arn` - (Required) The ARN of the S3 bucket From b19ee4ccf7b3093aaa918f130411c0083f427be1 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 3 May 2023 21:42:36 -0400 Subject: [PATCH 210/304] remove s3 destination constant --- internal/service/firehose/delivery_stream.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/firehose/delivery_stream.go b/internal/service/firehose/delivery_stream.go index a6a14dd48b7a..c9853197fd89 100644 --- a/internal/service/firehose/delivery_stream.go +++ b/internal/service/firehose/delivery_stream.go @@ -26,7 +26,6 @@ import ( ) const ( - destinationTypeS3 = "s3" destinationTypeExtendedS3 = "extended_s3" destinationTypeElasticsearch = "elasticsearch" destinationTypeOpensearch = "opensearch" From bb17cf518de1cdbf2226ba41202be90d954e31c6 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 4 May 2023 14:40:13 +0000 Subject: [PATCH 211/304] Update CHANGELOG.md for #31138 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 561d59e8bbec..5e8fc7961937 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ BREAKING CHANGES: * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_replication_group: Remove `availability_zones`, `number_cache_clusters`, `replication_group_description` arguments -- use `preferred_cache_cluster_azs`, `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Remove `cluster_mode` configuration block -- use top-level `num_node_groups` and `replicas_per_node_group` instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_kinesis_firehose_delivery_stream: Remove `s3_configuration` attribute from the root of the resource. `s3_configuration` is now a part of the following blocks: `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` ([#31138](https://github.com/hashicorp/terraform-provider-aws/issues/31138)) +* resource/aws_kinesis_firehose_delivery_stream: Remove `s3` as an option for `destination`. Use `extended_s3` instead ([#31138](https://github.com/hashicorp/terraform-provider-aws/issues/31138)) * resource/aws_kinesis_firehose_delivery_stream: Rename `extended_s3_configuration.0.s3_backup_configuration.0.buffer_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffer_interval` to `extended_s3_configuration.0.s3_backup_configuration.0.buffering_size` and `extended_s3_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) * resource/aws_kinesis_firehose_delivery_stream: Rename `redshift_configuration.0.s3_backup_configuration.0.buffer_size` and `redshift_configuration.0.s3_backup_configuration.0.buffer_interval` to `redshift_configuration.0.s3_backup_configuration.0.buffering_size` and `redshift_configuration.0.s3_backup_configuration.0.buffering_interval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) * resource/aws_kinesis_firehose_delivery_stream: Rename `s3_configuration.0.buffer_size` and `s3_configuration.0.buffer_internval` to `s3_configuration.0.buffering_size` and `s3_configuration.0.buffering_internval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) @@ -64,6 +66,7 @@ NOTES: * resource/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_guardduty_organization_configuration: The `auto_enable` argument has been deprecated. Use the `auto_enable_organization_members` argument instead. ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) @@ -72,6 +75,11 @@ NOTES: * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +ENHANCEMENTS: + +* resource/aws_guardduty_organization_configuration: Add `auto_enable_organization_members` attribute ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) +* resource/aws_kinesis_firehose_delivery_stream: Add `s3_configuration` to `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` ([#31138](https://github.com/hashicorp/terraform-provider-aws/issues/31138)) + BUG FIXES: * resource/aws_servicecatalog_product: Changes to `provisioning_artifact_parameters` arguments now properly trigger a replacement ([#31061](https://github.com/hashicorp/terraform-provider-aws/issues/31061)) From 0850787a173e890d5ae727f0ed1b3c19a12d2d39 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 12:19:51 -0400 Subject: [PATCH 212/304] provider: Remove 'skip_get_ec2_platforms' attribute. --- .changelog/#####.txt | 3 +++ internal/conns/config.go | 1 - internal/provider/fwprovider/provider.go | 5 ----- internal/provider/provider.go | 8 -------- website/docs/guides/version-5-upgrade.html.md | 7 +++++++ website/docs/index.html.markdown | 1 - 6 files changed, 10 insertions(+), 15 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..ad7bddc2af71 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +provider: The `skip_get_ec2_platforms` attribute has been removed +``` \ No newline at end of file diff --git a/internal/conns/config.go b/internal/conns/config.go index 61e6b3c3e7ec..2f45f62fc343 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -68,7 +68,6 @@ type Config struct { SharedConfigFiles []string SharedCredentialsFiles []string SkipCredsValidation bool - SkipGetEC2Platforms bool SkipRegionValidation bool SkipRequestingAccountId bool STSRegion string diff --git a/internal/provider/fwprovider/provider.go b/internal/provider/fwprovider/provider.go index b36fc1629223..e680a105bec0 100644 --- a/internal/provider/fwprovider/provider.go +++ b/internal/provider/fwprovider/provider.go @@ -116,11 +116,6 @@ func (p *fwprovider) Schema(ctx context.Context, req provider.SchemaRequest, res Optional: true, Description: "Skip the credentials validation via STS API. Used for AWS API implementations that do not have STS available/implemented.", }, - "skip_get_ec2_platforms": schema.BoolAttribute{ - Optional: true, - Description: "Skip getting the supported EC2 platforms. Used by users that don't have ec2:DescribeAccountAttributes permissions.", - DeprecationMessage: `With the retirement of EC2-Classic the skip_get_ec2_platforms attribute has been deprecated and will be removed in a future version.`, - }, "skip_metadata_api_check": schema.StringAttribute{ Optional: true, Description: "Skip the AWS Metadata API check. Used for AWS API implementations that do not have a metadata api endpoint.", diff --git a/internal/provider/provider.go b/internal/provider/provider.go index b3ed9411c6ad..c86d595af883 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -192,13 +192,6 @@ func New(ctx context.Context) (*schema.Provider, error) { Description: "Skip the credentials validation via STS API. " + "Used for AWS API implementations that do not have STS available/implemented.", }, - "skip_get_ec2_platforms": { - Type: schema.TypeBool, - Optional: true, - Description: "Skip getting the supported EC2 platforms. " + - "Used by users that don't have ec2:DescribeAccountAttributes permissions.", - Deprecated: `With the retirement of EC2-Classic the skip_get_ec2_platforms attribute has been deprecated and will be removed in a future version.`, - }, "skip_metadata_api_check": { Type: nullable.TypeNullableBool, Optional: true, @@ -449,7 +442,6 @@ func configure(ctx context.Context, provider *schema.Provider, d *schema.Resourc S3UsePathStyle: d.Get("s3_use_path_style").(bool) || d.Get("s3_force_path_style").(bool), SecretKey: d.Get("secret_key").(string), SkipCredsValidation: d.Get("skip_credentials_validation").(bool), - SkipGetEC2Platforms: d.Get("skip_get_ec2_platforms").(bool), SkipRegionValidation: d.Get("skip_region_validation").(bool), SkipRequestingAccountId: d.Get("skip_requesting_account_id").(bool), STSRegion: d.Get("sts_region").(string), diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index c3e70a5fe731..68b2127318f1 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -17,6 +17,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) +- [Provider Arguments](#provider-arguments) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) @@ -73,6 +74,12 @@ provider "aws" { } ``` +## Provider Arguments + +Version 5.0.0 removes these `provider` arguments: + +* `skip_get_ec2_platforms` - Removed following the retirement of EC2-Classic + ## Resource: aws_acmpca_certificate_authority The `status` attribute is superfluous and sometimes incorrect. It has been removed. diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index c571e7658462..088186011a28 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -329,7 +329,6 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf * `shared_credentials_file` - (Optional, **Deprecated**) Path to the shared credentials file. If not set and a profile is used, the default value is `~/.aws/credentials`. Can also be set with the `AWS_SHARED_CREDENTIALS_FILE` environment variable. * `shared_credentials_files` - (Optional) List of paths to the shared credentials file. If not set and a profile is used, the default value is `[~/.aws/credentials]`. A single value can also be set with the `AWS_SHARED_CREDENTIALS_FILE` environment variable. * `skip_credentials_validation` - (Optional) Whether to skip credentials validation via the STS API. This can be useful for testing and for AWS API implementations that do not have STS available. -* `skip_get_ec2_platforms` - (Optional, **Deprecated**) Whether to skip getting the supported EC2 platforms. Can be used when you do not have `ec2:DescribeAccountAttributes` permissions. * `skip_metadata_api_check` - (Optional) Whether to skip the AWS Metadata API check. Useful for AWS API implementations that do not have a metadata API endpoint. Setting to `true` prevents Terraform from authenticating via the Metadata API. You may need to use other authentication methods like static credentials, configuration variables, or environment variables. * `skip_region_validation` - (Optional) Whether to skip validating the region. Useful for AWS-like implementations that use their own region names or to bypass the validation for regions that aren't publicly available yet. * `skip_requesting_account_id` - (Optional) Whether to skip requesting the account ID. Useful for AWS API implementations that do not have the IAM, STS API, or metadata API. When set to `true` and not determined previously, returns an empty account ID when manually constructing ARN attributes with the following: From 080f7fd890dfd36afb4c27636bd5140ea7a0d775 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 12:27:21 -0400 Subject: [PATCH 213/304] provider: Remove 's3_force_path_style' attribute. --- .changelog/#####.txt | 2 +- internal/provider/fwprovider/provider.go | 5 ----- internal/provider/provider.go | 11 +---------- website/docs/guides/version-5-upgrade.html.md | 1 + website/docs/index.html.markdown | 1 - 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index ad7bddc2af71..3c047d0e5a8a 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,3 @@ ```release-note:breaking-change -provider: The `skip_get_ec2_platforms` attribute has been removed +provider: The `s3_force_path_style` and `skip_get_ec2_platforms` attributes have been removed ``` \ No newline at end of file diff --git a/internal/provider/fwprovider/provider.go b/internal/provider/fwprovider/provider.go index e680a105bec0..354fef779d21 100644 --- a/internal/provider/fwprovider/provider.go +++ b/internal/provider/fwprovider/provider.go @@ -84,11 +84,6 @@ func (p *fwprovider) Schema(ctx context.Context, req provider.SchemaRequest, res Optional: true, Description: "The region where AWS operations will take place. Examples\nare us-east-1, us-west-2, etc.", // lintignore:AWSAT003 }, - "s3_force_path_style": schema.BoolAttribute{ - Optional: true, - Description: "Set this to true to enable the request to use path-style addressing,\ni.e., https://s3.amazonaws.com/BUCKET/KEY. By default, the S3 client will\nuse virtual hosted bucket addressing when possible\n(https://BUCKET.s3.amazonaws.com/KEY). Specific to the Amazon S3 service.", - DeprecationMessage: "Use s3_use_path_style instead.", - }, "s3_use_path_style": schema.BoolAttribute{ Optional: true, Description: "Set this to true to enable the request to use path-style addressing,\ni.e., https://s3.amazonaws.com/BUCKET/KEY. By default, the S3 client will\nuse virtual hosted bucket addressing when possible\n(https://BUCKET.s3.amazonaws.com/KEY). Specific to the Amazon S3 service.", diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c86d595af883..0b3532d87057 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -143,15 +143,6 @@ func New(ctx context.Context) (*schema.Provider, error) { Description: "The region where AWS operations will take place. Examples\n" + "are us-east-1, us-west-2, etc.", // lintignore:AWSAT003, }, - "s3_force_path_style": { - Type: schema.TypeBool, - Optional: true, - Deprecated: "Use s3_use_path_style instead.", - Description: "Set this to true to enable the request to use path-style addressing,\n" + - "i.e., https://s3.amazonaws.com/BUCKET/KEY. By default, the S3 client will\n" + - "use virtual hosted bucket addressing when possible\n" + - "(https://BUCKET.s3.amazonaws.com/KEY). Specific to the Amazon S3 service.", - }, "s3_use_path_style": { Type: schema.TypeBool, Optional: true, @@ -439,7 +430,7 @@ func configure(ctx context.Context, provider *schema.Provider, d *schema.Resourc MaxRetries: 25, // Set default here, not in schema (muxing with v6 provider). Profile: d.Get("profile").(string), Region: d.Get("region").(string), - S3UsePathStyle: d.Get("s3_use_path_style").(bool) || d.Get("s3_force_path_style").(bool), + S3UsePathStyle: d.Get("s3_use_path_style").(bool), SecretKey: d.Get("secret_key").(string), SkipCredsValidation: d.Get("skip_credentials_validation").(bool), SkipRegionValidation: d.Get("skip_region_validation").(bool), diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 68b2127318f1..0da0924900c9 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -78,6 +78,7 @@ provider "aws" { Version 5.0.0 removes these `provider` arguments: +* `s3_force_path_style` - Use `s3_use_path_style` instead * `skip_get_ec2_platforms` - Removed following the retirement of EC2-Classic ## Resource: aws_acmpca_certificate_authority diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 088186011a28..b39953036211 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -322,7 +322,6 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf Can also be set with either the `AWS_REGION` or `AWS_DEFAULT_REGION` environment variables, or via a shared config file parameter `region` if `profile` is used. If credentials are retrieved from the EC2 Instance Metadata Service, the region can also be retrieved from the metadata. -* `s3_force_path_style` - (Optional, **Deprecated**) Whether to enable the request to use path-style addressing, i.e., `https://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will use virtual hosted bucket addressing, `https://BUCKET.s3.amazonaws.com/KEY`, when possible. Specific to the Amazon S3 service. * `s3_use_path_style` - (Optional) Whether to enable the request to use path-style addressing, i.e., `https://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will use virtual hosted bucket addressing, `https://BUCKET.s3.amazonaws.com/KEY`, when possible. Specific to the Amazon S3 service. * `secret_key` - (Optional) AWS secret key. Can also be set with the `AWS_SECRET_ACCESS_KEY` environment variable, or via a shared configuration and credentials files if `profile` is used. See also `access_key`. * `shared_config_files` - (Optional) List of paths to AWS shared config files. If not set, the default is `[~/.aws/config]`. A single value can also be set with the `AWS_CONFIG_FILE` environment variable. From 3121ff025746381645bb27fa2cca6cda4022defd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 12:32:44 -0400 Subject: [PATCH 214/304] provider: Remove 'shared_credentials_file' attribute. --- .changelog/#####.txt | 2 +- internal/provider/fwprovider/provider.go | 5 ----- internal/provider/provider.go | 20 +++++-------------- website/docs/guides/version-5-upgrade.html.md | 1 + 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index 3c047d0e5a8a..427c57ff3bb8 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,3 @@ ```release-note:breaking-change -provider: The `s3_force_path_style` and `skip_get_ec2_platforms` attributes have been removed +provider: The `s3_force_path_style`, `shared_credentials_file` and `skip_get_ec2_platforms` attributes have been removed ``` \ No newline at end of file diff --git a/internal/provider/fwprovider/provider.go b/internal/provider/fwprovider/provider.go index 354fef779d21..8c432bc296db 100644 --- a/internal/provider/fwprovider/provider.go +++ b/internal/provider/fwprovider/provider.go @@ -97,11 +97,6 @@ func (p *fwprovider) Schema(ctx context.Context, req provider.SchemaRequest, res Optional: true, Description: "List of paths to shared config files. If not set, defaults to [~/.aws/config].", }, - "shared_credentials_file": schema.StringAttribute{ - Optional: true, - Description: "The path to the shared credentials file. If not set, defaults to ~/.aws/credentials.", - DeprecationMessage: "Use shared_credentials_files instead.", - }, "shared_credentials_files": schema.ListAttribute{ ElementType: types.StringType, Optional: true, diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 0b3532d87057..c47217fef923 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -163,19 +163,11 @@ func New(ctx context.Context) (*schema.Provider, error) { Description: "List of paths to shared config files. If not set, defaults to [~/.aws/config].", Elem: &schema.Schema{Type: schema.TypeString}, }, - "shared_credentials_file": { - Type: schema.TypeString, - Optional: true, - Deprecated: "Use shared_credentials_files instead.", - ConflictsWith: []string{"shared_credentials_files"}, - Description: "The path to the shared credentials file. If not set, defaults to ~/.aws/credentials.", - }, "shared_credentials_files": { - Type: schema.TypeList, - Optional: true, - ConflictsWith: []string{"shared_credentials_file"}, - Description: "List of paths to shared credentials files. If not set, defaults to [~/.aws/credentials].", - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Optional: true, + Description: "List of paths to shared credentials files. If not set, defaults to [~/.aws/credentials].", + Elem: &schema.Schema{Type: schema.TypeString}, }, "skip_credentials_validation": { Type: schema.TypeBool, @@ -490,9 +482,7 @@ func configure(ctx context.Context, provider *schema.Provider, d *schema.Resourc config.MaxRetries = v.(int) } - if v, ok := d.GetOk("shared_credentials_file"); ok { - config.SharedCredentialsFiles = []string{v.(string)} - } else if v, ok := d.GetOk("shared_credentials_files"); ok && len(v.([]interface{})) > 0 { + if v, ok := d.GetOk("shared_credentials_files"); ok && len(v.([]interface{})) > 0 { config.SharedCredentialsFiles = flex.ExpandStringValueList(v.([]interface{})) } diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 0da0924900c9..96eb9cd85aee 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -79,6 +79,7 @@ provider "aws" { Version 5.0.0 removes these `provider` arguments: * `s3_force_path_style` - Use `s3_use_path_style` instead +* `shared_credentials_file` - Use `shared_credentials_files` instead * `skip_get_ec2_platforms` - Removed following the retirement of EC2-Classic ## Resource: aws_acmpca_certificate_authority From 1d27bf2971fffaf4f61b6304a35b987e13b9e20c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 12:36:39 -0400 Subject: [PATCH 215/304] provider: Remove 'assume_role.duration_seconds' and 'assume_role_with_web_identity.duration_seconds' attributes. --- .changelog/#####.txt | 2 +- internal/provider/fwprovider/provider.go | 5 ----- internal/provider/provider.go | 21 ++++--------------- website/docs/guides/version-5-upgrade.html.md | 2 ++ 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index 427c57ff3bb8..d6bad408844a 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,3 @@ ```release-note:breaking-change -provider: The `s3_force_path_style`, `shared_credentials_file` and `skip_get_ec2_platforms` attributes have been removed +provider: The `assume_role.duration_seconds`, `assume_role_with_web_identity.duration_seconds`, `s3_force_path_style`, `shared_credentials_file` and `skip_get_ec2_platforms` attributes have been removed ``` \ No newline at end of file diff --git a/internal/provider/fwprovider/provider.go b/internal/provider/fwprovider/provider.go index 8c432bc296db..96d855242159 100644 --- a/internal/provider/fwprovider/provider.go +++ b/internal/provider/fwprovider/provider.go @@ -147,11 +147,6 @@ func (p *fwprovider) Schema(ctx context.Context, req provider.SchemaRequest, res Optional: true, Description: "The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m.", }, - "duration_seconds": schema.Int64Attribute{ - Optional: true, - Description: "The duration, in seconds, of the role session.", - DeprecationMessage: "Use assume_role.duration instead", - }, "external_id": schema.StringAttribute{ Optional: true, Description: "A unique identifier that might be required when you assume a role in another account.", diff --git a/internal/provider/provider.go b/internal/provider/provider.go index c47217fef923..d06e2e26ea51 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -521,19 +521,10 @@ func assumeRoleSchema() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "duration": { - Type: schema.TypeString, - Optional: true, - Description: "The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m.", - ValidateFunc: validAssumeRoleDuration, - ConflictsWith: []string{"assume_role.0.duration_seconds"}, - }, - "duration_seconds": { - Type: schema.TypeInt, - Optional: true, - Deprecated: "Use assume_role.duration instead", - Description: "The duration, in seconds, of the role session.", - ValidateFunc: validation.IntBetween(900, 43200), - ConflictsWith: []string{"assume_role.0.duration"}, + Type: schema.TypeString, + Optional: true, + Description: "The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m.", + ValidateFunc: validAssumeRoleDuration, }, "external_id": { Type: schema.TypeString, @@ -681,8 +672,6 @@ func expandAssumeRole(_ context.Context, tfMap map[string]interface{}) *awsbase. if v, ok := tfMap["duration"].(string); ok && v != "" { duration, _ := time.ParseDuration(v) assumeRole.Duration = duration - } else if v, ok := tfMap["duration_seconds"].(int); ok && v != 0 { - assumeRole.Duration = time.Duration(v) * time.Second } if v, ok := tfMap["external_id"].(string); ok && v != "" { @@ -730,8 +719,6 @@ func expandAssumeRoleWithWebIdentity(_ context.Context, tfMap map[string]interfa if v, ok := tfMap["duration"].(string); ok && v != "" { duration, _ := time.ParseDuration(v) assumeRole.Duration = duration - } else if v, ok := tfMap["duration_seconds"].(int); ok && v != 0 { - assumeRole.Duration = time.Duration(v) * time.Second } if v, ok := tfMap["policy"].(string); ok && v != "" { diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 96eb9cd85aee..8e83c1f0a55c 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -78,6 +78,8 @@ provider "aws" { Version 5.0.0 removes these `provider` arguments: +* `assume_role.duration_seconds` - Use `assume_role.duration` instead +* `assume_role_with_web_identity.duration_seconds` - Use `assume_role_with_web_identity.duration` instead * `s3_force_path_style` - Use `s3_use_path_style` instead * `shared_credentials_file` - Use `shared_credentials_files` instead * `skip_get_ec2_platforms` - Removed following the retirement of EC2-Classic From 2662cdf68338a3e5b6c3533ccf117dbf1a0efbf7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 12:42:10 -0400 Subject: [PATCH 216/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31155.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31155.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31155.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31155.txt From 0d14abe85eea4e91ef469c2d52199dd9700e0823 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 13:54:08 -0400 Subject: [PATCH 217/304] Fixup 'Terraform AWS Provider Custom Service Endpoint Configuration'. --- website/docs/guides/custom-service-endpoints.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index 5ae13f8d31a4..bf5da3f2d8f3 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -433,7 +433,7 @@ An example provider configuration: provider "aws" { access_key = "mock_access_key" region = "us-east-1" - s3_force_path_style = true + s3_use_path_style = true secret_key = "mock_secret_key" skip_credentials_validation = true skip_metadata_api_check = true From 6d76981dcf0f074f6d21f0c8bea1f185ac42d620 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 13:54:25 -0400 Subject: [PATCH 218/304] Revert "Fixup 'Terraform AWS Provider Custom Service Endpoint Configuration'." This reverts commit 0d14abe85eea4e91ef469c2d52199dd9700e0823. --- website/docs/guides/custom-service-endpoints.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index bf5da3f2d8f3..5ae13f8d31a4 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -433,7 +433,7 @@ An example provider configuration: provider "aws" { access_key = "mock_access_key" region = "us-east-1" - s3_use_path_style = true + s3_force_path_style = true secret_key = "mock_secret_key" skip_credentials_validation = true skip_metadata_api_check = true From 34c368b91b4849c3eeac39397c27f3067472ef72 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 13:55:29 -0400 Subject: [PATCH 219/304] Fixup 'Terraform AWS Provider Custom Service Endpoint Configuration'. --- internal/generate/customends/custom_endpoints_footer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/generate/customends/custom_endpoints_footer.tmpl b/internal/generate/customends/custom_endpoints_footer.tmpl index 27f830774052..4e3d622a0b90 100644 --- a/internal/generate/customends/custom_endpoints_footer.tmpl +++ b/internal/generate/customends/custom_endpoints_footer.tmpl @@ -42,7 +42,7 @@ An example provider configuration: provider "aws" { access_key = "mock_access_key" region = "us-east-1" - s3_force_path_style = true + s3_use_path_style = true secret_key = "mock_secret_key" skip_credentials_validation = true skip_metadata_api_check = true From b8388d9ee9d60fa32fec67ad69e9d106bb3c74d9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 13:56:08 -0400 Subject: [PATCH 220/304] Run 'make gen'. --- website/docs/guides/custom-service-endpoints.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index 5ae13f8d31a4..bf5da3f2d8f3 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -433,7 +433,7 @@ An example provider configuration: provider "aws" { access_key = "mock_access_key" region = "us-east-1" - s3_force_path_style = true + s3_use_path_style = true secret_key = "mock_secret_key" skip_credentials_validation = true skip_metadata_api_check = true From 083b6ad8fd8a308a20def5adee7765fac85608b7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 14:13:27 -0400 Subject: [PATCH 221/304] Update index.html.markdown --- website/docs/index.html.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index b39953036211..13f4e2d8fd66 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -325,7 +325,6 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf * `s3_use_path_style` - (Optional) Whether to enable the request to use path-style addressing, i.e., `https://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will use virtual hosted bucket addressing, `https://BUCKET.s3.amazonaws.com/KEY`, when possible. Specific to the Amazon S3 service. * `secret_key` - (Optional) AWS secret key. Can also be set with the `AWS_SECRET_ACCESS_KEY` environment variable, or via a shared configuration and credentials files if `profile` is used. See also `access_key`. * `shared_config_files` - (Optional) List of paths to AWS shared config files. If not set, the default is `[~/.aws/config]`. A single value can also be set with the `AWS_CONFIG_FILE` environment variable. -* `shared_credentials_file` - (Optional, **Deprecated**) Path to the shared credentials file. If not set and a profile is used, the default value is `~/.aws/credentials`. Can also be set with the `AWS_SHARED_CREDENTIALS_FILE` environment variable. * `shared_credentials_files` - (Optional) List of paths to the shared credentials file. If not set and a profile is used, the default value is `[~/.aws/credentials]`. A single value can also be set with the `AWS_SHARED_CREDENTIALS_FILE` environment variable. * `skip_credentials_validation` - (Optional) Whether to skip credentials validation via the STS API. This can be useful for testing and for AWS API implementations that do not have STS available. * `skip_metadata_api_check` - (Optional) Whether to skip the AWS Metadata API check. Useful for AWS API implementations that do not have a metadata API endpoint. Setting to `true` prevents Terraform from authenticating via the Metadata API. You may need to use other authentication methods like static credentials, configuration variables, or environment variables. From fac7a01dec063c20ad67f2d6f58b3f563b274a46 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 4 May 2023 18:35:57 +0000 Subject: [PATCH 222/304] Update CHANGELOG.md for #31155 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e8fc7961937..e0ff403494e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BREAKING CHANGES: * data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* provider: The `assume_role.duration_seconds`, `assume_role_with_web_identity.duration_seconds`, `s3_force_path_style`, `shared_credentials_file` and `skip_get_ec2_platforms` attributes have been removed ([#31155](https://github.com/hashicorp/terraform-provider-aws/issues/31155)) * provider: The `aws_subnet_ids` data source has been removed ([#31140](https://github.com/hashicorp/terraform-provider-aws/issues/31140)) * provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From c00ef28d09575ca31b3e68bd0ae731dc6522fe44 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 14:59:57 -0400 Subject: [PATCH 223/304] Add semgrep rule to ensure that data sources do not have a 'tags_all' attribute. --- .ci/semgrep/tags/ds-tags-all.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .ci/semgrep/tags/ds-tags-all.yml diff --git a/.ci/semgrep/tags/ds-tags-all.yml b/.ci/semgrep/tags/ds-tags-all.yml new file mode 100644 index 000000000000..174fe723d5d3 --- /dev/null +++ b/.ci/semgrep/tags/ds-tags-all.yml @@ -0,0 +1,12 @@ +rules: + - id: data-source-with-resource-read + languages: [go] + message: Data sources should not have a `tags_all` attribute + paths: + include: + - internal/service/**/*_data_source.go + patterns: + - pattern-either: + - pattern-regex: '"tags_all":\s*tftags.TagsSchemaComputed' + - pattern-regex: 'names\.AttrTagsAll:\s*tftags.TagsSchemaComputed' + severity: WARNING \ No newline at end of file From cf7408a413b83755427d89e2899c5ea8da90d9a7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 15:05:40 -0400 Subject: [PATCH 224/304] d/aws_service_discovery_service: Deprecate 'tags_all'. --- .changelog/#####.txt | 3 +++ .../service/servicediscovery/service_data_source.go | 10 ++++++++-- website/docs/d/service_discovery_service.html.markdown | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..dc5f2f25b33f --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version +``` \ No newline at end of file diff --git a/internal/service/servicediscovery/service_data_source.go b/internal/service/servicediscovery/service_data_source.go index 28092b1cc1d2..56f26d2ab9f0 100644 --- a/internal/service/servicediscovery/service_data_source.go +++ b/internal/service/servicediscovery/service_data_source.go @@ -96,8 +96,14 @@ func DataSourceService() *schema.Resource { Type: schema.TypeString, Required: true, }, - "tags": tftags.TagsSchema(), - "tags_all": tftags.TagsSchemaComputed(), + "tags": tftags.TagsSchema(), + "tags_all": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Deprecated: `this attribute has been deprecated`, + }, }, } } diff --git a/website/docs/d/service_discovery_service.html.markdown b/website/docs/d/service_discovery_service.html.markdown index a748c55ed067..8b8a9336e8ff 100644 --- a/website/docs/d/service_discovery_service.html.markdown +++ b/website/docs/d/service_discovery_service.html.markdown @@ -37,7 +37,7 @@ In addition to all arguments above, the following attributes are exported: * `health_check_config` - Complex type that contains settings for an optional health check. Only for Public DNS namespaces. * `health_check_custom_config` - A complex type that contains settings for ECS managed health checks. * `tags` - Map of tags to assign to the service. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. -* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `tags_all` - (**Deprecated**) Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ### dns_config From 95c1d5e9b6fb15bcea22605c31efeeb94961b981 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 15:21:52 -0400 Subject: [PATCH 225/304] d/aws_quicksight_data_set: Deprecate 'tags_all'. --- .changelog/#####.txt | 4 ++++ internal/service/quicksight/data_set_data_source.go | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index dc5f2f25b33f..711ff5c52770 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,7 @@ ```release-note:note data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version +``` + +```release-note:note +data-source/aws_quicksight_data_set: The `tags_all` attribute has been deprecated and will be removed in a future version ``` \ No newline at end of file diff --git a/internal/service/quicksight/data_set_data_source.go b/internal/service/quicksight/data_set_data_source.go index bb207ee87ab0..a60ebd9d82ca 100644 --- a/internal/service/quicksight/data_set_data_source.go +++ b/internal/service/quicksight/data_set_data_source.go @@ -219,8 +219,14 @@ func DataSourceDataSet() *schema.Resource { }, }, }, - "tags": tftags.TagsSchemaComputed(), - "tags_all": tftags.TagsSchemaComputed(), + "tags": tftags.TagsSchemaComputed(), + "tags_all": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Deprecated: `this attribute has been deprecated`, + }, }, } } From f71c53b1fd22aa49b3492ad5bbc98d88ff4edd8d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 15:26:51 -0400 Subject: [PATCH 226/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31162.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31162.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31162.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31162.txt From 35049df6713d342fb1fbef0aaceb9dcf7c9264e1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 4 May 2023 15:28:15 -0400 Subject: [PATCH 227/304] Fix yamllint '[new-line-at-end-of-file] no new line character at the end of file'. --- .ci/semgrep/tags/ds-tags-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/semgrep/tags/ds-tags-all.yml b/.ci/semgrep/tags/ds-tags-all.yml index 174fe723d5d3..e0e2456256ce 100644 --- a/.ci/semgrep/tags/ds-tags-all.yml +++ b/.ci/semgrep/tags/ds-tags-all.yml @@ -9,4 +9,4 @@ rules: - pattern-either: - pattern-regex: '"tags_all":\s*tftags.TagsSchemaComputed' - pattern-regex: 'names\.AttrTagsAll:\s*tftags.TagsSchemaComputed' - severity: WARNING \ No newline at end of file + severity: WARNING From 0473f69adeabf2d5cc091b0c7509b2935fed1dda Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 4 May 2023 20:03:13 +0000 Subject: [PATCH 228/304] Update CHANGELOG.md for #31162 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ff403494e4..d32719df349b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) * data-source/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * data-source/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* data-source/aws_quicksight_data_set: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) +* data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) * resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) * resource/aws_autoscaling_attachment: Update configurations to use `lb_target_group_arn` instead of `alb_target_group_arn` which has been removed ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_docdb_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From 9ba2526cf5dacd3ac455c85a630c73ed5b98a071 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 11:41:08 -0400 Subject: [PATCH 229/304] r/aws_ec2_client_vpn_endpoint: Remove 'status'. --- .changelog/#####.txt | 3 +++ internal/service/ec2/vpnclient_endpoint.go | 6 ------ internal/service/ec2/vpnclient_endpoint_test.go | 1 - website/docs/guides/version-5-upgrade.html.md | 5 +++++ website/docs/r/ec2_client_vpn_endpoint.html.markdown | 1 - 5 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..b5e72884c915 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_ec2_client_vpn_endpoint: The `status` attribute has been removed +``` \ No newline at end of file diff --git a/internal/service/ec2/vpnclient_endpoint.go b/internal/service/ec2/vpnclient_endpoint.go index 2b9c03d84f41..898277af8bc7 100644 --- a/internal/service/ec2/vpnclient_endpoint.go +++ b/internal/service/ec2/vpnclient_endpoint.go @@ -192,11 +192,6 @@ func ResourceClientVPNEndpoint() *schema.Resource { Optional: true, Default: false, }, - "status": { - Type: schema.TypeString, - Computed: true, - Deprecated: `This attribute has been deprecated.`, - }, names.AttrTags: tftags.TagsSchema(), names.AttrTagsAll: tftags.TagsSchemaComputed(), "transport_protocol": { @@ -350,7 +345,6 @@ func resourceClientVPNEndpointRead(ctx context.Context, d *schema.ResourceData, d.Set("server_certificate_arn", ep.ServerCertificateArn) d.Set("session_timeout_hours", ep.SessionTimeoutHours) d.Set("split_tunnel", ep.SplitTunnel) - d.Set("status", ep.Status.Code) d.Set("transport_protocol", ep.TransportProtocol) d.Set("vpc_id", ep.VpcId) d.Set("vpn_port", ep.VpnPort) diff --git a/internal/service/ec2/vpnclient_endpoint_test.go b/internal/service/ec2/vpnclient_endpoint_test.go index c30538e8b1d8..73bd1be3f99d 100644 --- a/internal/service/ec2/vpnclient_endpoint_test.go +++ b/internal/service/ec2/vpnclient_endpoint_test.go @@ -129,7 +129,6 @@ func testAccClientVPNEndpoint_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "server_certificate_arn"), resource.TestCheckResourceAttr(resourceName, "session_timeout_hours", "24"), resource.TestCheckResourceAttr(resourceName, "split_tunnel", "false"), - resource.TestCheckResourceAttr(resourceName, "status", ec2.ClientVpnEndpointStatusCodePendingAssociate), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), resource.TestCheckResourceAttr(resourceName, "transport_protocol", "udp"), diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 8e83c1f0a55c..63931506ebcb 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -22,6 +22,7 @@ Upgrade topics: - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) +- [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) @@ -92,6 +93,10 @@ The `status` attribute is superfluous and sometimes incorrect. It has been remov The `threshold` attribute has been removed. +## Resource: aws_ec2_client_vpn_endpoint + +The `status` attribute has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. diff --git a/website/docs/r/ec2_client_vpn_endpoint.html.markdown b/website/docs/r/ec2_client_vpn_endpoint.html.markdown index e844959f3141..f62e971c3fdc 100644 --- a/website/docs/r/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/r/ec2_client_vpn_endpoint.html.markdown @@ -90,7 +90,6 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN of the Client VPN endpoint. * `dns_name` - The DNS name to be used by clients when establishing their VPN session. * `id` - The ID of the Client VPN endpoint. -* `status` - **Deprecated** The current state of the Client VPN endpoint. * `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Import From 5ecfd4439f3d340b20c195bec6e1d056d91f684c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 11:44:55 -0400 Subject: [PATCH 230/304] r/aws_ec2_client_vpn_network_association: Remove 'status'. --- .changelog/#####.txt | 4 ++++ internal/service/ec2/vpnclient_network_association.go | 6 ------ website/docs/guides/version-5-upgrade.html.md | 5 +++++ .../docs/r/ec2_client_vpn_network_association.html.markdown | 1 - 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index b5e72884c915..68c6e50d6c40 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,7 @@ ```release-note:breaking-change resource/aws_ec2_client_vpn_endpoint: The `status` attribute has been removed +``` + +```release-note:breaking-change +resource/aws_ec2_client_vpn_network_association: The `status` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/ec2/vpnclient_network_association.go b/internal/service/ec2/vpnclient_network_association.go index 4f6f85171532..2d3b559608ea 100644 --- a/internal/service/ec2/vpnclient_network_association.go +++ b/internal/service/ec2/vpnclient_network_association.go @@ -54,11 +54,6 @@ func ResourceClientVPNNetworkAssociation() *schema.Resource { Set: schema.HashString, Deprecated: "Use the `security_group_ids` attribute of the `aws_ec2_client_vpn_endpoint` resource instead.", }, - "status": { - Type: schema.TypeString, - Computed: true, - Deprecated: `This attribute has been deprecated.`, - }, "subnet_id": { Type: schema.TypeString, Required: true, @@ -135,7 +130,6 @@ func resourceClientVPNNetworkAssociationRead(ctx context.Context, d *schema.Reso d.Set("association_id", network.AssociationId) d.Set("client_vpn_endpoint_id", network.ClientVpnEndpointId) d.Set("security_groups", aws.StringValueSlice(network.SecurityGroups)) - d.Set("status", network.Status.Code) d.Set("subnet_id", network.TargetNetworkId) d.Set("vpc_id", network.VpcId) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 63931506ebcb..f6aad2cb6510 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -23,6 +23,7 @@ Upgrade topics: - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) +- [Resource: aws_ec2_client_vpn_network_association](#resource-aws_ec2_client_vpn_network_association) @@ -97,6 +98,10 @@ The `threshold` attribute has been removed. The `status` attribute has been removed. +## Resource: aws_ec2_client_vpn_network_association + +The `status` attribute has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. diff --git a/website/docs/r/ec2_client_vpn_network_association.html.markdown b/website/docs/r/ec2_client_vpn_network_association.html.markdown index cfa931a3dca4..19aa0f74e3c0 100644 --- a/website/docs/r/ec2_client_vpn_network_association.html.markdown +++ b/website/docs/r/ec2_client_vpn_network_association.html.markdown @@ -48,7 +48,6 @@ In addition to all arguments above, the following attributes are exported: * `id` - The unique ID of the target network association. * `association_id` - The unique ID of the target network association. -* `status` - **Deprecated** The current state of the target network association. * `vpc_id` - The ID of the VPC in which the target subnet is located. ## Timeouts From bc1a41ee5592e9b6add2d0e08ebeb4a400cc74ae Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 11:47:29 -0400 Subject: [PATCH 231/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31223.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31223.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31223.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31223.txt From ab5edbe49f87e22c3e3ed2e4b49a8e8357a21820 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 5 May 2023 16:33:40 +0000 Subject: [PATCH 232/304] Update CHANGELOG.md for #31223 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d32719df349b..670a49adf47d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ BREAKING CHANGES: * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed ([#30452](https://github.com/hashicorp/terraform-provider-aws/issues/30452)) * resource/aws_docdb_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) +* resource/aws_ec2_client_vpn_endpoint: The `status` attribute has been removed ([#31223](https://github.com/hashicorp/terraform-provider-aws/issues/31223)) +* resource/aws_ec2_client_vpn_network_association: The `status` attribute has been removed ([#31223](https://github.com/hashicorp/terraform-provider-aws/issues/31223)) * resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From d05b432354b16a661e989971eeb24da5eebd3e5a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 14:23:43 -0400 Subject: [PATCH 233/304] Add CHANGELOG entry. --- .changelog/25233.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/25233.txt diff --git a/.changelog/25233.txt b/.changelog/25233.txt new file mode 100644 index 000000000000..6cbb95413070 --- /dev/null +++ b/.changelog/25233.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_cloudwatch_event_target: The `ecs_target.propagate_tags` attribute now has no default value +``` \ No newline at end of file From 3b0a98211c302336874152d64410154d51d02d50 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 14:26:37 -0400 Subject: [PATCH 234/304] Update Terraform AWS Provider Version 5 Upgrade Guide. --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index f6aad2cb6510..74e53f0c6bd0 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -22,6 +22,7 @@ Upgrade topics: - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) +- [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) - [Resource: aws_ec2_client_vpn_network_association](#resource-aws_ec2_client_vpn_network_association) @@ -94,6 +95,10 @@ The `status` attribute is superfluous and sometimes incorrect. It has been remov The `threshold` attribute has been removed. +## Resource: aws_cloudwatch_event_target + +The `ecs_target.propagate_tags` attribute now has no default value. If no value is specified, the tags are not propagated. + ## Resource: aws_ec2_client_vpn_endpoint The `status` attribute has been removed. From 8ff343a91495eb6f0772c075e034948453362539 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 15:02:04 -0400 Subject: [PATCH 235/304] Fix typo. --- internal/service/events/target_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index 59e58642b62d..b53fb8340ac9 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -2315,7 +2315,7 @@ resource "aws_cloudwatch_event_target" "test" { role_arn = aws_iam_role.test.arn ecs_target { - task_definition_arn = aws_ecs_task_definition.test.arn + task_definition_arn = aws_ecs_task_definition.task.arn launch_type = "FARGATE" network_configuration { From 73d79d0ba00b5d9a9c1347bad20d647bc1de7158 Mon Sep 17 00:00:00 2001 From: nikhil Date: Sat, 2 Apr 2022 16:47:21 +0100 Subject: [PATCH 236/304] f/aws_ecs_capacity_provider --- internal/service/ecs/capacity_provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ecs/capacity_provider.go b/internal/service/ecs/capacity_provider.go index 3a34c684ee5d..923364b01fd8 100644 --- a/internal/service/ecs/capacity_provider.go +++ b/internal/service/ecs/capacity_provider.go @@ -66,7 +66,7 @@ func ResourceCapacityProvider() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: validation.IntBetween(1, 10000), + ValidateFunc: validation.IntBetween(0, 10000), }, "maximum_scaling_step_size": { Type: schema.TypeInt, From e1e09ce90477dc570f771056f8f95f0e4ec918dd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 2 Apr 2022 18:02:57 -0400 Subject: [PATCH 237/304] Add CHANGELOG entry. --- .changelog/24005.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/24005.txt diff --git a/.changelog/24005.txt b/.changelog/24005.txt new file mode 100644 index 000000000000..96bc7ab2e8c2 --- /dev/null +++ b/.changelog/24005.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_ecs_capacity_provider: Allow an `instance_warmup_period` of `0` in the `auto_scaling_group_provider.managed_scaling` configuration block +``` \ No newline at end of file From 13052e8c99f9ca8770c23f4fb4dd354bfdbbcfb3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 15:14:57 -0400 Subject: [PATCH 238/304] r/aws_ecs_capacity_provider: Allow 'instance_warmup_period' of 0. --- internal/service/ecs/capacity_provider.go | 22 +++++++++---------- .../service/ecs/capacity_provider_test.go | 14 ++++++++++++ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/internal/service/ecs/capacity_provider.go b/internal/service/ecs/capacity_provider.go index 923364b01fd8..9fd3e7f2b4e5 100644 --- a/internal/service/ecs/capacity_provider.go +++ b/internal/service/ecs/capacity_provider.go @@ -317,24 +317,24 @@ func expandManagedScaling(configured interface{}) *ecs.ManagedScaling { return nil } - p := configured.([]interface{})[0].(map[string]interface{}) + tfMap := configured.([]interface{})[0].(map[string]interface{}) managedScaling := ecs.ManagedScaling{} - if val, ok := p["instance_warmup_period"].(int); ok && val != 0 { - managedScaling.InstanceWarmupPeriod = aws.Int64(int64(val)) + if v, ok := tfMap["instance_warmup_period"].(int); ok { + managedScaling.InstanceWarmupPeriod = aws.Int64(int64(v)) } - if val, ok := p["maximum_scaling_step_size"].(int); ok && val != 0 { - managedScaling.MaximumScalingStepSize = aws.Int64(int64(val)) + if v, ok := tfMap["maximum_scaling_step_size"].(int); ok && v != 0 { + managedScaling.MaximumScalingStepSize = aws.Int64(int64(v)) } - if val, ok := p["minimum_scaling_step_size"].(int); ok && val != 0 { - managedScaling.MinimumScalingStepSize = aws.Int64(int64(val)) + if v, ok := tfMap["minimum_scaling_step_size"].(int); ok && v != 0 { + managedScaling.MinimumScalingStepSize = aws.Int64(int64(v)) } - if val, ok := p["status"].(string); ok && len(val) > 0 { - managedScaling.Status = aws.String(val) + if v, ok := tfMap["status"].(string); ok && len(v) > 0 { + managedScaling.Status = aws.String(v) } - if val, ok := p["target_capacity"].(int); ok && val != 0 { - managedScaling.TargetCapacity = aws.Int64(int64(val)) + if v, ok := tfMap["target_capacity"].(int); ok && v != 0 { + managedScaling.TargetCapacity = aws.Int64(int64(v)) } return &managedScaling diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index 3011579ce174..c1d073388af0 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -124,6 +124,20 @@ func TestAccECSCapacityProvider_managedScaling(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.target_capacity", "100"), ), }, + { + Config: testAccCapacityProviderConfig_managedScaling(rName, ecs.ManagedScalingStatusEnabled, 0, 100, 10, 100), + Check: resource.ComposeTestCheckFunc( + testAccCheckCapacityProviderExists(ctx, resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrPair(resourceName, "auto_scaling_group_provider.0.auto_scaling_group_arn", "aws_autoscaling_group.test", "arn"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_termination_protection", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.instance_warmup_period", "0"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.minimum_scaling_step_size", "10"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.maximum_scaling_step_size", "100"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.status", "ENABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.target_capacity", "100"), + ), + }, }, }) } From 06b869e62c69aeaab4749155886c89f35942fc19 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 15:25:20 -0400 Subject: [PATCH 239/304] r/aws_autoscaling_group: 'tags' -> 'tag' (#30842). --- internal/service/ecs/capacity_provider_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index c1d073388af0..fb8a925baa36 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -298,11 +298,11 @@ resource "aws_autoscaling_group" "test" { id = aws_launch_template.test.id } - tags = [{ + tag { key = "Name" value = %[1]q propagate_at_launch = true - }] + } } `, rName)) } From dd553e9da7050d163ee32c68b9fe0d54280804d3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 15:42:24 -0400 Subject: [PATCH 240/304] Ignore ASG 'tag' changes. --- internal/service/ecs/capacity_provider_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index fb8a925baa36..02745b79dbfb 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -303,6 +303,12 @@ resource "aws_autoscaling_group" "test" { value = %[1]q propagate_at_launch = true } + + lifecycle { + ignore_changes = [ + tag, + ] + } } `, rName)) } From 6142973a4a79c47df3cf93929de67a307bf711ae Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 15:43:55 -0400 Subject: [PATCH 241/304] This change is not breaking. --- .changelog/24005.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/24005.txt b/.changelog/24005.txt index 96bc7ab2e8c2..3de3d36c6013 100644 --- a/.changelog/24005.txt +++ b/.changelog/24005.txt @@ -1,3 +1,3 @@ -```release-note:breaking-change +```release-note:bug resource/aws_ecs_capacity_provider: Allow an `instance_warmup_period` of `0` in the `auto_scaling_group_provider.managed_scaling` configuration block ``` \ No newline at end of file From 53a4bc6bc8102172f6cfdcb1c2e6e37cb3724e01 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 5 May 2023 20:15:09 +0000 Subject: [PATCH 242/304] Update CHANGELOG.md for #31231 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3460c85ecc5f..16c484fd1a05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ BREAKING CHANGES: * resource/aws_autoscaling_attachment: `alb_target_group_arn` has been removed -- use `lb_target_group_arn` instead ([#30828](https://github.com/hashicorp/terraform-provider-aws/issues/30828)) * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_ce_anomaly_subscription: The `threshold` attribute has been removed ([#30374](https://github.com/hashicorp/terraform-provider-aws/issues/30374)) +* resource/aws_cloudwatch_event_target: The `ecs_target.propagate_tags` attribute now has no default value ([#25233](https://github.com/hashicorp/terraform-provider-aws/issues/25233)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed ([#30452](https://github.com/hashicorp/terraform-provider-aws/issues/30452)) @@ -87,6 +88,7 @@ ENHANCEMENTS: BUG FIXES: +* resource/aws_ecs_capacity_provider: Allow an `instance_warmup_period` of `0` in the `auto_scaling_group_provider.managed_scaling` configuration block ([#24005](https://github.com/hashicorp/terraform-provider-aws/issues/24005)) * resource/aws_servicecatalog_product: Changes to `provisioning_artifact_parameters` arguments now properly trigger a replacement ([#31061](https://github.com/hashicorp/terraform-provider-aws/issues/31061)) * resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual` ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) From b843159928cbb2d85c9653a794df8d0565278879 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 16:21:07 -0400 Subject: [PATCH 243/304] ssmincidents: Generate 'UpdateTags'. --- internal/service/ssmincidents/generate.go | 2 +- internal/service/ssmincidents/tags_gen.go | 48 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/internal/service/ssmincidents/generate.go b/internal/service/ssmincidents/generate.go index bfc88b9ae343..b8a40acb2372 100644 --- a/internal/service/ssmincidents/generate.go +++ b/internal/service/ssmincidents/generate.go @@ -1,4 +1,4 @@ -//go:generate go run ../../generate/tags/main.go -AWSSDKVersion=2 -TagInIDElem=ResourceArn -ListTags -ListTagsInIDElem=ResourceArn -ServiceTagsMap -KVTValues -SkipTypesImp +//go:generate go run ../../generate/tags/main.go -AWSSDKVersion=2 -TagInIDElem=ResourceArn -ListTags -ListTagsInIDElem=ResourceArn -ServiceTagsMap -UpdateTags -KVTValues -SkipTypesImp // ONLY generate directives and package declaration! Do not add anything else to this file. package ssmincidents diff --git a/internal/service/ssmincidents/tags_gen.go b/internal/service/ssmincidents/tags_gen.go index f25ae10b5528..21b840e1ebf5 100644 --- a/internal/service/ssmincidents/tags_gen.go +++ b/internal/service/ssmincidents/tags_gen.go @@ -3,12 +3,14 @@ package ssmincidents import ( "context" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssmincidents" "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/types" + "github.com/hashicorp/terraform-provider-aws/names" ) // ListTags lists ssmincidents service tags. @@ -74,3 +76,49 @@ func SetTagsOut(ctx context.Context, tags map[string]string) { inContext.TagsOut = types.Some(KeyValueTags(ctx, tags)) } } + +// UpdateTags updates ssmincidents service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func UpdateTags(ctx context.Context, conn *ssmincidents.Client, identifier string, oldTagsMap, newTagsMap any) error { + oldTags := tftags.New(ctx, oldTagsMap) + newTags := tftags.New(ctx, newTagsMap) + + removedTags := oldTags.Removed(newTags) + removedTags = removedTags.IgnoreSystem(names.SSMIncidents) + if len(removedTags) > 0 { + input := &ssmincidents.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: removedTags.Keys(), + } + + _, err := conn.UntagResource(ctx, input) + + if err != nil { + return fmt.Errorf("untagging resource (%s): %w", identifier, err) + } + } + + updatedTags := oldTags.Updated(newTags) + updatedTags = updatedTags.IgnoreSystem(names.SSMIncidents) + if len(updatedTags) > 0 { + input := &ssmincidents.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: Tags(updatedTags), + } + + _, err := conn.TagResource(ctx, input) + + if err != nil { + return fmt.Errorf("tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// UpdateTags updates ssmincidents service tags. +// It is called from outside this package. +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SSMIncidentsClient(), identifier, oldTags, newTags) +} From 82b11be53c47fe0588a5798d287662e813a09b69 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 16:24:00 -0400 Subject: [PATCH 244/304] ssmincidents: Use generated 'UpdateTags'. --- .../service/ssmincidents/replication_set.go | 9 --- .../service/ssmincidents/response_plan.go | 7 -- internal/service/ssmincidents/tags.go | 80 ------------------- 3 files changed, 96 deletions(-) delete mode 100644 internal/service/ssmincidents/tags.go diff --git a/internal/service/ssmincidents/replication_set.go b/internal/service/ssmincidents/replication_set.go index 8554d1fc4ca8..82a2c83d41d5 100644 --- a/internal/service/ssmincidents/replication_set.go +++ b/internal/service/ssmincidents/replication_set.go @@ -186,15 +186,6 @@ func resourceReplicationSetUpdate(ctx context.Context, d *schema.ResourceData, m } } - // tags_all does not detect changes when tag value is "" while this change is detected by tags - if d.HasChanges("tags_all", "tags") { - log.Printf("[DEBUG] Updating SSMIncidents ReplicationSet tags") - - if err := updateResourceTags(ctx, client, d); err != nil { - return create.DiagError(names.SSMIncidents, create.ErrActionUpdating, ResNameReplicationSet, d.Id(), err) - } - } - return resourceReplicationSetRead(ctx, d, meta) } diff --git a/internal/service/ssmincidents/response_plan.go b/internal/service/ssmincidents/response_plan.go index cf7bf01414df..fb89aae1eec8 100644 --- a/internal/service/ssmincidents/response_plan.go +++ b/internal/service/ssmincidents/response_plan.go @@ -282,13 +282,6 @@ func resourceResponsePlanUpdate(ctx context.Context, d *schema.ResourceData, met } } - // tags can have a change without tags_all having a change when value of tag is "" - if d.HasChanges("tags_all", "tags") { - if err := updateResourceTags(ctx, client, d); err != nil { - return create.DiagError(names.SSMIncidents, create.ErrActionUpdating, ResNameResponsePlan, d.Id(), err) - } - } - return resourceResponsePlanRead(ctx, d, meta) } diff --git a/internal/service/ssmincidents/tags.go b/internal/service/ssmincidents/tags.go deleted file mode 100644 index 40b7c3bbef59..000000000000 --- a/internal/service/ssmincidents/tags.go +++ /dev/null @@ -1,80 +0,0 @@ -package ssmincidents - -import ( - "context" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/ssmincidents" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-provider-aws/internal/flex" - tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" -) - -// makes api calls to update Resource Data Tags -func updateResourceTags(context context.Context, client *ssmincidents.Client, d *schema.ResourceData) error { - old, new := d.GetChange("tags_all") - - oldTags := tftags.New(context, old) - newTags := tftags.New(context, new) - - allNewTagsMap := flex.ExpandStringValueMap(new.(map[string]interface{})) - - if err := updateResourceTag(context, client, d.Id(), oldTags.Removed(newTags), oldTags.Updated(newTags)); err != nil { - return err - } - - // provider level tags cannot have "" as value - // resource level tags can have "" as value but this change is not recorded by d.GetChange("tags_all") - // so we have to look specifically for any tags updated with "" as the value - - old, new = d.GetChange("tags") - - oldTags = tftags.New(context, old) - newTags = tftags.New(context, new) - - toUpdate := make(map[string]string) - - for k, v := range oldTags.Updated(newTags).Map() { - if v == "" { - toUpdate[k] = v - allNewTagsMap[k] = v - } - } - - // since we are adding an extra tag to tags_all not initially detected by terraform - // we must set tags_all to what is properly expected in create/update function so that - // terraform plan is consistent to what we receive with terraform refresh/the update function - d.Set("tags_all", allNewTagsMap) - - empty := tftags.KeyValueTags{} - if err := updateResourceTag(context, client, d.Id(), empty, tftags.New(context, toUpdate)); err != nil { - return err - } - - return nil -} - -func updateResourceTag(context context.Context, client *ssmincidents.Client, arn string, removedTags, addedTags tftags.KeyValueTags) error { - if len(removedTags) > 0 { - input := &ssmincidents.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: removedTags.Keys(), - } - if _, err := client.UntagResource(context, input); err != nil { - return err - } - } - - if len(addedTags) > 0 { - input := &ssmincidents.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: addedTags.IgnoreAWS().Map(), - } - - if _, err := client.TagResource(context, input); err != nil { - return err - } - } - - return nil -} From 3650f9a4694b426d807aa221d2ff34149dbf50d1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 17:46:40 -0400 Subject: [PATCH 245/304] Remove 'skip_get_ec2_platforms' from acceptance test configurations. --- internal/acctest/acctest.go | 3 --- internal/provider/provider_acc_test.go | 13 ------------- 2 files changed, 16 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index a156b4724f2d..140d4ffde8cd 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -1473,7 +1473,6 @@ func ConfigDefaultTags_Tags0() string { ` provider "aws" { skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1493,7 +1492,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1514,7 +1512,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } diff --git a/internal/provider/provider_acc_test.go b/internal/provider/provider_acc_test.go index f364ada3badf..e8863fde64cf 100644 --- a/internal/provider/provider_acc_test.go +++ b/internal/provider/provider_acc_test.go @@ -866,7 +866,6 @@ func testAccProviderConfig_endpoints(endpoints string) string { return acctest.ConfigCompose(testAccProviderConfig_base, fmt.Sprintf(` provider "aws" { skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true @@ -903,7 +902,6 @@ func testAccProviderConfig_unusualEndpoints(unusual1, unusual2, unusual3 unusual return acctest.ConfigCompose(testAccProviderConfig_base, fmt.Sprintf(` provider "aws" { skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true @@ -921,7 +919,6 @@ func testAccProviderConfig_ignoreTagsKeys0() string { return acctest.ConfigCompose(testAccProviderConfig_base, ` provider "aws" { skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -937,7 +934,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -953,7 +949,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -965,7 +960,6 @@ func testAccProviderConfig_ignoreTagsKeyPrefixes0() string { return acctest.ConfigCompose(testAccProviderConfig_base, ` provider "aws" { skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -981,7 +975,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -997,7 +990,6 @@ provider "aws" { } skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1011,7 +1003,6 @@ provider "aws" { default_tags {} skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1026,7 +1017,6 @@ provider "aws" { ignore_tags {} skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1040,7 +1030,6 @@ provider "aws" { ignore_tags {} skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1053,7 +1042,6 @@ func testAccProviderConfig_region(region string) string { provider "aws" { region = %[1]q skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } @@ -1067,7 +1055,6 @@ provider "aws" { region = %[1]q sts_region = %[2]q skip_credentials_validation = true - skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } From c796c2403415a58975227f5da6b1f5d626d23090 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 5 May 2023 17:57:31 -0400 Subject: [PATCH 246/304] Remove 'aws_s3_bucket_acl' from acceptance test configuration. --- internal/provider/provider_acc_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/provider/provider_acc_test.go b/internal/provider/provider_acc_test.go index e8863fde64cf..eaaef55e6d75 100644 --- a/internal/provider/provider_acc_test.go +++ b/internal/provider/provider_acc_test.go @@ -889,11 +889,6 @@ resource "aws_s3_bucket" "test" { bucket = %[2]q force_destroy = true } - -resource "aws_s3_bucket_acl" "test" { - bucket = aws_s3_bucket.test.id - acl = "private" -} `, endpoint, rName)) } From 5db08243309559db7e29cf7a0ec09b293cc05bcf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 8 May 2023 07:47:21 -0400 Subject: [PATCH 247/304] Serialize ALL ssmincidents acceptance tests. --- .../ssmincidents_replication_set_test.go | 28 ------------------- ...onse_plan_test.go => ssmincidents_test.go} | 13 ++++++++- 2 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 internal/service/ssmincidents/ssmincidents_replication_set_test.go rename internal/service/ssmincidents/{ssmincidents_response_plan_test.go => ssmincidents_test.go} (66%) diff --git a/internal/service/ssmincidents/ssmincidents_replication_set_test.go b/internal/service/ssmincidents/ssmincidents_replication_set_test.go deleted file mode 100644 index a95c85e1c1bd..000000000000 --- a/internal/service/ssmincidents/ssmincidents_replication_set_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package ssmincidents_test - -import ( - "testing" - - "github.com/hashicorp/terraform-provider-aws/internal/acctest" -) - -// only one replication set resource can be active at once, so we must have serialised tests -func TestAccSSMIncidentsReplicationSet_serial(t *testing.T) { - t.Parallel() - - testCases := map[string]map[string]func(t *testing.T){ - "Replication Set Resource Tests": { - "basic": testReplicationSet_basic, - "updateDefaultKey": testReplicationSet_updateRegionsWithoutCMK, - "updateCMK": testReplicationSet_updateRegionsWithCMK, - "updateTags": testReplicationSet_updateTags, - "updateEmptyTags": testReplicationSet_updateEmptyTags, - "disappears": testReplicationSet_disappears, - }, - "Replication Set Data Source Tests": { - "basic": testReplicationSetDataSource_basic, - }, - } - - acctest.RunSerialTests2Levels(t, testCases, 0) -} diff --git a/internal/service/ssmincidents/ssmincidents_response_plan_test.go b/internal/service/ssmincidents/ssmincidents_test.go similarity index 66% rename from internal/service/ssmincidents/ssmincidents_response_plan_test.go rename to internal/service/ssmincidents/ssmincidents_test.go index 3cb967dbef04..6458dddadd14 100644 --- a/internal/service/ssmincidents/ssmincidents_response_plan_test.go +++ b/internal/service/ssmincidents/ssmincidents_test.go @@ -7,10 +7,21 @@ import ( ) // only one replication set resource can be active at once, so we must have serialised tests -func TestAccSSMIncidentsResponsePlan_serial(t *testing.T) { +func TestAccSSMIncidents_serial(t *testing.T) { t.Parallel() testCases := map[string]map[string]func(t *testing.T){ + "Replication Set Resource Tests": { + "basic": testReplicationSet_basic, + "updateDefaultKey": testReplicationSet_updateRegionsWithoutCMK, + "updateCMK": testReplicationSet_updateRegionsWithCMK, + "updateTags": testReplicationSet_updateTags, + "updateEmptyTags": testReplicationSet_updateEmptyTags, + "disappears": testReplicationSet_disappears, + }, + "Replication Set Data Source Tests": { + "basic": testReplicationSetDataSource_basic, + }, "Response Plan Resource Tests": { "basic": testResponsePlan_basic, "update": testResponsePlan_updateRequiredFields, From c93a102e24dc6706064aac6d48af0744849b7848 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 8 May 2023 07:51:10 -0400 Subject: [PATCH 248/304] ssmincidents: Tidy up acceptance test configurations. --- .../ssmincidents/replication_set_test.go | 16 +++--- .../ssmincidents/response_plan_test.go | 50 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/internal/service/ssmincidents/replication_set_test.go b/internal/service/ssmincidents/replication_set_test.go index 3ca4170cb701..a50e37ccaf12 100644 --- a/internal/service/ssmincidents/replication_set_test.go +++ b/internal/service/ssmincidents/replication_set_test.go @@ -526,24 +526,24 @@ resource "aws_ssmincidents_replication_set" "test" { `, tag1Key, tag1Val, tag2Key, tag2Val, acctest.Region()) } -func testAccReplicationSetConfigBaseKeyDefaultRegion() string { +func testAccReplicationSetConfig_baseKeyDefaultRegion() string { return ` resource "aws_kms_key" "default" {} ` } -func testAccReplicationSetConfigBaseKeyAlternateRegion() string { - return acctest.ConfigMultipleRegionProvider(2) + ` +func testAccReplicationSetConfig_baseKeyAlternateRegion() string { + return acctest.ConfigCompose(acctest.ConfigMultipleRegionProvider(2), ` resource "aws_kms_key" "alternate" { provider = awsalternate } -` +`) } func testAccReplicationSetConfig_oneRegionWithCMK() string { return acctest.ConfigCompose( - testAccReplicationSetConfigBaseKeyDefaultRegion(), - testAccReplicationSetConfigBaseKeyAlternateRegion(), + testAccReplicationSetConfig_baseKeyDefaultRegion(), + testAccReplicationSetConfig_baseKeyAlternateRegion(), fmt.Sprintf(` resource "aws_ssmincidents_replication_set" "test" { region { @@ -556,8 +556,8 @@ resource "aws_ssmincidents_replication_set" "test" { func testAccReplicationSetConfig_twoRegionWithCMK() string { return acctest.ConfigCompose( - testAccReplicationSetConfigBaseKeyDefaultRegion(), - testAccReplicationSetConfigBaseKeyAlternateRegion(), + testAccReplicationSetConfig_baseKeyDefaultRegion(), + testAccReplicationSetConfig_baseKeyAlternateRegion(), fmt.Sprintf(` resource "aws_ssmincidents_replication_set" "test" { region { diff --git a/internal/service/ssmincidents/response_plan_test.go b/internal/service/ssmincidents/response_plan_test.go index f88fd7b7910f..c981d3f2e974 100644 --- a/internal/service/ssmincidents/response_plan_test.go +++ b/internal/service/ssmincidents/response_plan_test.go @@ -904,7 +904,7 @@ func testAccCheckResponsePlanExists(name string) resource.TestCheckFunc { } } -func testAccResponsePlanConfigBase() string { +func testAccResponsePlanConfig_base() string { return fmt.Sprintf(` resource "aws_ssmincidents_replication_set" "test_replication_set" { region { @@ -914,7 +914,7 @@ resource "aws_ssmincidents_replication_set" "test_replication_set" { `, acctest.Region()) } -func testAccResponsePlanConfigSNSTopicBase() string { +func testAccResponsePlanConfig_baseSNSTopic() string { return ` resource "aws_sns_topic" "topic1" {} resource "aws_sns_topic" "topic2" {} @@ -924,7 +924,7 @@ resource "aws_sns_topic" "topic3" {} func testAccResponsePlanConfig_basic(name, title, impact string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -941,13 +941,13 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_none() string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), ) } func testAccResponsePlanConfig_oneTag(name, title, tagKey, tagVal string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -968,7 +968,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_twoTags(name, title, tag1Key, tag1Val, tag2Key, tag2Val string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -990,8 +990,8 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_incidentTemplateOptionalFields(name, title, dedupeString, summary, tagKey, tagVal, snsTopic1, snsTopic2 string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), - testAccResponsePlanConfigSNSTopicBase(), + testAccResponsePlanConfig_base(), + testAccResponsePlanConfig_baseSNSTopic(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1022,7 +1022,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_displayName(name, displayName string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1041,8 +1041,8 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_chatChannel(name, chatChannelTopic string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), - testAccResponsePlanConfigSNSTopicBase(), + testAccResponsePlanConfig_base(), + testAccResponsePlanConfig_baseSNSTopic(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1061,8 +1061,8 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_twoChatChannels(name, chatChannelOneTopic, chatChannelTwoTopic string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), - testAccResponsePlanConfigSNSTopicBase(), + testAccResponsePlanConfig_base(), + testAccResponsePlanConfig_baseSNSTopic(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1081,7 +1081,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_emptyChatChannel(name string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1100,7 +1100,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_engagement(name, contactArn string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1119,7 +1119,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_twoEngagements(name, contactArn1, contactArn2 string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1138,7 +1138,7 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_emptyEngagements(name string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), + testAccResponsePlanConfig_base(), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1157,9 +1157,9 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_action1(name string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), - testAccResponsePlanConfigIAMRoleBase(name), - testAccResponsePlanConfigDocumentBase(name), + testAccResponsePlanConfig_base(), + testAccResponsePlanConfig_baseIAMRole(name), + testAccResponsePlanConfig_baseSSMDocument(name), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1192,9 +1192,9 @@ resource "aws_ssmincidents_response_plan" "test" { func testAccResponsePlanConfig_action2(name string) string { return acctest.ConfigCompose( - testAccResponsePlanConfigBase(), - testAccResponsePlanConfigIAMRoleBase(name), - testAccResponsePlanConfigDocumentBase(name), + testAccResponsePlanConfig_base(), + testAccResponsePlanConfig_baseIAMRole(name), + testAccResponsePlanConfig_baseSSMDocument(name), fmt.Sprintf(` resource "aws_ssmincidents_response_plan" "test" { name = %[1]q @@ -1225,7 +1225,7 @@ resource "aws_ssmincidents_response_plan" "test" { `, name)) } -func testAccResponsePlanConfigIAMRoleBase(name string) string { +func testAccResponsePlanConfig_baseIAMRole(name string) string { return fmt.Sprintf(` resource "aws_iam_role" "role1" { assume_role_policy = < Date: Thu, 4 May 2023 10:46:48 -0700 Subject: [PATCH 249/304] Moves acceptance tests to `terraform-plugin-testing` --- docs/adding-a-tag-resource.md | 4 +-- docs/retries-and-waiters.md | 2 +- docs/running-and-writing-acceptance-tests.md | 2 +- go.mod | 3 +- go.sum | 6 ++-- internal/acctest/acctest.go | 28 ++++++++++++------- internal/acctest/framework.go | 4 +-- internal/acctest/vcr.go | 4 +-- internal/generate/sweepimp/file.tmpl | 2 +- internal/generate/tagresource/tests.tmpl | 4 +-- .../tags/templates/v2/header_body.tmpl | 2 +- internal/provider/provider_acc_test.go | 6 ++-- .../service/accessanalyzer/analyzer_test.go | 6 ++-- .../accessanalyzer/archive_rule_test.go | 6 ++-- internal/service/accessanalyzer/sweep.go | 8 +++--- .../service/account/alternate_contact_test.go | 6 ++-- .../service/account/primary_contact_test.go | 6 ++-- .../acm/certificate_data_source_test.go | 4 +-- internal/service/acm/certificate_test.go | 4 +-- .../acm/certificate_validation_test.go | 4 +-- internal/service/acm/sweep.go | 2 +- .../certificate_authority_certificate_test.go | 4 +-- .../certificate_authority_data_source_test.go | 2 +- .../acmpca/certificate_authority_test.go | 6 ++-- .../acmpca/certificate_data_source_test.go | 2 +- internal/service/acmpca/certificate_test.go | 4 +-- internal/service/acmpca/permission_test.go | 4 +-- internal/service/acmpca/policy_test.go | 4 +-- internal/service/acmpca/sweep.go | 2 +- .../amp/alert_manager_definition_test.go | 4 +-- .../service/amp/rule_group_namespace_test.go | 4 +-- .../service/amp/workspace_data_source_test.go | 4 +-- internal/service/amp/workspace_test.go | 6 ++-- .../amp/workspaces_data_source_test.go | 4 +-- internal/service/amplify/app_test.go | 6 ++-- .../amplify/backend_environment_test.go | 6 ++-- internal/service/amplify/branch_test.go | 6 ++-- .../amplify/domain_association_test.go | 6 ++-- internal/service/amplify/sweep.go | 2 +- internal/service/amplify/webhook_test.go | 6 ++-- internal/service/apigateway/account_test.go | 4 +-- .../apigateway/api_key_data_source_test.go | 4 +-- internal/service/apigateway/api_key_test.go | 6 ++-- .../apigateway/authorizer_data_source_test.go | 4 +-- .../service/apigateway/authorizer_test.go | 6 ++-- .../authorizers_data_source_test.go | 4 +-- .../apigateway/base_path_mapping_test.go | 4 +-- .../apigateway/client_certificate_test.go | 4 +-- .../service/apigateway/deployment_test.go | 6 ++-- .../apigateway/documentation_part_test.go | 6 ++-- .../apigateway/documentation_version_test.go | 6 ++-- .../domain_name_data_source_test.go | 2 +- .../service/apigateway/domain_name_test.go | 6 ++-- .../service/apigateway/errorcheck_test.go | 2 +- .../apigateway/export_data_source_test.go | 4 +-- .../apigateway/gateway_response_test.go | 6 ++-- .../apigateway/integration_response_test.go | 6 ++-- .../service/apigateway/integration_test.go | 6 ++-- .../apigateway/method_response_test.go | 6 ++-- .../apigateway/method_settings_test.go | 6 ++-- internal/service/apigateway/method_test.go | 6 ++-- internal/service/apigateway/model_test.go | 6 ++-- .../apigateway/request_validator_test.go | 6 ++-- .../apigateway/resource_data_source_test.go | 4 +-- internal/service/apigateway/resource_test.go | 6 ++-- .../apigateway/rest_api_data_source_test.go | 4 +-- .../apigateway/rest_api_policy_test.go | 6 ++-- internal/service/apigateway/rest_api_test.go | 6 ++-- .../apigateway/sdk_data_source_test.go | 4 +-- internal/service/apigateway/stage_test.go | 6 ++-- internal/service/apigateway/sweep.go | 2 +- .../service/apigateway/usage_plan_key_test.go | 6 ++-- .../service/apigateway/usage_plan_test.go | 6 ++-- .../apigateway/vpc_link_data_source_test.go | 4 +-- internal/service/apigateway/vpc_link_test.go | 6 ++-- .../apigatewayv2/api_data_source_test.go | 4 +-- .../service/apigatewayv2/api_mapping_test.go | 6 ++-- internal/service/apigatewayv2/api_test.go | 6 ++-- .../apigatewayv2/apis_data_source_test.go | 4 +-- .../service/apigatewayv2/authorizer_test.go | 6 ++-- .../service/apigatewayv2/deployment_test.go | 6 ++-- .../service/apigatewayv2/domain_name_test.go | 6 ++-- .../service/apigatewayv2/errorcheck_test.go | 2 +- .../apigatewayv2/export_data_source_test.go | 4 +-- .../apigatewayv2/integration_response_test.go | 6 ++-- .../service/apigatewayv2/integration_test.go | 6 ++-- internal/service/apigatewayv2/model_test.go | 6 ++-- .../apigatewayv2/route_response_test.go | 6 ++-- internal/service/apigatewayv2/route_test.go | 6 ++-- internal/service/apigatewayv2/stage_test.go | 6 ++-- internal/service/apigatewayv2/sweep.go | 2 +- .../service/apigatewayv2/vpc_link_test.go | 6 ++-- .../service/appautoscaling/policy_test.go | 6 ++-- .../appautoscaling/scheduled_action_test.go | 6 ++-- .../service/appautoscaling/target_test.go | 6 ++-- .../service/appconfig/application_test.go | 6 ++-- .../configuration_profile_data_source_test.go | 4 +-- .../appconfig/configuration_profile_test.go | 6 ++-- ...configuration_profiles_data_source_test.go | 4 +-- .../appconfig/deployment_strategy_test.go | 6 ++-- internal/service/appconfig/deployment_test.go | 6 ++-- .../appconfig/environment_data_source_test.go | 4 +-- .../service/appconfig/environment_test.go | 6 ++-- .../environments_data_source_test.go | 4 +-- internal/service/appconfig/extension_test.go | 6 ++-- .../appconfig/extenstion_association_test.go | 6 ++-- .../hosted_configuration_version_test.go | 6 ++-- internal/service/appconfig/sweep.go | 2 +- .../service/appflow/connector_profile_test.go | 6 ++-- internal/service/appflow/flow_test.go | 6 ++-- .../appintegrations/data_integration_test.go | 6 ++-- .../event_integration_data_source_test.go | 4 +-- .../appintegrations/event_integration_test.go | 6 ++-- .../applicationinsights/application_test.go | 6 ++-- internal/service/applicationinsights/sweep.go | 2 +- .../appmesh/gateway_route_data_source_test.go | 4 +-- .../service/appmesh/gateway_route_test.go | 6 ++-- .../service/appmesh/mesh_data_source_test.go | 4 +-- internal/service/appmesh/mesh_test.go | 6 ++-- .../service/appmesh/route_data_source_test.go | 4 +-- internal/service/appmesh/route_test.go | 6 ++-- internal/service/appmesh/sweep.go | 2 +- .../virtual_gateway_data_source_test.go | 4 +-- .../service/appmesh/virtual_gateway_test.go | 6 ++-- .../appmesh/virtual_node_data_source_test.go | 4 +-- internal/service/appmesh/virtual_node_test.go | 6 ++-- .../virtual_router_data_source_test.go | 4 +-- .../service/appmesh/virtual_router_test.go | 6 ++-- .../virtual_service_data_source_test.go | 4 +-- .../service/appmesh/virtual_service_test.go | 6 ++-- ...auto_scaling_configuration_version_test.go | 6 ++-- internal/service/apprunner/connection_test.go | 6 ++-- .../custom_domain_association_test.go | 6 ++-- ...bservability_configuration_version_test.go | 6 ++-- internal/service/apprunner/service_test.go | 6 ++-- internal/service/apprunner/sweep.go | 2 +- .../service/apprunner/vpc_connector_test.go | 6 ++-- .../apprunner/vpc_ingress_connection_test.go | 6 ++-- .../appstream/directory_config_test.go | 6 ++-- .../appstream/fleet_stack_association_test.go | 6 ++-- internal/service/appstream/fleet_test.go | 6 ++-- .../service/appstream/image_builder_test.go | 6 ++-- internal/service/appstream/stack_test.go | 6 ++-- internal/service/appstream/sweep.go | 2 +- .../appstream/user_stack_association_test.go | 6 ++-- internal/service/appstream/user_test.go | 4 +-- internal/service/appsync/api_cache_test.go | 6 ++-- internal/service/appsync/api_key_test.go | 6 ++-- internal/service/appsync/datasource_test.go | 6 ++-- .../domain_name_api_association_test.go | 6 ++-- internal/service/appsync/domain_name_test.go | 6 ++-- internal/service/appsync/function_test.go | 6 ++-- internal/service/appsync/graphql_api_test.go | 6 ++-- internal/service/appsync/resolver_test.go | 6 ++-- internal/service/appsync/sweep.go | 2 +- internal/service/appsync/type_test.go | 6 ++-- internal/service/athena/data_catalog_test.go | 6 ++-- internal/service/athena/database_test.go | 6 ++-- internal/service/athena/named_query_test.go | 6 ++-- internal/service/athena/sweep.go | 2 +- internal/service/athena/workgroup_test.go | 6 ++-- .../auditmanager/account_registration_test.go | 4 +-- .../assessment_delegation_test.go | 6 ++-- .../auditmanager/assessment_report_test.go | 6 ++-- .../service/auditmanager/assessment_test.go | 6 ++-- .../auditmanager/control_data_source_test.go | 4 +-- internal/service/auditmanager/control_test.go | 6 ++-- .../framework_data_source_test.go | 4 +-- .../auditmanager/framework_share_test.go | 6 ++-- .../service/auditmanager/framework_test.go | 6 ++-- ...ization_admin_account_registration_test.go | 4 +-- internal/service/auditmanager/sweep.go | 2 +- .../service/autoscaling/attachment_test.go | 6 ++-- .../autoscaling/group_data_source_test.go | 4 +-- .../service/autoscaling/group_tag_test.go | 4 +-- internal/service/autoscaling/group_test.go | 6 ++-- .../autoscaling/groups_data_source_test.go | 4 +-- .../launch_configuration_data_source_test.go | 4 +-- .../autoscaling/launch_configuration_test.go | 6 ++-- .../autoscaling/lifecycle_hook_test.go | 6 ++-- .../service/autoscaling/notification_test.go | 6 ++-- internal/service/autoscaling/policy_test.go | 6 ++-- internal/service/autoscaling/schedule_test.go | 6 ++-- internal/service/autoscaling/sweep.go | 2 +- .../autoscalingplans/scaling_plan_test.go | 6 ++-- internal/service/autoscalingplans/sweep.go | 2 +- .../backup/framework_data_source_test.go | 4 +-- internal/service/backup/framework_test.go | 6 ++-- .../service/backup/global_settings_test.go | 4 +-- .../service/backup/plan_data_source_test.go | 4 +-- internal/service/backup/plan_test.go | 6 ++-- .../service/backup/region_settings_test.go | 4 +-- .../backup/report_plan_data_source_test.go | 4 +-- internal/service/backup/report_plan_test.go | 6 ++-- .../backup/selection_data_source_test.go | 4 +-- internal/service/backup/selection_test.go | 6 ++-- internal/service/backup/sweep.go | 2 +- .../service/backup/vault_data_source_test.go | 4 +-- .../backup/vault_lock_configuration_test.go | 6 ++-- .../backup/vault_notifications_test.go | 6 ++-- internal/service/backup/vault_policy_test.go | 6 ++-- internal/service/backup/vault_test.go | 6 ++-- .../compute_environment_data_source_test.go | 4 +-- .../service/batch/compute_environment_test.go | 6 ++-- internal/service/batch/job_definition_test.go | 6 ++-- .../batch/job_queue_data_source_test.go | 4 +-- internal/service/batch/job_queue_test.go | 6 ++-- .../scheduling_policy_data_source_test.go | 4 +-- .../service/batch/scheduling_policy_test.go | 6 ++-- internal/service/batch/sweep.go | 2 +- .../service/budgets/budget_action_test.go | 6 ++-- internal/service/budgets/budget_test.go | 6 ++-- internal/service/budgets/sweep.go | 2 +- internal/service/ce/anomaly_monitor_test.go | 6 ++-- .../service/ce/anomaly_subscription_test.go | 6 ++-- .../service/ce/cost_allocation_tag_test.go | 4 +-- .../ce/cost_category_data_source_test.go | 4 +-- internal/service/ce/cost_category_test.go | 6 ++-- internal/service/ce/tags_data_source_test.go | 4 +-- .../chime/voice_connector_group_test.go | 6 ++-- .../chime/voice_connector_logging_test.go | 6 ++-- .../chime/voice_connector_origination_test.go | 6 ++-- .../chime/voice_connector_streaming_test.go | 6 ++-- ..._connector_termination_credentials_test.go | 6 ++-- .../chime/voice_connector_termination_test.go | 6 ++-- .../service/chime/voice_connector_test.go | 6 ++-- ...ia_insights_pipeline_configuration_test.go | 6 ++-- .../voice_profile_domain_test.go | 6 ++-- .../service/cloud9/environment_ec2_test.go | 6 ++-- .../cloud9/environment_membership_test.go | 6 ++-- internal/service/cloud9/sweep.go | 2 +- .../cloudcontrol/resource_data_source_test.go | 4 +-- .../service/cloudcontrol/resource_test.go | 6 ++-- .../cloudformation/export_data_source_test.go | 4 +-- .../cloudformation/stack_data_source_test.go | 4 +-- .../cloudformation/stack_set_instance_test.go | 6 ++-- .../service/cloudformation/stack_set_test.go | 6 ++-- internal/service/cloudformation/stack_test.go | 6 ++-- internal/service/cloudformation/sweep.go | 2 +- .../cloudformation/type_data_source_test.go | 4 +-- internal/service/cloudformation/type_test.go | 6 ++-- .../cache_policy_data_source_test.go | 4 +-- .../service/cloudfront/cache_policy_test.go | 6 ++-- .../distribution_data_source_test.go | 2 +- .../service/cloudfront/distribution_test.go | 6 ++-- .../field_level_encryption_config_test.go | 6 ++-- .../field_level_encryption_profile_test.go | 6 ++-- .../cloudfront/function_data_source_test.go | 4 +-- internal/service/cloudfront/function_test.go | 6 ++-- internal/service/cloudfront/key_group_test.go | 6 ++-- ...very_canonical_user_id_data_source_test.go | 2 +- .../monitoring_subscription_test.go | 4 +-- .../cloudfront/origin_access_control_test.go | 6 ++-- ...igin_access_identities_data_source_test.go | 4 +-- ...origin_access_identity_data_source_test.go | 2 +- .../cloudfront/origin_access_identity_test.go | 4 +-- .../origin_request_policy_data_source_test.go | 4 +-- .../cloudfront/origin_request_policy_test.go | 6 ++-- .../service/cloudfront/public_key_test.go | 6 ++-- .../realtime_log_config_data_source_test.go | 4 +-- .../cloudfront/realtime_log_config_test.go | 6 ++-- ...esponse_headers_policy_data_source_test.go | 4 +-- .../response_headers_policy_test.go | 6 ++-- internal/service/cloudfront/sweep.go | 2 +- internal/service/cloudfront/validate_test.go | 2 +- .../cloudhsmv2/cluster_data_source_test.go | 4 +-- internal/service/cloudhsmv2/cluster_test.go | 6 ++-- internal/service/cloudhsmv2/hsm_test.go | 6 ++-- internal/service/cloudhsmv2/sweep.go | 2 +- .../domain_service_access_policy_test.go | 6 ++-- internal/service/cloudsearch/domain_test.go | 6 ++-- internal/service/cloudsearch/sweep.go | 2 +- .../service/cloudtrail/cloudtrail_test.go | 6 ++-- .../cloudtrail/event_data_store_test.go | 6 ++-- .../service_account_data_source_test.go | 2 +- internal/service/cloudtrail/sweep.go | 2 +- .../cloudwatch/composite_alarm_test.go | 6 ++-- internal/service/cloudwatch/dashboard_test.go | 6 ++-- .../service/cloudwatch/metric_alarm_test.go | 6 ++-- .../service/cloudwatch/metric_stream_test.go | 6 ++-- internal/service/cloudwatch/sweep.go | 2 +- .../authorization_token_data_source_test.go | 4 +-- .../domain_permissions_policy_test.go | 6 ++-- internal/service/codeartifact/domain_test.go | 6 ++-- .../repository_endpoint_data_source_test.go | 4 +-- .../repository_permissions_policy_test.go | 6 ++-- .../service/codeartifact/repository_test.go | 6 ++-- internal/service/codeartifact/sweep.go | 2 +- internal/service/codebuild/project_test.go | 6 ++-- .../service/codebuild/report_group_test.go | 6 ++-- .../service/codebuild/resource_policy_test.go | 6 ++-- .../codebuild/source_credential_test.go | 6 ++-- internal/service/codebuild/sweep.go | 2 +- internal/service/codebuild/webhook_test.go | 6 ++-- ...approval_rule_template_association_test.go | 6 ++-- ...approval_rule_template_data_source_test.go | 4 +-- .../codecommit/approval_rule_template_test.go | 6 ++-- .../codecommit/repository_data_source_test.go | 4 +-- .../service/codecommit/repository_test.go | 6 ++-- internal/service/codecommit/trigger_test.go | 6 ++-- .../repository_association_test.go | 6 ++-- internal/service/codegurureviewer/sweep.go | 2 +- .../service/codepipeline/codepipeline_test.go | 6 ++-- .../codepipeline/custom_action_type_test.go | 6 ++-- internal/service/codepipeline/sweep.go | 2 +- internal/service/codepipeline/webhook_test.go | 6 ++-- .../connection_data_source_test.go | 4 +-- .../codestarconnections/connection_test.go | 6 ++-- .../service/codestarconnections/host_test.go | 6 ++-- internal/service/codestarconnections/sweep.go | 2 +- .../notification_rule_test.go | 6 ++-- .../pool_provider_principal_tag_test.go | 6 ++-- .../pool_roles_attachment_test.go | 6 ++-- internal/service/cognitoidentity/pool_test.go | 6 ++-- .../cognitoidp/identity_provider_test.go | 6 ++-- .../managed_user_pool_client_test.go | 4 +-- .../cognitoidp/resource_server_test.go | 6 ++-- .../cognitoidp/risk_configuration_test.go | 6 ++-- internal/service/cognitoidp/sweep.go | 2 +- .../service/cognitoidp/user_group_test.go | 6 ++-- .../service/cognitoidp/user_in_group_test.go | 6 ++-- .../user_pool_client_data_source_test.go | 4 +-- .../cognitoidp/user_pool_client_test.go | 6 ++-- .../user_pool_clients_data_source_test.go | 4 +-- .../cognitoidp/user_pool_domain_test.go | 6 ++-- ...ol_signing_certificate_data_source_test.go | 4 +-- internal/service/cognitoidp/user_pool_test.go | 6 ++-- .../user_pool_ui_customization_test.go | 6 ++-- .../cognitoidp/user_pools_data_source_test.go | 4 +-- internal/service/cognitoidp/user_test.go | 6 ++-- .../comprehend/document_classifier_test.go | 6 ++-- .../comprehend/entity_recognizer_test.go | 6 ++-- .../service/configservice/config_rule_test.go | 6 ++-- .../configuration_aggregator_test.go | 6 ++-- .../configuration_recorder_status_test.go | 6 ++-- .../configuration_recorder_test.go | 6 ++-- .../configservice/conformance_pack_test.go | 6 ++-- .../configservice/delivery_channel_test.go | 6 ++-- .../organization_conformance_pack_test.go | 6 ++-- .../organization_custom_policy_rule_test.go | 6 ++-- .../organization_custom_rule_test.go | 6 ++-- .../organization_managed_rule_test.go | 6 ++-- .../remediation_configuration_test.go | 6 ++-- internal/service/configservice/sweep.go | 2 +- .../bot_association_data_source_test.go | 4 +-- .../service/connect/bot_association_test.go | 6 ++-- .../connect/contact_flow_data_source_test.go | 4 +-- .../contact_flow_module_data_source_test.go | 4 +-- .../connect/contact_flow_module_test.go | 6 ++-- internal/service/connect/contact_flow_test.go | 6 ++-- .../hours_of_operation_data_source_test.go | 4 +-- .../connect/hours_of_operation_test.go | 6 ++-- .../connect/instance_data_source_test.go | 4 +-- ...nstance_storage_config_data_source_test.go | 4 +-- .../connect/instance_storage_config_test.go | 6 ++-- internal/service/connect/instance_test.go | 6 ++-- ...a_function_association_data_source_test.go | 4 +-- .../lambda_function_association_test.go | 6 ++-- internal/service/connect/phone_number_test.go | 6 ++-- .../connect/prompt_data_source_test.go | 4 +-- .../service/connect/queue_data_source_test.go | 4 +-- internal/service/connect/queue_test.go | 6 ++-- .../connect/quick_connect_data_source_test.go | 4 +-- .../service/connect/quick_connect_test.go | 6 ++-- .../routing_profile_data_source_test.go | 4 +-- .../service/connect/routing_profile_test.go | 6 ++-- .../security_profile_data_source_test.go | 4 +-- .../service/connect/security_profile_test.go | 6 ++-- internal/service/connect/sweep.go | 2 +- .../user_hierarchy_group_data_source_test.go | 4 +-- .../connect/user_hierarchy_group_test.go | 6 ++-- ...er_hierarchy_structure_data_source_test.go | 4 +-- .../connect/user_hierarchy_structure_test.go | 6 ++-- internal/service/connect/user_test.go | 6 ++-- internal/service/connect/vocabulary_test.go | 6 ++-- internal/service/controltower/control_test.go | 4 +-- .../controltower/controls_data_source_test.go | 2 +- .../cur/report_definition_data_source_test.go | 4 +-- .../service/cur/report_definition_test.go | 6 ++-- internal/service/cur/sweep.go | 2 +- .../service/dataexchange/data_set_test.go | 6 ++-- .../service/dataexchange/revision_test.go | 6 ++-- internal/service/dataexchange/sweep.go | 2 +- .../datapipeline/pipeline_data_source_test.go | 4 +-- .../pipeline_definition_data_source_test.go | 4 +-- .../datapipeline/pipeline_definition_test.go | 6 ++-- .../service/datapipeline/pipeline_test.go | 6 ++-- internal/service/datasync/agent_test.go | 6 ++-- .../service/datasync/location_efs_test.go | 6 ++-- .../location_fsx_lustre_file_system_test.go | 4 +-- .../location_fsx_openzfs_file_system_test.go | 4 +-- .../location_fsx_windows_file_system_test.go | 6 ++-- .../service/datasync/location_hdfs_test.go | 6 ++-- .../service/datasync/location_nfs_test.go | 6 ++-- .../datasync/location_object_storage_test.go | 6 ++-- internal/service/datasync/location_s3_test.go | 6 ++-- .../service/datasync/location_smb_test.go | 6 ++-- internal/service/datasync/sweep.go | 2 +- internal/service/datasync/task_test.go | 6 ++-- internal/service/dax/cluster_test.go | 6 ++-- internal/service/dax/parameter_group_test.go | 6 ++-- internal/service/dax/subnet_group_test.go | 6 ++-- internal/service/dax/sweep.go | 2 +- internal/service/deploy/app_test.go | 6 ++-- .../service/deploy/deployment_config_test.go | 6 ++-- .../service/deploy/deployment_group_test.go | 6 ++-- internal/service/deploy/sweep.go | 2 +- internal/service/detective/graph_test.go | 4 +-- .../detective/invitation_accepter_test.go | 4 +-- internal/service/detective/member_test.go | 4 +-- .../service/devicefarm/device_pool_test.go | 6 ++-- .../devicefarm/instance_profile_test.go | 6 ++-- .../devicefarm/network_profile_test.go | 6 ++-- internal/service/devicefarm/project_test.go | 6 ++-- internal/service/devicefarm/sweep.go | 2 +- .../devicefarm/test_grid_project_test.go | 6 ++-- internal/service/devicefarm/upload_test.go | 6 ++-- internal/service/directconnect/acc_test.go | 4 +-- .../service/directconnect/bgp_peer_test.go | 6 ++-- .../connection_association_test.go | 6 ++-- .../connection_confirmation_test.go | 6 ++-- .../connection_data_source_test.go | 4 +-- .../service/directconnect/connection_test.go | 6 ++-- .../gateway_association_proposal_test.go | 6 ++-- .../directconnect/gateway_association_test.go | 6 ++-- .../directconnect/gateway_data_source_test.go | 4 +-- .../service/directconnect/gateway_test.go | 6 ++-- .../directconnect/hosted_connection_test.go | 6 ++-- .../hosted_private_virtual_interface_test.go | 6 ++-- .../hosted_public_virtual_interface_test.go | 6 ++-- .../hosted_transit_virtual_interface_test.go | 6 ++-- internal/service/directconnect/lag_test.go | 6 ++-- .../location_data_source_test.go | 2 +- .../service/directconnect/macsec_key_test.go | 2 +- .../private_virtual_interface_test.go | 6 ++-- .../public_virtual_interface_test.go | 6 ++-- .../router_configuration_data_source_test.go | 2 +- internal/service/directconnect/sweep.go | 2 +- .../transit_virtual_interface_test.go | 6 ++-- internal/service/dlm/lifecycle_policy_test.go | 6 ++-- internal/service/dlm/sweep.go | 2 +- .../dms/certificate_data_source_test.go | 4 +-- internal/service/dms/certificate_test.go | 6 ++-- .../service/dms/endpoint_data_source_test.go | 4 +-- internal/service/dms/endpoint_test.go | 6 ++-- .../service/dms/event_subscription_test.go | 6 ++-- .../replication_instance_data_source_test.go | 4 +-- .../service/dms/replication_instance_test.go | 6 ++-- ...plication_subnet_group_data_source_test.go | 4 +-- .../dms/replication_subnet_group_test.go | 6 ++-- .../dms/replication_task_data_source_test.go | 4 +-- internal/service/dms/replication_task_test.go | 6 ++-- internal/service/dms/s3_endpoint_test.go | 4 +-- internal/service/dms/sweep.go | 2 +- .../service/docdb/cluster_instance_test.go | 6 ++-- .../docdb/cluster_parameter_group_test.go | 6 ++-- .../service/docdb/cluster_snapshot_test.go | 6 ++-- internal/service/docdb/cluster_test.go | 6 ++-- .../docdb/engine_version_data_source_test.go | 2 +- .../service/docdb/event_subscription_test.go | 6 ++-- internal/service/docdb/global_cluster_test.go | 6 ++-- .../orderable_db_instance_data_source_test.go | 2 +- internal/service/docdb/subnet_group_test.go | 6 ++-- internal/service/docdb/sweep.go | 2 +- .../service/ds/conditional_forwarder_test.go | 6 ++-- .../service/ds/directory_data_source_test.go | 4 +-- internal/service/ds/directory_test.go | 6 ++-- internal/service/ds/log_subscription_test.go | 6 ++-- internal/service/ds/radius_settings_test.go | 6 ++-- internal/service/ds/region_test.go | 6 ++-- .../ds/shared_directory_accepter_test.go | 6 ++-- internal/service/ds/shared_directory_test.go | 6 ++-- internal/service/ds/sweep.go | 2 +- internal/service/ds/trust_test.go | 6 ++-- .../dynamodb/contributor_insights_test.go | 6 ++-- .../service/dynamodb/global_table_test.go | 6 ++-- .../kinesis_streaming_destination_test.go | 6 ++-- internal/service/dynamodb/sweep.go | 2 +- .../dynamodb/table_data_source_test.go | 4 +-- .../dynamodb/table_item_data_source_test.go | 4 +-- internal/service/dynamodb/table_item_test.go | 6 ++-- .../service/dynamodb/table_replica_test.go | 6 ++-- internal/service/dynamodb/table_test.go | 6 ++-- internal/service/dynamodb/tag_gen_test.go | 4 +-- internal/service/dynamodb/tag_test.go | 4 +-- .../ebs_default_kms_key_data_source_test.go | 2 +- .../service/ec2/ebs_default_kms_key_test.go | 4 +-- ..._encryption_by_default_data_source_test.go | 4 +-- .../ec2/ebs_encryption_by_default_test.go | 4 +-- .../service/ec2/ebs_snapshot_copy_test.go | 4 +-- ..._snapshot_create_volume_permission_test.go | 6 ++-- .../ec2/ebs_snapshot_data_source_test.go | 4 +-- .../ec2/ebs_snapshot_ids_data_source_test.go | 4 +-- .../service/ec2/ebs_snapshot_import_test.go | 4 +-- internal/service/ec2/ebs_snapshot_test.go | 6 ++-- .../service/ec2/ebs_volume_attachment_test.go | 6 ++-- .../ec2/ebs_volume_data_source_test.go | 6 ++-- internal/service/ec2/ebs_volume_test.go | 6 ++-- .../ec2/ebs_volumes_data_source_test.go | 4 +-- internal/service/ec2/ec2_ami_copy_test.go | 6 ++-- .../service/ec2/ec2_ami_data_source_test.go | 4 +-- .../service/ec2/ec2_ami_from_instance_test.go | 4 +-- .../ec2/ec2_ami_ids_data_source_test.go | 2 +- .../ec2/ec2_ami_launch_permission_test.go | 6 ++-- internal/service/ec2/ec2_ami_test.go | 6 ++-- .../ec2_availability_zone_data_source_test.go | 2 +- .../ec2/ec2_availability_zone_group_test.go | 2 +- ...ec2_availability_zones_data_source_test.go | 4 +-- .../ec2/ec2_capacity_reservation_test.go | 6 ++-- .../service/ec2/ec2_eip_association_test.go | 6 ++-- .../service/ec2/ec2_eip_data_source_test.go | 4 +-- internal/service/ec2/ec2_eip_test.go | 6 ++-- .../service/ec2/ec2_eips_data_source_test.go | 4 +-- internal/service/ec2/ec2_fleet_test.go | 6 ++-- .../service/ec2/ec2_host_data_source_test.go | 4 +-- internal/service/ec2/ec2_host_test.go | 6 ++-- .../ec2/ec2_instance_data_source_test.go | 4 +-- .../service/ec2/ec2_instance_state_test.go | 4 +-- internal/service/ec2/ec2_instance_test.go | 6 ++-- .../ec2/ec2_instance_type_data_source_test.go | 2 +- ...instance_type_offering_data_source_test.go | 2 +- ...nstance_type_offerings_data_source_test.go | 2 +- .../ec2_instance_types_data_source_test.go | 2 +- .../ec2/ec2_instances_data_source_test.go | 4 +-- .../ec2/ec2_key_pair_data_source_test.go | 4 +-- internal/service/ec2/ec2_key_pair_test.go | 6 ++-- .../ec2_launch_template_data_source_test.go | 4 +-- .../service/ec2/ec2_launch_template_test.go | 6 ++-- .../service/ec2/ec2_placement_group_test.go | 6 ++-- .../ec2_public_ipv4_pool_data_source_test.go | 2 +- .../ec2_public_ipv4_pools_data_source_test.go | 4 +-- ..._serial_console_access_data_source_test.go | 4 +-- .../ec2/ec2_serial_console_access_test.go | 4 +-- .../ec2_spot_datafeed_subscription_test.go | 6 ++-- .../ec2/ec2_spot_fleet_request_test.go | 6 ++-- .../ec2/ec2_spot_instance_request_test.go | 6 ++-- .../ec2/ec2_spot_price_data_source_test.go | 2 +- internal/service/ec2/ipam_byoip_test.go | 2 +- .../ipam_organization_admin_account_test.go | 4 +-- .../ec2/ipam_pool_cidr_allocation_test.go | 4 +-- internal/service/ec2/ipam_pool_cidr_test.go | 4 +-- .../ec2/ipam_pool_cidrs_data_source_test.go | 2 +- .../service/ec2/ipam_pool_data_source_test.go | 2 +- internal/service/ec2/ipam_pool_test.go | 4 +-- .../ec2/ipam_pools_data_source_test.go | 2 +- ...ipam_preview_next_cidr_data_source_test.go | 2 +- .../ec2/ipam_preview_next_cidr_test.go | 2 +- ...pam_resource_discovery_association_test.go | 4 +-- .../ec2/ipam_resource_discovery_test.go | 4 +-- internal/service/ec2/ipam_scope_test.go | 4 +-- internal/service/ec2/ipam_test.go | 4 +-- .../outposts_coip_pool_data_source_test.go | 2 +- .../outposts_coip_pools_data_source_test.go | 2 +- ...outposts_local_gateway_data_source_test.go | 2 +- ...al_gateway_route_table_data_source_test.go | 2 +- ...ateway_route_table_vpc_association_test.go | 6 ++-- ...l_gateway_route_tables_data_source_test.go | 2 +- .../ec2/outposts_local_gateway_route_test.go | 6 ++-- ...eway_virtual_interface_data_source_test.go | 4 +-- ...irtual_interface_group_data_source_test.go | 4 +-- ...rtual_interface_groups_data_source_test.go | 4 +-- ...utposts_local_gateways_data_source_test.go | 2 +- internal/service/ec2/sweep.go | 2 +- internal/service/ec2/tag_gen_test.go | 4 +-- internal/service/ec2/tag_test.go | 4 +-- ...nsitgateway_attachment_data_source_test.go | 4 +-- ...sitgateway_attachments_data_source_test.go | 4 +-- ...transitgateway_connect_data_source_test.go | 4 +-- ...itgateway_connect_peer_data_source_test.go | 4 +-- .../ec2/transitgateway_connect_peer_test.go | 6 ++-- .../ec2/transitgateway_connect_test.go | 6 ++-- .../ec2/transitgateway_data_source_test.go | 4 +-- ..._dx_gateway_attachment_data_source_test.go | 4 +-- ...teway_multicast_domain_association_test.go | 6 ++-- ...teway_multicast_domain_data_source_test.go | 4 +-- .../transitgateway_multicast_domain_test.go | 6 ++-- ...nsitgateway_multicast_group_member_test.go | 6 ++-- ...nsitgateway_multicast_group_source_test.go | 6 ++-- ...ateway_peering_attachment_accepter_test.go | 4 +-- ...way_peering_attachment_data_source_test.go | 4 +-- .../transitgateway_peering_attachment_test.go | 6 ++-- ...itgateway_policy_table_association_test.go | 6 ++-- .../ec2/transitgateway_policy_table_test.go | 6 ++-- ...ansitgateway_prefix_list_reference_test.go | 6 ++-- ...sitgateway_route_table_association_test.go | 6 ++-- ...ute_table_associations_data_source_test.go | 4 +-- ...sitgateway_route_table_data_source_test.go | 4 +-- ...sitgateway_route_table_propagation_test.go | 6 ++-- ...ute_table_propagations_data_source_test.go | 4 +-- .../ec2/transitgateway_route_table_test.go | 6 ++-- ...itgateway_route_tables_data_source_test.go | 4 +-- .../service/ec2/transitgateway_route_test.go | 6 ++-- internal/service/ec2/transitgateway_test.go | 6 ++-- ...sitgateway_vpc_attachment_accepter_test.go | 4 +-- ...gateway_vpc_attachment_data_source_test.go | 4 +-- .../ec2/transitgateway_vpc_attachment_test.go | 6 ++-- ...ateway_vpc_attachments_data_source_test.go | 4 +-- ...gateway_vpn_attachment_data_source_test.go | 4 +-- internal/service/ec2/vpc_data_source_test.go | 4 +-- .../ec2/vpc_default_network_acl_test.go | 6 ++-- .../ec2/vpc_default_route_table_test.go | 6 ++-- .../ec2/vpc_default_security_group_test.go | 6 ++-- .../service/ec2/vpc_default_subnet_test.go | 6 ++-- .../ec2/vpc_default_vpc_dhcp_options_test.go | 2 +- internal/service/ec2/vpc_default_vpc_test.go | 6 ++-- .../ec2/vpc_dhcp_options_association_test.go | 6 ++-- .../ec2/vpc_dhcp_options_data_source_test.go | 4 +-- internal/service/ec2/vpc_dhcp_options_test.go | 6 ++-- .../vpc_egress_only_internet_gateway_test.go | 6 ++-- .../vpc_endpoint_connection_accepter_test.go | 6 ++-- ...c_endpoint_connection_notification_test.go | 6 ++-- .../ec2/vpc_endpoint_data_source_test.go | 4 +-- .../service/ec2/vpc_endpoint_policy_test.go | 4 +-- ...c_endpoint_route_table_association_test.go | 6 ++-- ...ndpoint_security_group_association_test.go | 6 ++-- ...endpoint_service_allowed_principal_test.go | 6 ++-- .../vpc_endpoint_service_data_source_test.go | 6 ++-- .../service/ec2/vpc_endpoint_service_test.go | 6 ++-- .../vpc_endpoint_subnet_association_test.go | 6 ++-- internal/service/ec2/vpc_endpoint_test.go | 6 ++-- internal/service/ec2/vpc_flow_log_test.go | 6 ++-- .../vpc_internet_gateway_attachment_test.go | 6 ++-- .../vpc_internet_gateway_data_source_test.go | 4 +-- .../service/ec2/vpc_internet_gateway_test.go | 6 ++-- .../vpc_ipv4_cidr_block_association_test.go | 6 ++-- .../vpc_ipv6_cidr_block_association_test.go | 4 +-- .../vpc_main_route_table_association_test.go | 6 ++-- ...pc_managed_prefix_list_data_source_test.go | 4 +-- .../ec2/vpc_managed_prefix_list_entry_test.go | 6 ++-- .../ec2/vpc_managed_prefix_list_test.go | 6 ++-- ...c_managed_prefix_lists_data_source_test.go | 4 +-- .../ec2/vpc_nat_gateway_data_source_test.go | 4 +-- internal/service/ec2/vpc_nat_gateway_test.go | 6 ++-- .../ec2/vpc_nat_gateways_data_source_test.go | 4 +-- .../ec2/vpc_network_acl_association_test.go | 6 ++-- .../service/ec2/vpc_network_acl_rule_test.go | 6 ++-- internal/service/ec2/vpc_network_acl_test.go | 6 ++-- .../ec2/vpc_network_acls_data_source_test.go | 4 +-- ...work_insights_analysis_data_source_test.go | 4 +-- .../ec2/vpc_network_insights_analysis_test.go | 6 ++-- ..._network_insights_path_data_source_test.go | 4 +-- .../ec2/vpc_network_insights_path_test.go | 6 ++-- .../vpc_network_interface_attachment_test.go | 4 +-- .../vpc_network_interface_data_source_test.go | 4 +-- ...pc_network_interface_sg_attachment_test.go | 6 ++-- .../service/ec2/vpc_network_interface_test.go | 6 ++-- ...vpc_network_interfaces_data_source_test.go | 4 +-- ...rk_performance_metric_subscription_test.go | 4 +-- .../vpc_peering_connection_accepter_test.go | 6 ++-- ...vpc_peering_connection_data_source_test.go | 4 +-- .../vpc_peering_connection_options_test.go | 6 ++-- .../ec2/vpc_peering_connection_test.go | 6 ++-- ...pc_peering_connections_data_source_test.go | 4 +-- .../ec2/vpc_prefix_list_data_source_test.go | 2 +- .../service/ec2/vpc_route_data_source_test.go | 4 +-- .../ec2/vpc_route_table_association_test.go | 6 ++-- .../ec2/vpc_route_table_data_source_test.go | 6 ++-- internal/service/ec2/vpc_route_table_test.go | 6 ++-- .../ec2/vpc_route_tables_data_source_test.go | 4 +-- internal/service/ec2/vpc_route_test.go | 6 ++-- .../vpc_security_group_data_source_test.go | 4 +-- .../vpc_security_group_egress_rule_test.go | 6 ++-- .../vpc_security_group_ingress_rule_test.go | 6 ++-- ...pc_security_group_rule_data_source_test.go | 4 +-- .../ec2/vpc_security_group_rule_test.go | 6 ++-- ...c_security_group_rules_data_source_test.go | 4 +-- .../service/ec2/vpc_security_group_test.go | 6 ++-- .../vpc_security_groups_data_source_test.go | 4 +-- .../ec2/vpc_subnet_cidr_reservation_test.go | 6 ++-- .../ec2/vpc_subnet_data_source_test.go | 4 +-- internal/service/ec2/vpc_subnet_test.go | 6 ++-- .../ec2/vpc_subnets_data_source_test.go | 4 +-- internal/service/ec2/vpc_test.go | 6 ++-- .../vpc_traffic_mirror_filter_rule_test.go | 4 +-- .../ec2/vpc_traffic_mirror_filter_test.go | 4 +-- .../ec2/vpc_traffic_mirror_session_test.go | 6 ++-- .../ec2/vpc_traffic_mirror_target_test.go | 6 ++-- .../service/ec2/vpc_vpcs_data_source_test.go | 4 +-- .../ec2/vpnclient_authorization_rule_test.go | 6 ++-- .../vpnclient_endpoint_data_source_test.go | 4 +-- .../service/ec2/vpnclient_endpoint_test.go | 6 ++-- .../ec2/vpnclient_network_association_test.go | 6 ++-- internal/service/ec2/vpnclient_route_test.go | 6 ++-- .../ec2/vpnsite_connection_route_test.go | 6 ++-- .../service/ec2/vpnsite_connection_test.go | 6 ++-- ...nsite_customer_gateway_data_source_test.go | 4 +-- .../ec2/vpnsite_customer_gateway_test.go | 6 ++-- .../ec2/vpnsite_gateway_attachment_test.go | 6 ++-- .../ec2/vpnsite_gateway_data_source_test.go | 4 +-- .../vpnsite_gateway_route_propagation_test.go | 6 ++-- internal/service/ec2/vpnsite_gateway_test.go | 6 ++-- .../ec2/wavelength_carrier_gateway_test.go | 6 ++-- .../authorization_token_data_source_test.go | 4 +-- internal/service/ecr/errorcheck_test.go | 2 +- .../service/ecr/image_data_source_test.go | 2 +- internal/service/ecr/lifecycle_policy_test.go | 6 ++-- .../ecr/pull_through_cache_rule_test.go | 6 ++-- internal/service/ecr/registry_policy_test.go | 4 +-- .../registry_scanning_configuration_test.go | 4 +-- .../ecr/replication_configuration_test.go | 4 +-- .../ecr/repository_data_source_test.go | 4 +-- .../service/ecr/repository_policy_test.go | 6 ++-- internal/service/ecr/repository_test.go | 6 ++-- internal/service/ecr/sweep.go | 2 +- .../authorization_token_data_source_test.go | 2 +- .../ecrpublic/repository_policy_test.go | 6 ++-- internal/service/ecrpublic/repository_test.go | 6 ++-- internal/service/ecrpublic/sweep.go | 2 +- .../ecs/account_setting_default_test.go | 4 +-- .../service/ecs/capacity_provider_test.go | 6 ++-- .../ecs/cluster_capacity_providers_test.go | 6 ++-- .../service/ecs/cluster_data_source_test.go | 4 +-- internal/service/ecs/cluster_test.go | 6 ++-- .../container_definition_data_source_test.go | 4 +-- .../service/ecs/service_data_source_test.go | 4 +-- internal/service/ecs/service_test.go | 6 ++-- internal/service/ecs/sweep.go | 2 +- internal/service/ecs/tag_gen_test.go | 4 +-- internal/service/ecs/tag_test.go | 4 +-- .../ecs/task_definition_data_source_test.go | 4 +-- internal/service/ecs/task_definition_test.go | 6 ++-- .../ecs/task_execution_data_source_test.go | 4 +-- internal/service/ecs/task_set_test.go | 6 ++-- .../efs/access_point_data_source_test.go | 4 +-- internal/service/efs/access_point_test.go | 6 ++-- .../efs/access_points_data_source_test.go | 2 +- internal/service/efs/backup_policy_test.go | 6 ++-- .../efs/file_system_data_source_test.go | 6 ++-- .../service/efs/file_system_policy_test.go | 6 ++-- internal/service/efs/file_system_test.go | 6 ++-- .../efs/mount_target_data_source_test.go | 4 +-- internal/service/efs/mount_target_test.go | 6 ++-- .../efs/replication_configuration_test.go | 4 +-- internal/service/efs/sweep.go | 2 +- .../service/eks/addon_data_source_test.go | 4 +-- internal/service/eks/addon_test.go | 6 ++-- .../eks/addon_version_data_source_test.go | 4 +-- .../eks/cluster_auth_data_source_test.go | 4 +-- .../service/eks/cluster_data_source_test.go | 4 +-- internal/service/eks/cluster_test.go | 6 ++-- .../service/eks/clusters_data_source_test.go | 4 +-- internal/service/eks/fargate_profile_test.go | 6 ++-- .../eks/identity_provider_config_test.go | 6 ++-- .../eks/node_group_data_source_test.go | 4 +-- internal/service/eks/node_group_test.go | 6 ++-- .../eks/node_groups_data_source_test.go | 4 +-- internal/service/eks/sweep.go | 2 +- internal/service/eks/validate_test.go | 2 +- .../elasticache/cluster_data_source_test.go | 4 +-- internal/service/elasticache/cluster_test.go | 6 ++-- .../global_replication_group_test.go | 6 ++-- .../elasticache/parameter_group_test.go | 6 ++-- .../replication_group_data_source_test.go | 4 +-- .../elasticache/replication_group_test.go | 6 ++-- .../subnet_group_data_source_test.go | 4 +-- .../service/elasticache/subnet_group_test.go | 6 ++-- internal/service/elasticache/sweep.go | 2 +- .../elasticache/user_data_source_test.go | 4 +-- .../user_group_association_test.go | 6 ++-- .../service/elasticache/user_group_test.go | 6 ++-- internal/service/elasticache/user_test.go | 6 ++-- internal/service/elasticache/validate_test.go | 2 +- .../application_data_source_test.go | 4 +-- .../elasticbeanstalk/application_test.go | 6 ++-- .../application_version_test.go | 6 ++-- .../configuration_template_test.go | 6 ++-- .../elasticbeanstalk/environment_test.go | 6 ++-- .../hosted_zone_data_source_test.go | 4 +-- .../solution_stack_data_source_test.go | 2 +- internal/service/elasticbeanstalk/sweep.go | 2 +- internal/service/elasticsearch/acc_test.go | 4 +-- .../elasticsearch/domain_data_source_test.go | 2 +- .../elasticsearch/domain_policy_test.go | 6 ++-- .../elasticsearch/domain_saml_options_test.go | 6 ++-- internal/service/elasticsearch/domain_test.go | 6 ++-- internal/service/elasticsearch/sweep.go | 2 +- .../elastictranscoder/pipeline_test.go | 6 ++-- .../service/elastictranscoder/preset_test.go | 6 ++-- .../elb/app_cookie_stickiness_policy_test.go | 6 ++-- internal/service/elb/attachment_test.go | 4 +-- .../service/elb/backend_server_policy_test.go | 6 ++-- .../elb/hosted_zone_id_data_source_test.go | 2 +- .../elb/lb_cookie_stickiness_policy_test.go | 6 ++-- .../elb/lb_ssl_negotiation_policy_test.go | 6 ++-- internal/service/elb/listener_policy_test.go | 6 ++-- .../elb/load_balancer_data_source_test.go | 4 +-- internal/service/elb/load_balancer_test.go | 6 ++-- internal/service/elb/policy_test.go | 6 ++-- .../service/elb/proxy_protocol_policy_test.go | 6 ++-- .../elb/service_account_data_source_test.go | 2 +- internal/service/elb/sweep.go | 2 +- .../elbv2/hosted_zone_id_data_source_test.go | 2 +- .../elbv2/listener_certificate_test.go | 6 ++-- .../elbv2/listener_data_source_test.go | 4 +-- internal/service/elbv2/listener_rule_test.go | 6 ++-- internal/service/elbv2/listener_test.go | 6 ++-- .../elbv2/load_balancer_data_source_test.go | 4 +-- internal/service/elbv2/load_balancer_test.go | 6 ++-- .../elbv2/load_balancers_data_source_test.go | 4 +-- internal/service/elbv2/sweep.go | 2 +- .../elbv2/target_group_attachment_test.go | 6 ++-- .../elbv2/target_group_data_source_test.go | 4 +-- internal/service/elbv2/target_group_test.go | 6 ++-- internal/service/elbv2/validate_test.go | 2 +- .../block_public_access_configuration_test.go | 4 +-- internal/service/emr/cluster_test.go | 6 ++-- internal/service/emr/instance_fleet_test.go | 6 ++-- internal/service/emr/instance_group_test.go | 6 ++-- .../emr/managed_scaling_policy_test.go | 6 ++-- .../emr/release_labels_data_source_test.go | 2 +- .../emr/security_configuration_test.go | 4 +-- .../emr/studio_session_mapping_test.go | 6 ++-- internal/service/emr/studio_test.go | 6 ++-- internal/service/emr/sweep.go | 2 +- internal/service/emrcontainers/sweep.go | 2 +- .../virtual_cluster_data_source_test.go | 4 +-- .../emrcontainers/virtual_cluster_test.go | 6 ++-- .../service/emrserverless/application_test.go | 6 ++-- internal/service/emrserverless/sweep.go | 2 +- .../service/events/api_destination_test.go | 6 ++-- internal/service/events/archive_test.go | 6 ++-- .../service/events/bus_data_source_test.go | 4 +-- internal/service/events/bus_policy_test.go | 6 ++-- internal/service/events/bus_test.go | 6 ++-- .../events/connection_data_source_test.go | 4 +-- internal/service/events/connection_test.go | 6 ++-- internal/service/events/endpoint_test.go | 6 ++-- internal/service/events/permission_test.go | 6 ++-- internal/service/events/rule_test.go | 6 ++-- .../service/events/source_data_source_test.go | 2 +- internal/service/events/sweep.go | 2 +- internal/service/events/target_test.go | 6 ++-- internal/service/events/validate_test.go | 2 +- internal/service/evidently/feature_test.go | 6 ++-- internal/service/evidently/launch_test.go | 6 ++-- internal/service/evidently/project_test.go | 6 ++-- internal/service/evidently/segment_test.go | 6 ++-- internal/service/evidently/sweep.go | 2 +- .../delivery_stream_data_source_test.go | 4 +-- .../service/firehose/delivery_stream_test.go | 6 ++-- internal/service/firehose/sweep.go | 2 +- .../service/fis/experiment_template_test.go | 6 ++-- internal/service/fis/sweep.go | 2 +- internal/service/fms/admin_account_test.go | 4 +-- internal/service/fms/policy_test.go | 6 ++-- internal/service/fsx/backup_test.go | 6 ++-- .../fsx/data_repository_association_test.go | 6 ++-- internal/service/fsx/file_cache_test.go | 6 ++-- .../service/fsx/lustre_file_system_test.go | 6 ++-- .../service/fsx/ontap_file_system_test.go | 6 ++-- .../fsx/ontap_storage_virtual_machine_test.go | 6 ++-- internal/service/fsx/ontap_volume_test.go | 6 ++-- .../service/fsx/openzfs_file_system_test.go | 6 ++-- .../fsx/openzfs_snapshot_data_source_test.go | 4 +-- internal/service/fsx/openzfs_snapshot_test.go | 6 ++-- internal/service/fsx/openzfs_volume_test.go | 6 ++-- internal/service/fsx/sweep.go | 2 +- .../windows_file_system_data_source_test.go | 4 +-- .../service/fsx/windows_file_system_test.go | 6 ++-- internal/service/gamelift/alias_test.go | 6 ++-- internal/service/gamelift/build_test.go | 6 ++-- internal/service/gamelift/fleet_test.go | 6 ++-- .../gamelift/game_server_group_test.go | 6 ++-- .../gamelift/game_session_queue_test.go | 6 ++-- internal/service/gamelift/script_test.go | 6 ++-- internal/service/gamelift/sweep.go | 2 +- internal/service/glacier/sweep.go | 2 +- internal/service/glacier/vault_lock_test.go | 6 ++-- internal/service/glacier/vault_test.go | 6 ++-- .../accelerator_data_source_test.go | 4 +-- .../globalaccelerator/accelerator_test.go | 6 ++-- ...om_routing_accelerator_data_source_test.go | 4 +-- .../custom_routing_accelerator_test.go | 6 ++-- .../custom_routing_endpoint_group_test.go | 6 ++-- .../custom_routing_listener_test.go | 6 ++-- .../globalaccelerator/endpoint_group_test.go | 6 ++-- .../globalaccelerator/listener_test.go | 6 ++-- internal/service/globalaccelerator/sweep.go | 2 +- .../service/glue/catalog_database_test.go | 6 ++-- .../glue/catalog_table_data_source_test.go | 4 +-- internal/service/glue/catalog_table_test.go | 6 ++-- internal/service/glue/classifier_test.go | 6 ++-- .../glue/connection_data_source_test.go | 6 ++-- internal/service/glue/connection_test.go | 6 ++-- internal/service/glue/crawler_test.go | 6 ++-- ...og_encryption_settings_data_source_test.go | 2 +- .../data_catalog_encryption_settings_test.go | 6 ++-- internal/service/glue/dev_endpoint_test.go | 6 ++-- internal/service/glue/job_test.go | 6 ++-- internal/service/glue/ml_transform_test.go | 6 ++-- internal/service/glue/partition_index_test.go | 6 ++-- internal/service/glue/partition_test.go | 6 ++-- internal/service/glue/registry_test.go | 6 ++-- internal/service/glue/resource_policy_test.go | 4 +-- internal/service/glue/schema_test.go | 6 ++-- .../service/glue/script_data_source_test.go | 2 +- .../glue/security_configuration_test.go | 6 ++-- internal/service/glue/sweep.go | 2 +- internal/service/glue/trigger_test.go | 6 ++-- .../glue/user_defined_function_test.go | 6 ++-- internal/service/glue/workflow_test.go | 6 ++-- .../grafana/license_association_test.go | 6 ++-- .../service/grafana/role_association_test.go | 6 ++-- internal/service/grafana/sweep.go | 2 +- .../service/grafana/workspace_api_key_test.go | 4 +-- .../grafana/workspace_data_source_test.go | 4 +-- .../workspace_saml_configuration_test.go | 6 ++-- internal/service/grafana/workspace_test.go | 6 ++-- .../guardduty/detector_data_source_test.go | 2 +- internal/service/guardduty/detector_test.go | 4 +-- internal/service/guardduty/filter_test.go | 4 +-- .../service/guardduty/invite_accepter_test.go | 4 +-- internal/service/guardduty/ipset_test.go | 6 ++-- internal/service/guardduty/member_test.go | 4 +-- .../organization_admin_account_test.go | 4 +-- .../organization_configuration_test.go | 2 +- .../guardduty/publishing_destination_test.go | 6 ++-- internal/service/guardduty/sweep.go | 2 +- .../service/guardduty/threatintelset_test.go | 6 ++-- internal/service/iam/acc_test.go | 2 +- internal/service/iam/access_key_test.go | 6 ++-- .../iam/access_keys_data_source_test.go | 4 +-- .../iam/account_alias_data_source_test.go | 4 +-- internal/service/iam/account_alias_test.go | 6 ++-- .../iam/account_password_policy_test.go | 4 +-- .../service/iam/group_data_source_test.go | 4 +-- internal/service/iam/group_membership_test.go | 6 ++-- .../iam/group_policy_attachment_test.go | 6 ++-- internal/service/iam/group_policy_test.go | 6 ++-- internal/service/iam/group_test.go | 6 ++-- .../iam/instance_profile_data_source_test.go | 4 +-- internal/service/iam/instance_profile_test.go | 6 ++-- .../iam/instance_profiles_data_source_test.go | 4 +-- ...penid_connect_provider_data_source_test.go | 4 +-- .../iam/openid_connect_provider_test.go | 6 ++-- .../service/iam/policy_attachment_test.go | 6 ++-- .../service/iam/policy_data_source_test.go | 4 +-- .../iam/policy_document_data_source_test.go | 2 +- internal/service/iam/policy_test.go | 6 ++-- internal/service/iam/role_data_source_test.go | 4 +-- .../iam/role_policy_attachment_test.go | 6 ++-- internal/service/iam/role_policy_test.go | 6 ++-- internal/service/iam/role_test.go | 6 ++-- .../service/iam/roles_data_source_test.go | 4 +-- .../iam/saml_provider_data_source_test.go | 4 +-- internal/service/iam/saml_provider_test.go | 6 ++-- .../server_certificate_data_source_test.go | 4 +-- .../service/iam/server_certificate_test.go | 6 ++-- .../service/iam/service_linked_role_test.go | 6 ++-- .../iam/service_specific_credential_test.go | 6 ++-- .../iam/session_context_data_source_test.go | 4 +-- .../service/iam/signing_certificate_test.go | 6 ++-- internal/service/iam/sweep.go | 2 +- internal/service/iam/user_data_source_test.go | 4 +-- .../service/iam/user_group_membership_test.go | 6 ++-- .../service/iam/user_login_profile_test.go | 6 ++-- .../iam/user_policy_attachment_test.go | 6 ++-- internal/service/iam/user_policy_test.go | 6 ++-- .../iam/user_ssh_key_data_source_test.go | 4 +-- internal/service/iam/user_ssh_key_test.go | 6 ++-- internal/service/iam/user_test.go | 6 ++-- .../service/iam/users_data_source_test.go | 4 +-- .../service/iam/virtual_mfa_device_test.go | 6 ++-- .../identitystore/group_data_source_test.go | 4 +-- .../identitystore/group_membership_test.go | 6 ++-- internal/service/identitystore/group_test.go | 6 ++-- .../identitystore/user_data_source_test.go | 4 +-- internal/service/identitystore/user_test.go | 6 ++-- .../component_data_source_test.go | 4 +-- .../service/imagebuilder/component_test.go | 6 ++-- .../components_data_source_test.go | 4 +-- .../container_recipe_data_source_test.go | 4 +-- .../imagebuilder/container_recipe_test.go | 6 ++-- .../container_recipes_data_source_test.go | 4 +-- ...ribution_configuration_data_source_test.go | 4 +-- .../distribution_configuration_test.go | 6 ++-- ...ibution_configurations_data_source_test.go | 4 +-- .../imagebuilder/image_data_source_test.go | 4 +-- .../image_pipeline_data_source_test.go | 4 +-- .../imagebuilder/image_pipeline_test.go | 6 ++-- .../image_pipelines_data_source_test.go | 4 +-- .../image_recipe_data_source_test.go | 4 +-- .../service/imagebuilder/image_recipe_test.go | 6 ++-- .../image_recipes_data_source_test.go | 4 +-- internal/service/imagebuilder/image_test.go | 6 ++-- ...tructure_configuration_data_source_test.go | 4 +-- .../infrastructure_configuration_test.go | 6 ++-- ...ructure_configurations_data_source_test.go | 4 +-- internal/service/imagebuilder/sweep.go | 2 +- .../inspector/assessment_target_test.go | 6 ++-- .../inspector/assessment_template_test.go | 6 ++-- .../service/inspector/resource_group_test.go | 4 +-- .../rules_packages_data_source_test.go | 2 +- .../delegated_admin_account_test.go | 4 +-- internal/service/inspector2/enabler_test.go | 4 +-- .../inspector2/member_association_test.go | 4 +-- .../organization_configuration_test.go | 4 +-- .../service/internetmonitor/monitor_test.go | 6 ++-- internal/service/internetmonitor/sweep.go | 2 +- internal/service/iot/authorizer_test.go | 6 ++-- internal/service/iot/certificate_test.go | 4 +-- .../service/iot/endpoint_data_source_test.go | 2 +- .../iot/indexing_configuration_test.go | 2 +- internal/service/iot/logging_options_test.go | 4 +-- .../service/iot/policy_attachment_test.go | 6 ++-- internal/service/iot/policy_test.go | 6 ++-- .../service/iot/provisioning_template_test.go | 6 ++-- internal/service/iot/role_alias_test.go | 6 ++-- internal/service/iot/sweep.go | 2 +- .../iot/thing_group_membership_test.go | 6 ++-- internal/service/iot/thing_group_test.go | 6 ++-- .../iot/thing_principal_attachment_test.go | 6 ++-- internal/service/iot/thing_test.go | 6 ++-- internal/service/iot/thing_type_test.go | 6 ++-- .../iot/topic_rule_destination_test.go | 6 ++-- internal/service/iot/topic_rule_test.go | 6 ++-- internal/service/ivs/channel_test.go | 6 ++-- .../service/ivs/playback_key_pair_test.go | 6 ++-- .../ivs/recording_configuration_test.go | 6 ++-- .../ivs/stream_key_data_source_test.go | 4 +-- .../ivschat/logging_configuration_test.go | 6 ++-- internal/service/ivschat/room_test.go | 6 ++-- .../kafka/broker_nodes_data_source_test.go | 4 +-- .../service/kafka/cluster_data_source_test.go | 4 +-- internal/service/kafka/cluster_test.go | 6 ++-- .../kafka/configuration_data_source_test.go | 4 +-- internal/service/kafka/configuration_test.go | 6 ++-- .../kafka/kafka_version_data_source_test.go | 2 +- .../kafka/scram_secret_association_test.go | 6 ++-- .../service/kafka/serverless_cluster_test.go | 6 ++-- internal/service/kafka/sweep.go | 2 +- .../connector_data_source_test.go | 4 +-- .../service/kafkaconnect/connector_test.go | 6 ++-- .../custom_plugin_data_source_test.go | 4 +-- .../kafkaconnect/custom_plugin_test.go | 6 ++-- internal/service/kafkaconnect/sweep.go | 2 +- .../worker_configuration_data_source_test.go | 4 +-- .../kafkaconnect/worker_configuration_test.go | 6 ++-- internal/service/kendra/data_source_test.go | 6 ++-- .../kendra/experience_data_source_test.go | 4 +-- internal/service/kendra/experience_test.go | 6 ++-- .../service/kendra/faq_data_source_test.go | 4 +-- internal/service/kendra/faq_test.go | 6 ++-- .../service/kendra/index_data_source_test.go | 4 +-- internal/service/kendra/index_test.go | 6 ++-- ...suggestions_block_list_data_source_test.go | 4 +-- .../query_suggestions_block_list_test.go | 6 ++-- internal/service/kendra/sweep.go | 2 +- .../kendra/thesaurus_data_source_test.go | 4 +-- internal/service/kendra/thesaurus_test.go | 6 ++-- internal/service/keyspaces/keyspace_test.go | 6 ++-- internal/service/keyspaces/sweep.go | 2 +- internal/service/keyspaces/table_test.go | 6 ++-- .../stream_consumer_data_source_test.go | 4 +-- .../service/kinesis/stream_consumer_test.go | 6 ++-- .../kinesis/stream_data_source_test.go | 4 +-- internal/service/kinesis/stream_test.go | 6 ++-- internal/service/kinesis/sweep.go | 2 +- .../kinesisanalytics/application_test.go | 6 ++-- internal/service/kinesisanalytics/sweep.go | 2 +- .../application_snapshot_test.go | 6 ++-- .../kinesisanalyticsv2/application_test.go | 6 ++-- internal/service/kinesisanalyticsv2/sweep.go | 2 +- internal/service/kinesisvideo/stream_test.go | 6 ++-- .../service/kms/alias_data_source_test.go | 4 +-- internal/service/kms/alias_test.go | 6 ++-- .../kms/ciphertext_data_source_test.go | 2 +- internal/service/kms/ciphertext_test.go | 2 +- .../kms/custom_key_store_data_source_test.go | 4 +-- internal/service/kms/custom_key_store_test.go | 6 ++-- internal/service/kms/external_key_test.go | 6 ++-- internal/service/kms/grant_test.go | 6 ++-- internal/service/kms/key_data_source_test.go | 4 +-- internal/service/kms/key_policy_test.go | 4 +-- internal/service/kms/key_test.go | 6 ++-- .../kms/public_key_data_source_test.go | 6 ++-- .../service/kms/replica_external_key_test.go | 4 +-- internal/service/kms/replica_key_test.go | 4 +-- .../service/kms/secret_data_source_test.go | 2 +- .../service/kms/secrets_data_source_test.go | 4 +-- internal/service/kms/sweep.go | 2 +- .../data_lake_settings_data_source_test.go | 2 +- .../lakeformation/data_lake_settings_test.go | 4 +-- internal/service/lakeformation/lf_tag_test.go | 6 ++-- .../permissions_data_source_test.go | 4 +-- .../service/lakeformation/permissions_test.go | 6 ++-- .../resource_data_source_test.go | 4 +-- .../lakeformation/resource_lf_tags_test.go | 6 ++-- .../service/lakeformation/resource_test.go | 6 ++-- .../service/lambda/alias_data_source_test.go | 4 +-- internal/service/lambda/alias_test.go | 6 ++-- .../code_signing_config_data_source_test.go | 2 +- .../lambda/code_signing_config_test.go | 4 +-- .../lambda/event_source_mapping_test.go | 6 ++-- .../lambda/function_data_source_test.go | 4 +-- .../function_event_invoke_config_test.go | 6 ++-- internal/service/lambda/function_test.go | 6 ++-- .../lambda/function_url_data_source_test.go | 4 +-- internal/service/lambda/function_url_test.go | 6 ++-- .../lambda/functions_data_source_test.go | 4 +-- .../lambda/invocation_data_source_test.go | 6 ++-- internal/service/lambda/invocation_test.go | 6 ++-- .../lambda/layer_version_data_source_test.go | 4 +-- .../lambda/layer_version_permission_test.go | 6 ++-- internal/service/lambda/layer_version_test.go | 6 ++-- internal/service/lambda/permission_test.go | 6 ++-- .../provisioned_concurrency_config_test.go | 6 ++-- internal/service/lambda/sweep.go | 2 +- .../lexmodels/bot_alias_data_source_test.go | 4 +-- internal/service/lexmodels/bot_alias_test.go | 6 ++-- .../service/lexmodels/bot_data_source_test.go | 4 +-- internal/service/lexmodels/bot_test.go | 6 ++-- .../lexmodels/intent_data_source_test.go | 4 +-- internal/service/lexmodels/intent_test.go | 6 ++-- .../lexmodels/slot_type_data_source_test.go | 4 +-- internal/service/lexmodels/slot_type_test.go | 6 ++-- internal/service/lexmodels/sweep.go | 2 +- .../licensemanager/association_test.go | 6 ++-- .../licensemanager/grant_accepter_test.go | 6 ++-- internal/service/licensemanager/grant_test.go | 6 ++-- .../license_configuration_test.go | 6 ++-- .../license_grants_data_source_test.go | 4 +-- .../received_license_data_source_test.go | 2 +- .../received_licenses_data_source_test.go | 2 +- internal/service/licensemanager/sweep.go | 2 +- .../lightsail/bucket_access_key_test.go | 6 ++-- .../lightsail/bucket_resource_access_test.go | 6 ++-- internal/service/lightsail/bucket_test.go | 6 ++-- .../service/lightsail/certificate_test.go | 6 ++-- ...ntainer_service_deployment_version_test.go | 6 ++-- .../lightsail/container_service_test.go | 6 ++-- internal/service/lightsail/database_test.go | 6 ++-- .../service/lightsail/disk_attachment_test.go | 6 ++-- internal/service/lightsail/disk_test.go | 6 ++-- .../service/lightsail/distribution_test.go | 6 ++-- .../service/lightsail/domain_entry_test.go | 6 ++-- internal/service/lightsail/domain_test.go | 6 ++-- .../lightsail/instance_public_ports_test.go | 6 ++-- internal/service/lightsail/instance_test.go | 6 ++-- internal/service/lightsail/key_pair_test.go | 6 ++-- .../service/lightsail/lb_attachment_test.go | 6 ++-- .../lb_certificate_attachment_test.go | 4 +-- .../service/lightsail/lb_certificate_test.go | 6 ++-- .../lb_https_redirection_policy_test.go | 4 +-- .../lightsail/lb_stickiness_policy_test.go | 6 ++-- internal/service/lightsail/lb_test.go | 6 ++-- .../lightsail/static_ip_attachment_test.go | 6 ++-- internal/service/lightsail/static_ip_test.go | 6 ++-- internal/service/lightsail/sweep.go | 2 +- .../geofence_collection_data_source_test.go | 4 +-- .../location/geofence_collection_test.go | 6 ++-- .../service/location/map_data_source_test.go | 4 +-- internal/service/location/map_test.go | 6 ++-- .../location/place_index_data_source_test.go | 4 +-- internal/service/location/place_index_test.go | 6 ++-- .../route_calculator_data_source_test.go | 4 +-- .../service/location/route_calculator_test.go | 6 ++-- internal/service/location/sweep.go | 2 +- .../tracker_association_data_source_test.go | 4 +-- .../location/tracker_association_test.go | 6 ++-- .../tracker_associations_data_source_test.go | 4 +-- .../location/tracker_data_source_test.go | 4 +-- internal/service/location/tracker_test.go | 6 ++-- ...ection_policy_document_data_source_test.go | 4 +-- .../logs/data_protection_policy_test.go | 6 ++-- .../service/logs/destination_policy_test.go | 6 ++-- internal/service/logs/destination_test.go | 6 ++-- .../service/logs/group_data_source_test.go | 4 +-- internal/service/logs/group_test.go | 4 +-- .../service/logs/groups_data_source_test.go | 4 +-- internal/service/logs/metric_filter_test.go | 6 ++-- .../service/logs/query_definition_test.go | 6 ++-- internal/service/logs/resource_policy_test.go | 6 ++-- internal/service/logs/stream_test.go | 6 ++-- .../service/logs/subscription_filter_test.go | 6 ++-- internal/service/logs/sweep.go | 2 +- internal/service/logs/validate_test.go | 2 +- internal/service/macie2/account_test.go | 4 +-- ...lassification_export_configuration_test.go | 4 +-- .../service/macie2/classification_job_test.go | 6 ++-- .../macie2/custom_data_identifier_test.go | 6 ++-- .../service/macie2/findings_filter_test.go | 4 +-- .../macie2/invitation_accepter_test.go | 4 +-- internal/service/macie2/member_test.go | 4 +-- .../macie2/organization_admin_account_test.go | 4 +-- internal/service/mediaconvert/queue_test.go | 6 ++-- internal/service/medialive/channel_test.go | 6 ++-- .../medialive/input_security_group_test.go | 6 ++-- internal/service/medialive/input_test.go | 6 ++-- .../medialive/multiplex_program_test.go | 6 ++-- internal/service/medialive/multiplex_test.go | 6 ++-- internal/service/medialive/sweep.go | 2 +- internal/service/mediapackage/channel_test.go | 6 ++-- .../mediastore/container_policy_test.go | 6 ++-- internal/service/mediastore/container_test.go | 6 ++-- .../service/memorydb/acl_data_source_test.go | 4 +-- internal/service/memorydb/acl_test.go | 6 ++-- .../memorydb/cluster_data_source_test.go | 4 +-- internal/service/memorydb/cluster_test.go | 6 ++-- .../parameter_group_data_source_test.go | 4 +-- .../service/memorydb/parameter_group_test.go | 6 ++-- .../memorydb/snapshot_data_source_test.go | 4 +-- internal/service/memorydb/snapshot_test.go | 6 ++-- .../memorydb/subnet_group_data_source_test.go | 4 +-- .../service/memorydb/subnet_group_test.go | 6 ++-- internal/service/memorydb/sweep.go | 2 +- .../service/memorydb/user_data_source_test.go | 4 +-- internal/service/memorydb/user_test.go | 6 ++-- internal/service/meta/arn_data_source_test.go | 2 +- ...illing_service_account_data_source_test.go | 2 +- .../meta/default_tags_data_source_test.go | 2 +- .../meta/ip_ranges_data_source_test.go | 4 +-- .../meta/partition_data_source_test.go | 2 +- .../service/meta/region_data_source_test.go | 2 +- .../service/meta/regions_data_source_test.go | 2 +- .../service/meta/service_data_source_test.go | 2 +- .../service/mq/broker_data_source_test.go | 4 +-- ...nstance_type_offerings_data_source_test.go | 2 +- internal/service/mq/broker_test.go | 6 ++-- internal/service/mq/configuration_test.go | 6 ++-- internal/service/mq/sweep.go | 2 +- internal/service/mwaa/environment_test.go | 6 ++-- internal/service/mwaa/sweep.go | 2 +- .../service/neptune/cluster_endpoint_test.go | 6 ++-- .../service/neptune/cluster_instance_test.go | 6 ++-- .../neptune/cluster_parameter_group_test.go | 6 ++-- .../service/neptune/cluster_snapshot_test.go | 6 ++-- internal/service/neptune/cluster_test.go | 6 ++-- .../engine_version_data_source_test.go | 2 +- .../neptune/event_subscription_test.go | 6 ++-- .../service/neptune/global_cluster_test.go | 6 ++-- .../orderable_db_instance_data_source_test.go | 2 +- .../service/neptune/parameter_group_test.go | 6 ++-- internal/service/neptune/subnet_group_test.go | 6 ++-- internal/service/neptune/sweep.go | 2 +- internal/service/neptune/validate_test.go | 2 +- .../firewall_data_source_test.go | 4 +-- .../firewall_policy_data_source_test.go | 4 +-- .../networkfirewall/firewall_policy_test.go | 6 ++-- ...rewall_resource_policy_data_source_test.go | 4 +-- .../service/networkfirewall/firewall_test.go | 6 ++-- .../logging_configuration_test.go | 6 ++-- .../networkfirewall/resource_policy_test.go | 6 ++-- .../networkfirewall/rule_group_test.go | 6 ++-- internal/service/networkfirewall/sweep.go | 2 +- .../networkmanager/connect_attachment_test.go | 6 ++-- .../networkmanager/connect_peer_test.go | 6 ++-- .../connection_data_source_test.go | 4 +-- .../service/networkmanager/connection_test.go | 6 ++-- .../connections_data_source_test.go | 4 +-- .../core_network_policy_attachment_test.go | 4 +-- ...etwork_policy_document_data_source_test.go | 2 +- .../networkmanager/core_network_test.go | 4 +-- .../customer_gateway_association_test.go | 6 ++-- .../networkmanager/device_data_source_test.go | 4 +-- .../service/networkmanager/device_test.go | 6 ++-- .../devices_data_source_test.go | 4 +-- .../global_network_data_source_test.go | 4 +-- .../networkmanager/global_network_test.go | 4 +-- .../global_networks_data_source_test.go | 4 +-- .../networkmanager/link_association_test.go | 6 ++-- .../networkmanager/link_data_source_test.go | 4 +-- internal/service/networkmanager/link_test.go | 6 ++-- .../networkmanager/links_data_source_test.go | 4 +-- .../networkmanager/site_data_source_test.go | 4 +-- internal/service/networkmanager/site_test.go | 6 ++-- .../site_to_site_vpn_attachment_test.go | 6 ++-- .../networkmanager/sites_data_source_test.go | 4 +-- internal/service/networkmanager/sweep.go | 2 +- ...t_gateway_connect_peer_association_test.go | 6 ++-- .../transit_gateway_peering_test.go | 6 ++-- .../transit_gateway_registration_test.go | 6 ++-- ...sit_gateway_route_table_attachment_test.go | 6 ++-- .../networkmanager/vpc_attachment_test.go | 6 ++-- internal/service/oam/link_data_source_test.go | 4 +-- internal/service/oam/link_test.go | 6 ++-- .../service/oam/links_data_source_test.go | 4 +-- internal/service/oam/sink_data_source_test.go | 4 +-- internal/service/oam/sink_policy_test.go | 6 ++-- internal/service/oam/sink_test.go | 6 ++-- .../service/oam/sinks_data_source_test.go | 4 +-- .../opensearch/domain_data_source_test.go | 2 +- .../service/opensearch/domain_policy_test.go | 6 ++-- .../opensearch/domain_saml_options_test.go | 6 ++-- internal/service/opensearch/domain_test.go | 6 ++-- .../inbound_connection_accepter_test.go | 4 +-- .../opensearch/outbound_connection_test.go | 4 +-- internal/service/opensearch/sweep.go | 2 +- internal/service/opsworks/application_test.go | 6 ++-- .../service/opsworks/custom_layer_test.go | 6 ++-- .../opsworks/ecs_cluster_layer_test.go | 6 ++-- .../service/opsworks/ganglia_layer_test.go | 6 ++-- .../service/opsworks/haproxy_layer_test.go | 6 ++-- internal/service/opsworks/instance_test.go | 6 ++-- .../service/opsworks/java_app_layer_test.go | 6 ++-- internal/service/opsworks/layers_test.go | 4 +-- .../service/opsworks/memcached_layer_test.go | 6 ++-- internal/service/opsworks/mysql_layer_test.go | 6 ++-- .../service/opsworks/nodejs_app_layer_test.go | 6 ++-- internal/service/opsworks/permission_test.go | 6 ++-- .../service/opsworks/php_app_layer_test.go | 6 ++-- .../service/opsworks/rails_app_layer_test.go | 6 ++-- .../service/opsworks/rds_db_instance_test.go | 6 ++-- internal/service/opsworks/stack_test.go | 6 ++-- .../service/opsworks/static_web_layer_test.go | 6 ++-- internal/service/opsworks/sweep.go | 2 +- .../service/opsworks/user_profile_test.go | 6 ++-- .../service/organizations/account_test.go | 6 ++-- .../delegated_administrator_test.go | 4 +-- ...legated_administrators_data_source_test.go | 2 +- .../delegated_services_data_source_test.go | 2 +- .../organization_data_source_test.go | 2 +- .../organizations/organization_test.go | 4 +-- ...al_unit_child_accounts_data_source_test.go | 2 +- ...it_descendant_accounts_data_source_test.go | 4 +-- .../organizations/organizational_unit_test.go | 6 ++-- .../organizational_units_data_source_test.go | 2 +- .../organizations/organizations_test.go | 2 +- .../organizations/policy_attachment_test.go | 6 ++-- internal/service/organizations/policy_test.go | 6 ++-- .../resource_tags_data_source_test.go | 4 +-- .../outpost_asset_data_source_test.go | 2 +- .../outpost_assets_data_source_test.go | 2 +- .../outposts/outpost_data_source_test.go | 2 +- .../outpost_instance_type_data_source_test.go | 2 +- ...outpost_instance_types_data_source_test.go | 4 +-- .../outposts/outposts_data_source_test.go | 4 +-- .../service/outposts/site_data_source_test.go | 2 +- .../outposts/sites_data_source_test.go | 4 +-- internal/service/pinpoint/adm_channel_test.go | 4 +-- .../service/pinpoint/apns_channel_test.go | 4 +-- .../pinpoint/apns_sandbox_channel_test.go | 4 +-- .../pinpoint/apns_voip_channel_test.go | 4 +-- .../apns_voip_sandbox_channel_test.go | 4 +-- internal/service/pinpoint/app_test.go | 6 ++-- .../service/pinpoint/baidu_channel_test.go | 4 +-- .../service/pinpoint/email_channel_test.go | 6 ++-- .../service/pinpoint/event_stream_test.go | 6 ++-- internal/service/pinpoint/gcm_channel_test.go | 4 +-- internal/service/pinpoint/sms_channel_test.go | 4 +-- internal/service/pinpoint/sweep.go | 2 +- internal/service/pipes/pipe_test.go | 6 ++-- internal/service/pipes/sweep.go | 2 +- .../pricing/product_data_source_test.go | 2 +- .../service/qldb/ledger_data_source_test.go | 4 +-- internal/service/qldb/ledger_test.go | 6 ++-- internal/service/qldb/stream_test.go | 6 ++-- internal/service/qldb/sweep.go | 2 +- .../quicksight/account_subscription_test.go | 6 ++-- .../quicksight/data_set_data_source_test.go | 4 +-- internal/service/quicksight/data_set_test.go | 6 ++-- .../service/quicksight/data_source_test.go | 6 ++-- .../quicksight/folder_membership_test.go | 6 ++-- internal/service/quicksight/folder_test.go | 6 ++-- .../quicksight/group_data_source_test.go | 4 +-- .../quicksight/group_membership_test.go | 6 ++-- internal/service/quicksight/group_test.go | 6 ++-- .../quicksight/iam_policy_assignment_test.go | 6 ++-- internal/service/quicksight/ingestion_test.go | 6 ++-- internal/service/quicksight/namespace_test.go | 6 ++-- .../quicksight/refresh_schedule_test.go | 6 ++-- internal/service/quicksight/sweep.go | 2 +- .../quicksight/user_data_source_test.go | 4 +-- internal/service/quicksight/user_test.go | 6 ++-- .../service/ram/principal_association_test.go | 6 ++-- .../service/ram/resource_association_test.go | 6 ++-- .../ram/resource_share_accepter_test.go | 6 ++-- .../ram/resource_share_data_source_test.go | 4 +-- internal/service/ram/resource_share_test.go | 6 ++-- internal/service/ram/sweep.go | 2 +- internal/service/rbin/rule_test.go | 4 +-- .../rds/certificate_data_source_test.go | 2 +- .../rds/cluster_activity_stream_test.go | 6 ++-- .../service/rds/cluster_data_source_test.go | 4 +-- internal/service/rds/cluster_endpoint_test.go | 6 ++-- internal/service/rds/cluster_instance_test.go | 6 ++-- .../rds/cluster_parameter_group_test.go | 6 ++-- .../rds/cluster_role_association_test.go | 6 ++-- .../rds/cluster_snapshot_data_source_test.go | 4 +-- internal/service/rds/cluster_snapshot_test.go | 6 ++-- internal/service/rds/cluster_test.go | 6 ++-- .../service/rds/clusters_data_source_test.go | 4 +-- .../rds/engine_version_data_source_test.go | 2 +- .../rds/event_categories_data_source_test.go | 2 +- .../service/rds/event_subscription_test.go | 6 ++-- internal/service/rds/export_task_test.go | 6 ++-- internal/service/rds/global_cluster_test.go | 6 ++-- ...ance_automated_backups_replication_test.go | 6 ++-- .../service/rds/instance_data_source_test.go | 4 +-- .../rds/instance_role_association_test.go | 6 ++-- internal/service/rds/instance_test.go | 6 ++-- .../service/rds/instances_data_source_test.go | 4 +-- internal/service/rds/option_group_test.go | 6 ++-- .../orderable_instance_data_source_test.go | 2 +- internal/service/rds/parameter_group_test.go | 6 ++-- .../service/rds/proxy_data_source_test.go | 4 +-- .../rds/proxy_default_target_group_test.go | 6 ++-- internal/service/rds/proxy_endpoint_test.go | 6 ++-- internal/service/rds/proxy_target_test.go | 6 ++-- internal/service/rds/proxy_test.go | 6 ++-- ...rved_instance_offering_data_source_test.go | 2 +- .../service/rds/reserved_instance_test.go | 6 ++-- internal/service/rds/snapshot_copy_test.go | 6 ++-- .../service/rds/snapshot_data_source_test.go | 6 ++-- internal/service/rds/snapshot_test.go | 6 ++-- .../rds/subnet_group_data_source_test.go | 4 +-- internal/service/rds/subnet_group_test.go | 6 ++-- internal/service/rds/sweep.go | 2 +- internal/service/rds/validate_test.go | 2 +- .../redshift/authentication_profile_test.go | 6 ++-- .../cluster_credentials_data_source_test.go | 4 +-- .../redshift/cluster_data_source_test.go | 4 +-- .../redshift/cluster_iam_roles_test.go | 4 +-- .../service/redshift/cluster_snapshot_test.go | 6 ++-- internal/service/redshift/cluster_test.go | 6 ++-- .../service/redshift/endpoint_access_test.go | 6 ++-- .../redshift/endpoint_authorization_test.go | 6 ++-- .../redshift/event_subscription_test.go | 6 ++-- .../redshift/hsm_client_certificate_test.go | 6 ++-- .../redshift/hsm_configuration_test.go | 6 ++-- .../orderable_cluster_data_source_test.go | 2 +- .../service/redshift/parameter_group_test.go | 6 ++-- internal/service/redshift/partner_test.go | 6 ++-- .../service/redshift/scheduled_action_test.go | 6 ++-- .../redshift/snapshot_copy_grant_test.go | 6 ++-- .../snapshot_schedule_association_test.go | 6 ++-- .../redshift/snapshot_schedule_test.go | 6 ++-- .../redshift/subnet_group_data_source_test.go | 4 +-- .../service/redshift/subnet_group_test.go | 6 ++-- internal/service/redshift/sweep.go | 2 +- internal/service/redshift/usage_limit_test.go | 6 ++-- .../service/redshiftdata/statement_test.go | 6 ++-- .../credentials_data_source_test.go | 4 +-- .../endpoint_access_test.go | 6 ++-- .../redshiftserverless/namespace_test.go | 6 ++-- .../resource_policy_test.go | 6 ++-- .../redshiftserverless/snapshot_test.go | 6 ++-- internal/service/redshiftserverless/sweep.go | 2 +- .../redshiftserverless/usage_limit_test.go | 6 ++-- .../workgroup_data_source_test.go | 4 +-- .../redshiftserverless/workgroup_test.go | 6 ++-- .../service/resourceexplorer2/index_test.go | 4 +-- internal/service/resourceexplorer2/sweep.go | 2 +- .../service/resourceexplorer2/view_test.go | 6 ++-- internal/service/resourcegroups/group_test.go | 6 ++-- .../resources_data_source_test.go | 4 +-- .../service/rolesanywhere/profile_test.go | 6 ++-- .../rolesanywhere/trust_anchor_test.go | 6 ++-- .../service/route53/cidr_collection_test.go | 6 ++-- .../service/route53/cidr_location_test.go | 6 ++-- .../delegation_set_data_source_test.go | 2 +- .../service/route53/delegation_set_test.go | 6 ++-- internal/service/route53/health_check_test.go | 6 ++-- .../route53/hosted_zone_dnssec_test.go | 6 ++-- .../service/route53/key_signing_key_test.go | 6 ++-- internal/service/route53/query_log_test.go | 6 ++-- internal/service/route53/record_test.go | 6 ++-- internal/service/route53/sweep.go | 2 +- ...raffic_policy_document_data_source_test.go | 4 +-- .../route53/traffic_policy_instance_test.go | 6 ++-- .../service/route53/traffic_policy_test.go | 6 ++-- .../vpc_association_authorization_test.go | 4 +-- .../service/route53/zone_association_test.go | 4 +-- .../service/route53/zone_data_source_test.go | 4 +-- internal/service/route53/zone_test.go | 6 ++-- .../route53domains/registered_domain_test.go | 4 +-- .../cluster_test.go | 6 ++-- .../control_panel_test.go | 6 ++-- .../routing_control_test.go | 6 ++-- .../safety_rule_test.go | 6 ++-- .../route53recoverycontrolconfig/sweep.go | 2 +- .../route53recoveryreadiness/cell_test.go | 6 ++-- .../readiness_check_test.go | 6 ++-- .../recovery_group_test.go | 6 ++-- .../resource_set_test.go | 6 ++-- .../service/route53resolver/config_test.go | 6 ++-- .../route53resolver/dnssec_config_test.go | 6 ++-- .../endpoint_data_source_test.go | 4 +-- .../service/route53resolver/endpoint_test.go | 6 ++-- .../firewall_config_data_source_test.go | 4 +-- .../route53resolver/firewall_config_test.go | 6 ++-- .../firewall_domain_list_data_source_test.go | 4 +-- .../firewall_domain_list_test.go | 6 ++-- ...rule_group_association_data_source_test.go | 4 +-- .../firewall_rule_group_association_test.go | 6 ++-- .../firewall_rule_group_data_source_test.go | 4 +-- .../firewall_rule_group_test.go | 6 ++-- .../route53resolver/firewall_rule_test.go | 6 ++-- .../firewall_rules_data_source_test.go | 6 ++-- .../query_log_config_association_test.go | 6 ++-- .../query_log_config_data_source_test.go | 4 +-- .../route53resolver/query_log_config_test.go | 6 ++-- .../route53resolver/rule_association_test.go | 6 ++-- .../route53resolver/rule_data_source_test.go | 4 +-- internal/service/route53resolver/rule_test.go | 6 ++-- .../route53resolver/rules_data_source_test.go | 4 +-- internal/service/route53resolver/sweep.go | 2 +- .../service/route53resolver/validate_test.go | 2 +- internal/service/rum/app_monitor_test.go | 6 ++-- .../service/rum/metrics_destination_test.go | 6 ++-- internal/service/rum/sweep.go | 2 +- .../bucket_accelerate_configuration_test.go | 6 ++-- internal/service/s3/bucket_acl_test.go | 6 ++-- .../s3/bucket_analytics_configuration_test.go | 6 ++-- .../s3/bucket_cors_configuration_test.go | 6 ++-- .../service/s3/bucket_data_source_test.go | 4 +-- ..._intelligent_tiering_configuration_test.go | 6 ++-- internal/service/s3/bucket_inventory_test.go | 6 ++-- .../s3/bucket_lifecycle_configuration_test.go | 6 ++-- internal/service/s3/bucket_logging_test.go | 6 ++-- internal/service/s3/bucket_metric_test.go | 6 ++-- .../service/s3/bucket_notification_test.go | 6 ++-- .../s3/bucket_object_data_source_test.go | 4 +-- .../bucket_object_lock_configuration_test.go | 6 ++-- internal/service/s3/bucket_object_test.go | 6 ++-- .../s3/bucket_objects_data_source_test.go | 4 +-- .../s3/bucket_ownership_controls_test.go | 6 ++-- .../s3/bucket_policy_data_source_test.go | 6 ++-- internal/service/s3/bucket_policy_test.go | 6 ++-- .../s3/bucket_public_access_block_test.go | 6 ++-- .../bucket_replication_configuration_test.go | 6 ++-- ...cket_request_payment_configuration_test.go | 6 ++-- ...rver_side_encryption_configuration_test.go | 6 ++-- internal/service/s3/bucket_test.go | 6 ++-- internal/service/s3/bucket_versioning_test.go | 6 ++-- .../s3/bucket_website_configuration_test.go | 6 ++-- .../s3/canonical_user_id_data_source_test.go | 4 +-- internal/service/s3/object_copy_test.go | 6 ++-- .../service/s3/object_data_source_test.go | 6 ++-- internal/service/s3/object_test.go | 6 ++-- .../service/s3/objects_data_source_test.go | 6 ++-- internal/service/s3/sweep.go | 2 +- .../s3control/access_point_policy_test.go | 6 ++-- .../service/s3control/access_point_test.go | 6 ++-- ...nt_public_access_block_data_source_test.go | 2 +- .../account_public_access_block_test.go | 4 +-- .../bucket_lifecycle_configuration_test.go | 6 ++-- .../service/s3control/bucket_policy_test.go | 6 ++-- internal/service/s3control/bucket_test.go | 6 ++-- ...ti_region_access_point_data_source_test.go | 4 +-- .../multi_region_access_point_policy_test.go | 6 ++-- .../multi_region_access_point_test.go | 6 ++-- .../object_lambda_access_point_policy_test.go | 6 ++-- .../object_lambda_access_point_test.go | 6 ++-- .../storage_lens_configuration_test.go | 6 ++-- internal/service/s3control/sweep.go | 2 +- internal/service/s3outposts/endpoint_test.go | 6 ++-- .../sagemaker/app_image_config_test.go | 6 ++-- internal/service/sagemaker/app_test.go | 6 ++-- .../service/sagemaker/code_repository_test.go | 6 ++-- .../data_quality_job_definition_test.go | 6 ++-- .../service/sagemaker/device_fleet_test.go | 6 ++-- internal/service/sagemaker/device_test.go | 6 ++-- internal/service/sagemaker/domain_test.go | 6 ++-- .../sagemaker/endpoint_configuration_test.go | 6 ++-- internal/service/sagemaker/endpoint_test.go | 6 ++-- .../service/sagemaker/feature_group_test.go | 6 ++-- .../service/sagemaker/flow_definition_test.go | 6 ++-- .../service/sagemaker/human_task_ui_test.go | 6 ++-- internal/service/sagemaker/image_test.go | 6 ++-- .../service/sagemaker/image_version_test.go | 6 ++-- .../model_package_group_policy_test.go | 6 ++-- .../sagemaker/model_package_group_test.go | 6 ++-- internal/service/sagemaker/model_test.go | 6 ++-- .../sagemaker/monitoring_schedule_test.go | 6 ++-- ...k_instance_lifecycle_configuration_test.go | 6 ++-- .../sagemaker/notebook_instance_test.go | 6 ++-- .../prebuilt_ecr_image_data_source_test.go | 2 +- internal/service/sagemaker/project_test.go | 6 ++-- internal/service/sagemaker/sagemaker_test.go | 2 +- .../servicecatalog_portfolio_status_test.go | 4 +-- internal/service/sagemaker/space_test.go | 6 ++-- .../sagemaker/studio_lifecycle_config_test.go | 6 ++-- internal/service/sagemaker/sweep.go | 2 +- .../service/sagemaker/user_profile_test.go | 6 ++-- internal/service/sagemaker/workforce_test.go | 6 ++-- internal/service/sagemaker/workteam_test.go | 6 ++-- .../service/scheduler/schedule_group_test.go | 6 ++-- internal/service/scheduler/schedule_test.go | 4 +-- internal/service/scheduler/sweep.go | 2 +- internal/service/schemas/discoverer_test.go | 6 ++-- .../service/schemas/registry_policy_test.go | 6 ++-- internal/service/schemas/registry_test.go | 6 ++-- internal/service/schemas/schema_test.go | 6 ++-- internal/service/schemas/sweep.go | 2 +- .../random_password_data_source_test.go | 4 +-- .../secretsmanager/secret_data_source_test.go | 6 ++-- .../secretsmanager/secret_policy_test.go | 6 ++-- .../secret_rotation_data_source_test.go | 4 +-- .../secretsmanager/secret_rotation_test.go | 6 ++-- .../service/secretsmanager/secret_test.go | 6 ++-- .../secret_version_data_source_test.go | 6 ++-- .../secretsmanager/secret_version_test.go | 6 ++-- .../secrets_data_source_test.go | 6 ++-- internal/service/secretsmanager/sweep.go | 2 +- .../service/secretsmanager/validate_test.go | 2 +- internal/service/securityhub/account_test.go | 4 +-- .../service/securityhub/action_target_test.go | 4 +-- .../securityhub/finding_aggregator_test.go | 4 +-- internal/service/securityhub/insight_test.go | 6 ++-- .../securityhub/invite_accepter_test.go | 4 +-- internal/service/securityhub/member_test.go | 4 +-- .../organization_admin_account_test.go | 4 +-- .../organization_configuration_test.go | 4 +-- .../securityhub/product_subscription_test.go | 4 +-- .../securityhub/standards_control_test.go | 4 +-- .../standards_subscription_test.go | 4 +-- .../application_data_source_test.go | 4 +-- .../cloudformation_stack_test.go | 6 ++-- .../budget_resource_association_test.go | 6 ++-- .../constraint_data_source_test.go | 4 +-- .../service/servicecatalog/constraint_test.go | 6 ++-- .../launch_paths_data_source_test.go | 4 +-- .../organizations_access_test.go | 4 +-- .../portfolio_constraints_data_source_test.go | 4 +-- .../portfolio_data_source_test.go | 4 +-- .../servicecatalog/portfolio_share_test.go | 6 ++-- .../service/servicecatalog/portfolio_test.go | 6 ++-- .../principal_portfolio_association_test.go | 6 ++-- .../product_data_source_test.go | 4 +-- .../product_portfolio_association_test.go | 6 ++-- .../service/servicecatalog/product_test.go | 6 ++-- .../provisioned_product_test.go | 6 ++-- .../provisioning_artifact_test.go | 6 ++-- ...provisioning_artifacts_data_source_test.go | 4 +-- .../servicecatalog/service_action_test.go | 6 ++-- internal/service/servicecatalog/sweep.go | 2 +- .../tag_option_resource_association_test.go | 6 ++-- .../service/servicecatalog/tag_option_test.go | 6 ++-- .../dns_namespace_data_source_test.go | 4 +-- .../http_namespace_data_source_test.go | 4 +-- .../servicediscovery/http_namespace_test.go | 6 ++-- .../service/servicediscovery/instance_test.go | 6 ++-- .../private_dns_namespace_test.go | 6 ++-- .../public_dns_namespace_test.go | 6 ++-- .../service_data_source_test.go | 4 +-- .../service/servicediscovery/service_test.go | 6 ++-- internal/service/servicediscovery/sweep.go | 2 +- .../servicequotas/service_data_source_test.go | 2 +- .../service_quota_data_source_test.go | 2 +- .../servicequotas/service_quota_test.go | 2 +- ...ctive_receipt_rule_set_data_source_test.go | 4 +-- .../ses/active_receipt_rule_set_test.go | 6 ++-- .../service/ses/configuration_set_test.go | 6 ++-- internal/service/ses/domain_dkim_test.go | 4 +-- .../ses/domain_identity_data_source_test.go | 2 +- internal/service/ses/domain_identity_test.go | 4 +-- .../ses/domain_identity_verification_test.go | 6 ++-- internal/service/ses/domain_mail_from_test.go | 4 +-- .../ses/email_identity_data_dource_test.go | 2 +- internal/service/ses/email_identity_test.go | 4 +-- .../service/ses/event_destination_test.go | 6 ++-- .../ses/identity_notification_topic_test.go | 6 ++-- internal/service/ses/identity_policy_test.go | 6 ++-- internal/service/ses/receipt_filter_test.go | 6 ++-- internal/service/ses/receipt_rule_set_test.go | 6 ++-- internal/service/ses/receipt_rule_test.go | 6 ++-- internal/service/ses/sweep.go | 2 +- internal/service/ses/template_test.go | 6 ++-- .../configuration_set_data_source_test.go | 4 +-- ...onfiguration_set_event_destination_test.go | 6 ++-- .../service/sesv2/configuration_set_test.go | 6 ++-- internal/service/sesv2/contact_list_test.go | 6 ++-- .../sesv2/dedicated_ip_assignment_test.go | 6 ++-- .../dedicated_ip_pool_data_source_test.go | 4 +-- .../service/sesv2/dedicated_ip_pool_test.go | 6 ++-- ...email_identity_feedback_attributes_test.go | 4 +-- ...mail_identity_mail_from_attributes_test.go | 4 +-- internal/service/sesv2/email_identity_test.go | 6 ++-- internal/service/sesv2/sweep.go | 2 +- .../service/sfn/activity_data_source_test.go | 4 +-- internal/service/sfn/activity_test.go | 6 ++-- .../sfn/state_machine_data_source_test.go | 4 +-- internal/service/sfn/state_machine_test.go | 6 ++-- internal/service/sfn/sweep.go | 2 +- .../service/shield/protection_group_test.go | 6 ++-- ...rotection_health_check_association_test.go | 6 ++-- internal/service/shield/protection_test.go | 6 ++-- .../signer/signing_job_data_source_test.go | 4 +-- internal/service/signer/signing_job_test.go | 6 ++-- .../signing_profile_data_source_test.go | 4 +-- .../signer/signing_profile_permission_test.go | 6 ++-- .../service/signer/signing_profile_test.go | 6 ++-- internal/service/simpledb/domain_test.go | 6 ++-- internal/service/simpledb/sweep.go | 2 +- .../service/sns/platform_application_test.go | 6 ++-- internal/service/sns/sms_preferences_test.go | 6 ++-- internal/service/sns/sweep.go | 2 +- .../sns/topic_data_protection_policy_test.go | 6 ++-- .../service/sns/topic_data_source_test.go | 4 +-- internal/service/sns/topic_policy_test.go | 6 ++-- .../service/sns/topic_subscription_test.go | 6 ++-- internal/service/sns/topic_test.go | 6 ++-- .../service/sqs/queue_data_source_test.go | 6 ++-- internal/service/sqs/queue_policy_test.go | 4 +-- .../sqs/queue_redrive_allow_policy_test.go | 4 +-- .../service/sqs/queue_redrive_policy_test.go | 4 +-- internal/service/sqs/queue_test.go | 6 ++-- .../service/sqs/queues_data_source_test.go | 4 +-- internal/service/sqs/sweep.go | 2 +- internal/service/ssm/activation_test.go | 6 ++-- internal/service/ssm/association_test.go | 6 ++-- .../ssm/default_patch_baseline_test.go | 6 ++-- .../service/ssm/document_data_source_test.go | 4 +-- internal/service/ssm/document_test.go | 6 ++-- .../service/ssm/instances_data_source_test.go | 6 ++-- .../ssm/maintenance_window_target_test.go | 6 ++-- .../ssm/maintenance_window_task_test.go | 6 ++-- .../service/ssm/maintenance_window_test.go | 6 ++-- .../maintenance_windows_data_source_test.go | 4 +-- .../service/ssm/parameter_data_source_test.go | 4 +-- internal/service/ssm/parameter_test.go | 6 ++-- .../parameters_by_path_data_source_test.go | 4 +-- .../ssm/patch_baseline_data_source_test.go | 4 +-- internal/service/ssm/patch_baseline_test.go | 6 ++-- internal/service/ssm/patch_group_test.go | 6 ++-- .../service/ssm/resource_data_sync_test.go | 6 ++-- internal/service/ssm/service_setting_test.go | 4 +-- internal/service/ssm/sweep.go | 2 +- .../contact_channel_data_source_test.go | 4 +-- .../ssmcontacts/contact_channel_test.go | 6 ++-- .../ssmcontacts/contact_data_source_test.go | 4 +-- internal/service/ssmcontacts/contact_test.go | 6 ++-- .../ssmcontacts/plan_data_source_test.go | 4 +-- internal/service/ssmcontacts/plan_test.go | 6 ++-- .../replication_set_data_source_test.go | 2 +- .../ssmincidents/replication_set_test.go | 6 ++-- .../response_plan_data_source_test.go | 4 +-- .../ssmincidents/response_plan_test.go | 6 ++-- .../ssoadmin/account_assignment_test.go | 6 ++-- ...customer_managed_policy_attachment_test.go | 6 ++-- ...instance_access_control_attributes_test.go | 4 +-- .../ssoadmin/instances_data_source_test.go | 2 +- .../managed_policy_attachment_test.go | 6 ++-- .../permission_set_data_source_test.go | 4 +-- .../permission_set_inline_policy_test.go | 6 ++-- .../service/ssoadmin/permission_set_test.go | 6 ++-- .../permissions_boundary_attachment_test.go | 6 ++-- internal/service/ssoadmin/sweep.go | 2 +- internal/service/storagegateway/cache_test.go | 6 ++-- .../cached_iscsi_volume_test.go | 6 ++-- .../file_system_association_test.go | 6 ++-- .../service/storagegateway/gateway_test.go | 6 ++-- .../local_disk_data_source_test.go | 6 ++-- .../storagegateway/nfs_file_share_test.go | 6 ++-- .../storagegateway/smb_file_share_test.go | 6 ++-- .../stored_iscsi_volume_test.go | 6 ++-- internal/service/storagegateway/sweep.go | 2 +- .../service/storagegateway/tape_pool_test.go | 6 ++-- .../storagegateway/upload_buffer_test.go | 6 ++-- .../storagegateway/working_storage_test.go | 6 ++-- .../sts/caller_identity_data_source_test.go | 2 +- internal/service/swf/domain_test.go | 6 ++-- internal/service/swf/sweep.go | 2 +- internal/service/synthetics/canary_test.go | 6 ++-- .../synthetics/group_association_test.go | 6 ++-- internal/service/synthetics/group_test.go | 6 ++-- internal/service/synthetics/sweep.go | 2 +- .../service/timestreamwrite/database_test.go | 6 ++-- internal/service/timestreamwrite/sweep.go | 2 +- .../service/timestreamwrite/table_test.go | 6 ++-- .../service/transcribe/language_model_test.go | 6 ++-- .../transcribe/medical_vocabulary_test.go | 6 ++-- internal/service/transcribe/sweep.go | 2 +- .../transcribe/vocabulary_filter_test.go | 6 ++-- .../service/transcribe/vocabulary_test.go | 6 ++-- internal/service/transfer/access_test.go | 6 ++-- .../transfer/server_data_source_test.go | 4 +-- internal/service/transfer/server_test.go | 6 ++-- internal/service/transfer/ssh_key_test.go | 6 ++-- internal/service/transfer/sweep.go | 2 +- internal/service/transfer/tag_gen_test.go | 4 +-- internal/service/transfer/tag_test.go | 4 +-- internal/service/transfer/user_test.go | 6 ++-- internal/service/transfer/workflow_test.go | 6 ++-- .../access_log_subscription_test.go | 6 ++-- .../auth_policy_data_source_test.go | 4 +-- .../service/vpclattice/auth_policy_test.go | 6 ++-- .../vpclattice/listener_data_source_test.go | 4 +-- .../service/vpclattice/listener_rule_test.go | 6 ++-- internal/service/vpclattice/listener_test.go | 6 ++-- .../vpclattice/resource_policy_test.go | 6 ++-- .../vpclattice/service_data_source_test.go | 4 +-- .../service_network_data_source_test.go | 4 +-- ...ervice_network_service_association_test.go | 6 ++-- .../vpclattice/service_network_test.go | 6 ++-- .../service_network_vpc_association_test.go | 6 ++-- internal/service/vpclattice/service_test.go | 6 ++-- internal/service/vpclattice/sweep.go | 2 +- .../target_group_attachment_test.go | 6 ++-- .../service/vpclattice/target_group_test.go | 6 ++-- internal/service/waf/byte_match_set_test.go | 6 ++-- internal/service/waf/geo_match_set_test.go | 6 ++-- .../service/waf/ipset_data_source_test.go | 4 +-- internal/service/waf/ipset_test.go | 6 ++-- .../waf/rate_based_rule_data_source_test.go | 4 +-- internal/service/waf/rate_based_rule_test.go | 6 ++-- internal/service/waf/regex_match_set_test.go | 6 ++-- .../service/waf/regex_pattern_set_test.go | 6 ++-- internal/service/waf/rule_data_source_test.go | 4 +-- internal/service/waf/rule_group_test.go | 6 ++-- internal/service/waf/rule_test.go | 6 ++-- .../service/waf/size_constraint_set_test.go | 6 ++-- .../waf/sql_injection_match_set_test.go | 6 ++-- .../service/waf/subscribed_rule_group_test.go | 2 +- internal/service/waf/sweep.go | 2 +- .../service/waf/web_acl_data_source_test.go | 4 +-- internal/service/waf/web_acl_test.go | 6 ++-- internal/service/waf/xss_match_set_test.go | 6 ++-- .../wafregional/byte_match_set_test.go | 6 ++-- .../service/wafregional/geo_match_set_test.go | 6 ++-- .../wafregional/ipset_data_source_test.go | 4 +-- internal/service/wafregional/ipset_test.go | 6 ++-- .../rate_based_rule_data_source_test.go | 4 +-- .../wafregional/rate_based_rule_test.go | 6 ++-- .../wafregional/regex_match_set_test.go | 6 ++-- .../wafregional/regex_pattern_set_test.go | 6 ++-- .../wafregional/rule_data_source_test.go | 4 +-- .../service/wafregional/rule_group_test.go | 6 ++-- internal/service/wafregional/rule_test.go | 6 ++-- .../wafregional/size_constraint_set_test.go | 6 ++-- .../sql_injection_match_set_test.go | 6 ++-- .../wafregional/subscribed_rule_group_test.go | 2 +- internal/service/wafregional/sweep.go | 2 +- .../wafregional/web_acl_association_test.go | 6 ++-- .../wafregional/web_acl_data_source_test.go | 4 +-- internal/service/wafregional/web_acl_test.go | 6 ++-- .../service/wafregional/xss_match_set_test.go | 6 ++-- .../service/wafv2/ip_set_data_source_test.go | 4 +-- internal/service/wafv2/ip_set_test.go | 6 ++-- .../regex_pattern_set_data_source_test.go | 4 +-- .../service/wafv2/regex_pattern_set_test.go | 6 ++-- .../wafv2/rule_group_data_source_test.go | 4 +-- internal/service/wafv2/rule_group_test.go | 6 ++-- internal/service/wafv2/sweep.go | 2 +- .../service/wafv2/web_acl_association_test.go | 6 ++-- .../service/wafv2/web_acl_data_source_test.go | 4 +-- .../web_acl_logging_configuration_test.go | 6 ++-- internal/service/wafv2/web_acl_test.go | 6 ++-- internal/service/worklink/fleet_test.go | 6 ++-- ..._certificate_authority_association_test.go | 6 ++-- .../workspaces/bundle_data_source_test.go | 2 +- .../workspaces/directory_data_source_test.go | 4 +-- internal/service/workspaces/directory_test.go | 6 ++-- .../workspaces/image_data_source_test.go | 4 +-- internal/service/workspaces/ip_group_test.go | 6 ++-- internal/service/workspaces/sweep.go | 2 +- .../workspaces/workspace_data_source_test.go | 4 +-- internal/service/workspaces/workspace_test.go | 6 ++-- .../service/xray/encryption_config_test.go | 6 ++-- internal/service/xray/group_test.go | 6 ++-- internal/service/xray/sampling_rule_test.go | 6 ++-- internal/sweep/sweep_test.go | 2 +- skaff/datasource/datasource.tmpl | 1 - skaff/datasource/datasourcetest.tmpl | 6 ++-- skaff/resource/resourcetest.tmpl | 6 ++-- 1856 files changed, 4534 insertions(+), 4524 deletions(-) diff --git a/docs/adding-a-tag-resource.md b/docs/adding-a-tag-resource.md index c41a2dad2ef2..47140682b996 100644 --- a/docs/adding-a-tag-resource.md +++ b/docs/adding-a-tag-resource.md @@ -15,8 +15,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/{Service}" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAcc{Service}Tag_basic(t *testing.T) { diff --git a/docs/retries-and-waiters.md b/docs/retries-and-waiters.md index 167e56e3a243..3bec4a5b78c1 100644 --- a/docs/retries-and-waiters.md +++ b/docs/retries-and-waiters.md @@ -26,7 +26,7 @@ The [`retry.StateChangeConf` type](https://pkg.go.dev/github.com/hashicorp/terra ### Retry Functions -The [`retry.RetryContext()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource#RetryContext) function provides a simplified retry implementation around `retry.StateChangeConf`. +The [`retry.RetryContext()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry#RetryContext) function provides a simplified retry implementation around `retry.StateChangeConf`. The most common use is for simple error-based retries. ## AWS Request Handling diff --git a/docs/running-and-writing-acceptance-tests.md b/docs/running-and-writing-acceptance-tests.md index 1e7a86de6762..59a96d8ff6a4 100644 --- a/docs/running-and-writing-acceptance-tests.md +++ b/docs/running-and-writing-acceptance-tests.md @@ -1010,7 +1010,7 @@ Writing acceptance testing for data sources is similar to resources, with the bi - Adding `DataSource` to the test and configuration naming, such as `TestAccExampleThingDataSource_Filter` - The basic test _may_ be named after the easiest lookup attribute instead, e.g., `TestAccExampleThingDataSource_Name` - No disappears testing -- Almost all checks should be done with [`resource.TestCheckResourceAttrPair()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource?tab=doc#TestCheckResourceAttrPair) to compare the data source attributes to the resource attributes +- Almost all checks should be done with [`resource.TestCheckResourceAttrPair()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-testing/helper/resource?tab=doc#TestCheckResourceAttrPair) to compare the data source attributes to the resource attributes - The usage of an additional `dataSourceName` variable to store a data source reference, e.g., `data.aws_example_thing.test` Data sources testing should still use the `CheckDestroy` function of the resource, just to continue verifying that there are no dangling AWS resources after a test is run. diff --git a/go.mod b/go.mod index f452521d57b1..48aa127d2b5f 100644 --- a/go.mod +++ b/go.mod @@ -63,6 +63,7 @@ require ( github.com/hashicorp/terraform-plugin-log v0.8.0 github.com/hashicorp/terraform-plugin-mux v0.10.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 + github.com/hashicorp/terraform-plugin-testing v1.2.0 github.com/jmespath/go-jmespath v0.4.0 github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 github.com/mitchellh/cli v1.1.5 @@ -108,7 +109,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect - github.com/hashicorp/go-hclog v1.4.0 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-plugin v1.4.9 // indirect github.com/hashicorp/hc-install v0.5.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect diff --git a/go.sum b/go.sum index b4a683fc3fd2..efc3386e4fc7 100644 --- a/go.sum +++ b/go.sum @@ -199,8 +199,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= -github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= @@ -235,6 +235,8 @@ github.com/hashicorp/terraform-plugin-mux v0.10.0 h1:VejY1BffxGy2iYOaa8DDHavY4k9 github.com/hashicorp/terraform-plugin-mux v0.10.0/go.mod h1:9sdnpmY20xIsl4ItsfODZYE+MgpSy/osXpSf+RwaZCY= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1/go.mod h1:xcOSYlRVdPLmDUoqPhO9fiO/YCN/l6MGYeTzGt5jgkQ= +github.com/hashicorp/terraform-plugin-testing v1.2.0 h1:pASRAe6BOZFO4xSGQr9WzitXit0nrQAYDk8ziuRfn9E= +github.com/hashicorp/terraform-plugin-testing v1.2.0/go.mod h1:+8bp3O7xUb1UtBcdknrGdVRIuTw4b62TYSIgXHqlyew= github.com/hashicorp/terraform-registry-address v0.2.0 h1:92LUg03NhfgZv44zpNTLBGIbiyTokQCDcdH5BhVHT3s= github.com/hashicorp/terraform-registry-address v0.2.0/go.mod h1:478wuzJPzdmqT6OGbB/iH82EDcI8VFM4yujknh/1nIs= github.com/hashicorp/terraform-svchost v0.1.0 h1:0+RcgZdZYNd81Vw7tu62g9JiLLvbOigp7QtyNh6CjXk= diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index a156b4724f2d..29a5a3abcbbf 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -25,12 +25,13 @@ import ( "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + terraformsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/envvar" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" @@ -41,6 +42,7 @@ import ( tfsts "github.com/hashicorp/terraform-provider-aws/internal/service/sts" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/jmespath/go-jmespath" + "github.com/mitchellh/mapstructure" ) const ( @@ -249,7 +251,7 @@ func PreCheck(ctx context.Context, t *testing.T) { region := Region() os.Setenv(envvar.DefaultRegion, region) - diags := Provider.Configure(ctx, terraform.NewResourceConfigRaw(nil)) + diags := Provider.Configure(ctx, terraformsdk.NewResourceConfigRaw(nil)) if err := sdkdiag.DiagnosticsError(diags); err != nil { t.Fatalf("configuring provider: %s", err) } @@ -1303,7 +1305,13 @@ func CheckResourceDisappears(ctx context.Context, provo *schema.Provider, resour return fmt.Errorf("resource ID missing: %s", n) } - return DeleteResource(ctx, resource, resource.Data(rs.Primary), provo.Meta()) + var state terraformsdk.InstanceState + err := mapstructure.Decode(rs.Primary, &state) + if err != nil { + return err + } + + return DeleteResource(ctx, resource, resource.Data(&state), provo.Meta()) } } @@ -2305,7 +2313,7 @@ func TestNoMatchResourceAttr(name, key string, r *regexp.Regexp) resource.TestCh } // testNoMatchResourceAttr is same as testMatchResourceAttr in -// github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource +// github.com/hashicorp/terraform-plugin-testing/helper/resource // except negative. func testNoMatchResourceAttr(is *terraform.InstanceState, name string, key string, r *regexp.Regexp) error { if r.MatchString(is.Attributes[key]) { @@ -2321,7 +2329,7 @@ func testNoMatchResourceAttr(is *terraform.InstanceState, name string, key strin } // checkIfIndexesIntoTypeSet is copied from -// github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource +// github.com/hashicorp/terraform-plugin-testing/helper/resource func checkIfIndexesIntoTypeSet(key string, f resource.TestCheckFunc) resource.TestCheckFunc { return func(s *terraform.State) error { err := f(s) @@ -2333,7 +2341,7 @@ func checkIfIndexesIntoTypeSet(key string, f resource.TestCheckFunc) resource.Te } // indexesIntoTypeSet is copied from -// github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource +// github.com/hashicorp/terraform-plugin-testing/helper/resource func indexesIntoTypeSet(key string) bool { for _, part := range strings.Split(key, ".") { if i, err := strconv.Atoi(part); err == nil && i > 100 { @@ -2344,14 +2352,14 @@ func indexesIntoTypeSet(key string) bool { } // primaryInstanceState is copied from -// github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource +// github.com/hashicorp/terraform-plugin-testing/helper/resource func primaryInstanceState(s *terraform.State, name string) (*terraform.InstanceState, error) { ms := s.RootModule() return modulePrimaryInstanceState(ms, name) } // modulePrimaryInstanceState is copied from -// github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource +// github.com/hashicorp/terraform-plugin-testing/helper/resource func modulePrimaryInstanceState(ms *terraform.ModuleState, name string) (*terraform.InstanceState, error) { rs, ok := ms.Resources[name] if !ok { diff --git a/internal/acctest/framework.go b/internal/acctest/framework.go index cdffba5e6cd1..92360a9ca21c 100644 --- a/internal/acctest/framework.go +++ b/internal/acctest/framework.go @@ -10,9 +10,9 @@ import ( fwresource "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-go/tftypes" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" ) diff --git a/internal/acctest/vcr.go b/internal/acctest/vcr.go index b1331235001c..dc6b6fbc1099 100644 --- a/internal/acctest/vcr.go +++ b/internal/acctest/vcr.go @@ -23,9 +23,9 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/provider" diff --git a/internal/generate/sweepimp/file.tmpl b/internal/generate/sweepimp/file.tmpl index a9c082d755a6..9404497a0815 100644 --- a/internal/generate/sweepimp/file.tmpl +++ b/internal/generate/sweepimp/file.tmpl @@ -5,7 +5,7 @@ package sweep_test import ( "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" {{- range .Services }} _ "github.com/hashicorp/terraform-provider-aws/internal/service/{{ .ProviderPackage }}" {{- end }} diff --git a/internal/generate/tagresource/tests.tmpl b/internal/generate/tagresource/tests.tmpl index ba892db9211a..2afe93c389ef 100644 --- a/internal/generate/tagresource/tests.tmpl +++ b/internal/generate/tagresource/tests.tmpl @@ -7,8 +7,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/{{ .AWSService }}" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" diff --git a/internal/generate/tags/templates/v2/header_body.tmpl b/internal/generate/tags/templates/v2/header_body.tmpl index a844c77d19d7..682b40a454de 100644 --- a/internal/generate/tags/templates/v2/header_body.tmpl +++ b/internal/generate/tags/templates/v2/header_body.tmpl @@ -23,7 +23,7 @@ import ( {{- end }} {{- if .ParentNotFoundErrCode }} "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" {{- end }} {{- if .ConnsPkg }} "github.com/hashicorp/terraform-provider-aws/internal/conns" diff --git a/internal/provider/provider_acc_test.go b/internal/provider/provider_acc_test.go index f364ada3badf..38b82ff5e286 100644 --- a/internal/provider/provider_acc_test.go +++ b/internal/provider/provider_acc_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/provider" diff --git a/internal/service/accessanalyzer/analyzer_test.go b/internal/service/accessanalyzer/analyzer_test.go index dd9f091bcad7..4ed418b1a811 100644 --- a/internal/service/accessanalyzer/analyzer_test.go +++ b/internal/service/accessanalyzer/analyzer_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfaccessanalyzer "github.com/hashicorp/terraform-provider-aws/internal/service/accessanalyzer" diff --git a/internal/service/accessanalyzer/archive_rule_test.go b/internal/service/accessanalyzer/archive_rule_test.go index c88563a278c1..b232a95d4464 100644 --- a/internal/service/accessanalyzer/archive_rule_test.go +++ b/internal/service/accessanalyzer/archive_rule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfaccessanalyzer "github.com/hashicorp/terraform-provider-aws/internal/service/accessanalyzer" diff --git a/internal/service/accessanalyzer/sweep.go b/internal/service/accessanalyzer/sweep.go index abc8bea9b825..5db640345071 100644 --- a/internal/service/accessanalyzer/sweep.go +++ b/internal/service/accessanalyzer/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) @@ -25,7 +25,7 @@ func sweepAnalyzers(region string) error { ctx := sweep.Context(region) client, err := sweep.SharedRegionalSweepClient(region) if err != nil { - return fmt.Errorf("error getting client: %s", err) + return fmt.Errorf("getting client: %s", err) } conn := client.(*conns.AWSClient).AccessAnalyzerClient() input := &accessanalyzer.ListAnalyzersInput{} @@ -41,7 +41,7 @@ func sweepAnalyzers(region string) error { } if err != nil { - return fmt.Errorf("error listing IAM Access Analyzer Analyzers (%s): %w", region, err) + return fmt.Errorf("listing IAM Access Analyzer Analyzers (%s): %w", region, err) } for _, v := range page.Analyzers { @@ -56,7 +56,7 @@ func sweepAnalyzers(region string) error { err = sweep.SweepOrchestratorWithContext(ctx, sweepResources) if err != nil { - return fmt.Errorf("error sweeping IAM Access Analyzer Analyzers (%s): %w", region, err) + return fmt.Errorf("sweeping IAM Access Analyzer Analyzers (%s): %w", region, err) } return nil diff --git a/internal/service/account/alternate_contact_test.go b/internal/service/account/alternate_contact_test.go index 535fde47c387..520a63d84854 100644 --- a/internal/service/account/alternate_contact_test.go +++ b/internal/service/account/alternate_contact_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/account/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfaccount "github.com/hashicorp/terraform-provider-aws/internal/service/account" diff --git a/internal/service/account/primary_contact_test.go b/internal/service/account/primary_contact_test.go index 2cd447a62e17..947b3920099c 100644 --- a/internal/service/account/primary_contact_test.go +++ b/internal/service/account/primary_contact_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfaccount "github.com/hashicorp/terraform-provider-aws/internal/service/account" diff --git a/internal/service/acm/certificate_data_source_test.go b/internal/service/acm/certificate_data_source_test.go index 3146ab483d2b..ade6dec6c512 100644 --- a/internal/service/acm/certificate_data_source_test.go +++ b/internal/service/acm/certificate_data_source_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index 171c2b7674bf..7c3de517f91a 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acm" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacm "github.com/hashicorp/terraform-provider-aws/internal/service/acm" diff --git a/internal/service/acm/certificate_validation_test.go b/internal/service/acm/certificate_validation_test.go index 76ef3dc11193..6ad3e8f07e5a 100644 --- a/internal/service/acm/certificate_validation_test.go +++ b/internal/service/acm/certificate_validation_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acm" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacm "github.com/hashicorp/terraform-provider-aws/internal/service/acm" diff --git a/internal/service/acm/sweep.go b/internal/service/acm/sweep.go index 5756d6b6b9f1..84a4d989a966 100644 --- a/internal/service/acm/sweep.go +++ b/internal/service/acm/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acm" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/acmpca/certificate_authority_certificate_test.go b/internal/service/acmpca/certificate_authority_certificate_test.go index 87fc4df8df33..fee399956a79 100644 --- a/internal/service/acmpca/certificate_authority_certificate_test.go +++ b/internal/service/acmpca/certificate_authority_certificate_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/internal/service/acmpca/certificate_authority_data_source_test.go b/internal/service/acmpca/certificate_authority_data_source_test.go index 2e03127e5e2d..620179cb2cb5 100644 --- a/internal/service/acmpca/certificate_authority_data_source_test.go +++ b/internal/service/acmpca/certificate_authority_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/acmpca/certificate_authority_test.go b/internal/service/acmpca/certificate_authority_test.go index 30a20699d805..809fc88ab64a 100644 --- a/internal/service/acmpca/certificate_authority_test.go +++ b/internal/service/acmpca/certificate_authority_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/internal/service/acmpca/certificate_data_source_test.go b/internal/service/acmpca/certificate_data_source_test.go index 162fb7324d90..73d379424d34 100644 --- a/internal/service/acmpca/certificate_data_source_test.go +++ b/internal/service/acmpca/certificate_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/acmpca/certificate_test.go b/internal/service/acmpca/certificate_test.go index 181fb63ce28f..404d55915a0f 100644 --- a/internal/service/acmpca/certificate_test.go +++ b/internal/service/acmpca/certificate_test.go @@ -13,8 +13,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/internal/service/acmpca/permission_test.go b/internal/service/acmpca/permission_test.go index 84e84bf83620..afa23c453cd3 100644 --- a/internal/service/acmpca/permission_test.go +++ b/internal/service/acmpca/permission_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/internal/service/acmpca/policy_test.go b/internal/service/acmpca/policy_test.go index 040f5f08bd8f..0eda787fbd08 100644 --- a/internal/service/acmpca/policy_test.go +++ b/internal/service/acmpca/policy_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/acmpca" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfacmpca "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/internal/service/acmpca/sweep.go b/internal/service/acmpca/sweep.go index 401eac6dd008..28ad2b84195c 100644 --- a/internal/service/acmpca/sweep.go +++ b/internal/service/acmpca/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/amp/alert_manager_definition_test.go b/internal/service/amp/alert_manager_definition_test.go index c8c8545a19ee..8b2421efe035 100644 --- a/internal/service/amp/alert_manager_definition_test.go +++ b/internal/service/amp/alert_manager_definition_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/prometheusservice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" diff --git a/internal/service/amp/rule_group_namespace_test.go b/internal/service/amp/rule_group_namespace_test.go index ff42104bb894..04f771db5df6 100644 --- a/internal/service/amp/rule_group_namespace_test.go +++ b/internal/service/amp/rule_group_namespace_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/prometheusservice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" diff --git a/internal/service/amp/workspace_data_source_test.go b/internal/service/amp/workspace_data_source_test.go index c250ce5d8ba3..d7770800bce8 100644 --- a/internal/service/amp/workspace_data_source_test.go +++ b/internal/service/amp/workspace_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/prometheusservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/amp/workspace_test.go b/internal/service/amp/workspace_test.go index 0a0afbbb605c..2ea3f88cd1ba 100644 --- a/internal/service/amp/workspace_test.go +++ b/internal/service/amp/workspace_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/prometheusservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamp "github.com/hashicorp/terraform-provider-aws/internal/service/amp" diff --git a/internal/service/amp/workspaces_data_source_test.go b/internal/service/amp/workspaces_data_source_test.go index 8a390bb716ae..5dea5a1f0704 100644 --- a/internal/service/amp/workspaces_data_source_test.go +++ b/internal/service/amp/workspaces_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/prometheusservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/amplify/app_test.go b/internal/service/amplify/app_test.go index 2c514f008517..ec5d1f0b8b88 100644 --- a/internal/service/amplify/app_test.go +++ b/internal/service/amplify/app_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/amplify" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" diff --git a/internal/service/amplify/backend_environment_test.go b/internal/service/amplify/backend_environment_test.go index a66d40155d59..0acab0a043d7 100644 --- a/internal/service/amplify/backend_environment_test.go +++ b/internal/service/amplify/backend_environment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/amplify" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" diff --git a/internal/service/amplify/branch_test.go b/internal/service/amplify/branch_test.go index 9354f1181f94..9685738013b0 100644 --- a/internal/service/amplify/branch_test.go +++ b/internal/service/amplify/branch_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/amplify" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index b0001c63d6c8..30dbb79a3742 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/amplify" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" diff --git a/internal/service/amplify/sweep.go b/internal/service/amplify/sweep.go index 8475a53361f5..be032bb47db8 100644 --- a/internal/service/amplify/sweep.go +++ b/internal/service/amplify/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/amplify" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/amplify/webhook_test.go b/internal/service/amplify/webhook_test.go index 59818428b8ce..da0b0beada1b 100644 --- a/internal/service/amplify/webhook_test.go +++ b/internal/service/amplify/webhook_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/amplify" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfamplify "github.com/hashicorp/terraform-provider-aws/internal/service/amplify" diff --git a/internal/service/apigateway/account_test.go b/internal/service/apigateway/account_test.go index 766762888cdf..158386710026 100644 --- a/internal/service/apigateway/account_test.go +++ b/internal/service/apigateway/account_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/api_key_data_source_test.go b/internal/service/apigateway/api_key_data_source_test.go index f09906da46f7..be8150705886 100644 --- a/internal/service/apigateway/api_key_data_source_test.go +++ b/internal/service/apigateway/api_key_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/api_key_test.go b/internal/service/apigateway/api_key_test.go index 26e67c7ff86c..9716f4c19646 100644 --- a/internal/service/apigateway/api_key_test.go +++ b/internal/service/apigateway/api_key_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/authorizer_data_source_test.go b/internal/service/apigateway/authorizer_data_source_test.go index f709583a2916..48b0e1229896 100644 --- a/internal/service/apigateway/authorizer_data_source_test.go +++ b/internal/service/apigateway/authorizer_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/authorizer_test.go b/internal/service/apigateway/authorizer_test.go index 6e5d83a077b0..aac4b52b2668 100644 --- a/internal/service/apigateway/authorizer_test.go +++ b/internal/service/apigateway/authorizer_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/authorizers_data_source_test.go b/internal/service/apigateway/authorizers_data_source_test.go index af689f166788..a0bfa62f45e9 100644 --- a/internal/service/apigateway/authorizers_data_source_test.go +++ b/internal/service/apigateway/authorizers_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/base_path_mapping_test.go b/internal/service/apigateway/base_path_mapping_test.go index 7d5235b68cb5..76984f86c1ef 100644 --- a/internal/service/apigateway/base_path_mapping_test.go +++ b/internal/service/apigateway/base_path_mapping_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/client_certificate_test.go b/internal/service/apigateway/client_certificate_test.go index b079759f4c2e..127f2aa23515 100644 --- a/internal/service/apigateway/client_certificate_test.go +++ b/internal/service/apigateway/client_certificate_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/deployment_test.go b/internal/service/apigateway/deployment_test.go index 123aa2875a85..d8e4c4486883 100644 --- a/internal/service/apigateway/deployment_test.go +++ b/internal/service/apigateway/deployment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/documentation_part_test.go b/internal/service/apigateway/documentation_part_test.go index 7cee8f3aa618..7dca01d3fecc 100644 --- a/internal/service/apigateway/documentation_part_test.go +++ b/internal/service/apigateway/documentation_part_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/documentation_version_test.go b/internal/service/apigateway/documentation_version_test.go index 4a642f4fbff0..ace1b5381eb2 100644 --- a/internal/service/apigateway/documentation_version_test.go +++ b/internal/service/apigateway/documentation_version_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/domain_name_data_source_test.go b/internal/service/apigateway/domain_name_data_source_test.go index 035ea6073e26..a41eb79f17ee 100644 --- a/internal/service/apigateway/domain_name_data_source_test.go +++ b/internal/service/apigateway/domain_name_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/domain_name_test.go b/internal/service/apigateway/domain_name_test.go index eab9ae7a87ef..70ad2b8149fa 100644 --- a/internal/service/apigateway/domain_name_test.go +++ b/internal/service/apigateway/domain_name_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/errorcheck_test.go b/internal/service/apigateway/errorcheck_test.go index 4d94f1617012..b03b31e3b91c 100644 --- a/internal/service/apigateway/errorcheck_test.go +++ b/internal/service/apigateway/errorcheck_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/export_data_source_test.go b/internal/service/apigateway/export_data_source_test.go index edf5046b6974..3594cf9f56b4 100644 --- a/internal/service/apigateway/export_data_source_test.go +++ b/internal/service/apigateway/export_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/gateway_response_test.go b/internal/service/apigateway/gateway_response_test.go index e360381f7003..c1ab60464983 100644 --- a/internal/service/apigateway/gateway_response_test.go +++ b/internal/service/apigateway/gateway_response_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/integration_response_test.go b/internal/service/apigateway/integration_response_test.go index 65b48aa15188..da02845abce5 100644 --- a/internal/service/apigateway/integration_response_test.go +++ b/internal/service/apigateway/integration_response_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/integration_test.go b/internal/service/apigateway/integration_test.go index affdc08a1581..ec7f9f724f46 100644 --- a/internal/service/apigateway/integration_test.go +++ b/internal/service/apigateway/integration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/method_response_test.go b/internal/service/apigateway/method_response_test.go index 665ab1b08a29..f199b8f715a6 100644 --- a/internal/service/apigateway/method_response_test.go +++ b/internal/service/apigateway/method_response_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/method_settings_test.go b/internal/service/apigateway/method_settings_test.go index 5c6b673b91ae..7f864b602ffc 100644 --- a/internal/service/apigateway/method_settings_test.go +++ b/internal/service/apigateway/method_settings_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/method_test.go b/internal/service/apigateway/method_test.go index c8229366efff..7ebd5b8e06b0 100644 --- a/internal/service/apigateway/method_test.go +++ b/internal/service/apigateway/method_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/model_test.go b/internal/service/apigateway/model_test.go index 74d39fb03c19..6ecfa7d6c41f 100644 --- a/internal/service/apigateway/model_test.go +++ b/internal/service/apigateway/model_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/request_validator_test.go b/internal/service/apigateway/request_validator_test.go index 1a64f06f3f80..a545d17e43fd 100644 --- a/internal/service/apigateway/request_validator_test.go +++ b/internal/service/apigateway/request_validator_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/resource_data_source_test.go b/internal/service/apigateway/resource_data_source_test.go index f4b5d6893c22..48f20dfbf53f 100644 --- a/internal/service/apigateway/resource_data_source_test.go +++ b/internal/service/apigateway/resource_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/resource_test.go b/internal/service/apigateway/resource_test.go index d85460fc7535..232252ba3b28 100644 --- a/internal/service/apigateway/resource_test.go +++ b/internal/service/apigateway/resource_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/rest_api_data_source_test.go b/internal/service/apigateway/rest_api_data_source_test.go index a14b2353f942..41bc63223771 100644 --- a/internal/service/apigateway/rest_api_data_source_test.go +++ b/internal/service/apigateway/rest_api_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/rest_api_policy_test.go b/internal/service/apigateway/rest_api_policy_test.go index 7494576aa742..359af377eee7 100644 --- a/internal/service/apigateway/rest_api_policy_test.go +++ b/internal/service/apigateway/rest_api_policy_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/rest_api_test.go b/internal/service/apigateway/rest_api_test.go index 60b6c5b80ead..d6dbf6dbcef9 100644 --- a/internal/service/apigateway/rest_api_test.go +++ b/internal/service/apigateway/rest_api_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/sdk_data_source_test.go b/internal/service/apigateway/sdk_data_source_test.go index ef2a24f1dac5..985230fb6771 100644 --- a/internal/service/apigateway/sdk_data_source_test.go +++ b/internal/service/apigateway/sdk_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/stage_test.go b/internal/service/apigateway/stage_test.go index 0d232881a6df..2663cfd00641 100644 --- a/internal/service/apigateway/stage_test.go +++ b/internal/service/apigateway/stage_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/sweep.go b/internal/service/apigateway/sweep.go index 9d6b5953d8fb..028df01978a0 100644 --- a/internal/service/apigateway/sweep.go +++ b/internal/service/apigateway/sweep.go @@ -12,8 +12,8 @@ import ( "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/apigateway/usage_plan_key_test.go b/internal/service/apigateway/usage_plan_key_test.go index 3a3982f8d278..bd8bfe89ac98 100644 --- a/internal/service/apigateway/usage_plan_key_test.go +++ b/internal/service/apigateway/usage_plan_key_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/usage_plan_test.go b/internal/service/apigateway/usage_plan_test.go index 70e7565f6f45..9d57dc0a81d9 100644 --- a/internal/service/apigateway/usage_plan_test.go +++ b/internal/service/apigateway/usage_plan_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigateway/vpc_link_data_source_test.go b/internal/service/apigateway/vpc_link_data_source_test.go index 0a75a57d4383..ec0d676ed744 100644 --- a/internal/service/apigateway/vpc_link_data_source_test.go +++ b/internal/service/apigateway/vpc_link_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigateway/vpc_link_test.go b/internal/service/apigateway/vpc_link_test.go index c122381c62e0..7f114e7b2bf1 100644 --- a/internal/service/apigateway/vpc_link_test.go +++ b/internal/service/apigateway/vpc_link_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigateway "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/apigatewayv2/api_data_source_test.go b/internal/service/apigatewayv2/api_data_source_test.go index 4b09b0e59a07..afc81678da39 100644 --- a/internal/service/apigatewayv2/api_data_source_test.go +++ b/internal/service/apigatewayv2/api_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigatewayv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigatewayv2/api_mapping_test.go b/internal/service/apigatewayv2/api_mapping_test.go index 394dc4c37a8b..f907b5efae0d 100644 --- a/internal/service/apigatewayv2/api_mapping_test.go +++ b/internal/service/apigatewayv2/api_mapping_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfacm "github.com/hashicorp/terraform-provider-aws/internal/service/acm" diff --git a/internal/service/apigatewayv2/api_test.go b/internal/service/apigatewayv2/api_test.go index 5609422486cb..f7a2974c5f1b 100644 --- a/internal/service/apigatewayv2/api_test.go +++ b/internal/service/apigatewayv2/api_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/apigatewayv2/apis_data_source_test.go b/internal/service/apigatewayv2/apis_data_source_test.go index c07cf1a1a02f..7b760fec648c 100644 --- a/internal/service/apigatewayv2/apis_data_source_test.go +++ b/internal/service/apigatewayv2/apis_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigatewayv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigatewayv2/authorizer_test.go b/internal/service/apigatewayv2/authorizer_test.go index 7e7e09d6bafa..b34ad2ba9d06 100644 --- a/internal/service/apigatewayv2/authorizer_test.go +++ b/internal/service/apigatewayv2/authorizer_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/apigatewayv2/deployment_test.go b/internal/service/apigatewayv2/deployment_test.go index 28abbbaec0fb..89e5196f5bf5 100644 --- a/internal/service/apigatewayv2/deployment_test.go +++ b/internal/service/apigatewayv2/deployment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/apigatewayv2/domain_name_test.go b/internal/service/apigatewayv2/domain_name_test.go index d749e11f4976..fd5b6fbe4913 100644 --- a/internal/service/apigatewayv2/domain_name_test.go +++ b/internal/service/apigatewayv2/domain_name_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigatewayv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/apigatewayv2/errorcheck_test.go b/internal/service/apigatewayv2/errorcheck_test.go index ad59ee76e0c1..a161bc8fe6a1 100644 --- a/internal/service/apigatewayv2/errorcheck_test.go +++ b/internal/service/apigatewayv2/errorcheck_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigatewayv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigatewayv2/export_data_source_test.go b/internal/service/apigatewayv2/export_data_source_test.go index a97d0e40253d..c888376d1e17 100644 --- a/internal/service/apigatewayv2/export_data_source_test.go +++ b/internal/service/apigatewayv2/export_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apigatewayv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/apigatewayv2/integration_response_test.go b/internal/service/apigatewayv2/integration_response_test.go index 098c5bb5b3c4..92e58ce30b0f 100644 --- a/internal/service/apigatewayv2/integration_response_test.go +++ b/internal/service/apigatewayv2/integration_response_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/apigatewayv2/integration_test.go b/internal/service/apigatewayv2/integration_test.go index 2599e43a7858..ddd441850b59 100644 --- a/internal/service/apigatewayv2/integration_test.go +++ b/internal/service/apigatewayv2/integration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/apigatewayv2/model_test.go b/internal/service/apigatewayv2/model_test.go index 3eb09a116667..a9f3aca972f6 100644 --- a/internal/service/apigatewayv2/model_test.go +++ b/internal/service/apigatewayv2/model_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/apigatewayv2/route_response_test.go b/internal/service/apigatewayv2/route_response_test.go index 4dbc099cbd6d..c65c191de564 100644 --- a/internal/service/apigatewayv2/route_response_test.go +++ b/internal/service/apigatewayv2/route_response_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/apigatewayv2/route_test.go b/internal/service/apigatewayv2/route_test.go index 1628a359c6ab..abe8bbcfa0b2 100644 --- a/internal/service/apigatewayv2/route_test.go +++ b/internal/service/apigatewayv2/route_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/apigatewayv2/stage_test.go b/internal/service/apigatewayv2/stage_test.go index 1ff0128f05d1..8c82469784c5 100644 --- a/internal/service/apigatewayv2/stage_test.go +++ b/internal/service/apigatewayv2/stage_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/apigateway" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/apigatewayv2/sweep.go b/internal/service/apigatewayv2/sweep.go index fd6c938937fa..c5b315b4f0b9 100644 --- a/internal/service/apigatewayv2/sweep.go +++ b/internal/service/apigatewayv2/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/apigatewayv2/vpc_link_test.go b/internal/service/apigatewayv2/vpc_link_test.go index 8fa64ff87ad7..e53b0351cafd 100644 --- a/internal/service/apigatewayv2/vpc_link_test.go +++ b/internal/service/apigatewayv2/vpc_link_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapigatewayv2 "github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2" diff --git a/internal/service/appautoscaling/policy_test.go b/internal/service/appautoscaling/policy_test.go index e4e8b66689de..c954950e175a 100644 --- a/internal/service/appautoscaling/policy_test.go +++ b/internal/service/appautoscaling/policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/applicationautoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" diff --git a/internal/service/appautoscaling/scheduled_action_test.go b/internal/service/appautoscaling/scheduled_action_test.go index a81a8344da33..12622259cd81 100644 --- a/internal/service/appautoscaling/scheduled_action_test.go +++ b/internal/service/appautoscaling/scheduled_action_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/applicationautoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" diff --git a/internal/service/appautoscaling/target_test.go b/internal/service/appautoscaling/target_test.go index 148facde0d3a..537ab5a107b3 100644 --- a/internal/service/appautoscaling/target_test.go +++ b/internal/service/appautoscaling/target_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/applicationautoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/appautoscaling" diff --git a/internal/service/appconfig/application_test.go b/internal/service/appconfig/application_test.go index 35e262c7562d..96ff9828ac61 100644 --- a/internal/service/appconfig/application_test.go +++ b/internal/service/appconfig/application_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/configuration_profile_data_source_test.go b/internal/service/appconfig/configuration_profile_data_source_test.go index 17897aa86b58..dc9ffd8f85b2 100644 --- a/internal/service/appconfig/configuration_profile_data_source_test.go +++ b/internal/service/appconfig/configuration_profile_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appconfig/configuration_profile_test.go b/internal/service/appconfig/configuration_profile_test.go index 43bb40954d00..63e1b6d2ee1e 100644 --- a/internal/service/appconfig/configuration_profile_test.go +++ b/internal/service/appconfig/configuration_profile_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/configuration_profiles_data_source_test.go b/internal/service/appconfig/configuration_profiles_data_source_test.go index 57d5418bd473..8eac714b5777 100644 --- a/internal/service/appconfig/configuration_profiles_data_source_test.go +++ b/internal/service/appconfig/configuration_profiles_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appconfig/deployment_strategy_test.go b/internal/service/appconfig/deployment_strategy_test.go index 79d3f2092358..1787a4768ac1 100644 --- a/internal/service/appconfig/deployment_strategy_test.go +++ b/internal/service/appconfig/deployment_strategy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/deployment_test.go b/internal/service/appconfig/deployment_test.go index e02e4805803b..e34d2243abb2 100644 --- a/internal/service/appconfig/deployment_test.go +++ b/internal/service/appconfig/deployment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/environment_data_source_test.go b/internal/service/appconfig/environment_data_source_test.go index 21e6e50290a8..6fdbee7d1218 100644 --- a/internal/service/appconfig/environment_data_source_test.go +++ b/internal/service/appconfig/environment_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appconfig/environment_test.go b/internal/service/appconfig/environment_test.go index 2b0face6271c..34d42e2ae9f3 100644 --- a/internal/service/appconfig/environment_test.go +++ b/internal/service/appconfig/environment_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/environments_data_source_test.go b/internal/service/appconfig/environments_data_source_test.go index 87bfebcb28af..a5c53d288e57 100644 --- a/internal/service/appconfig/environments_data_source_test.go +++ b/internal/service/appconfig/environments_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appconfig/extension_test.go b/internal/service/appconfig/extension_test.go index 8796c53fe6dd..f5058dc011af 100644 --- a/internal/service/appconfig/extension_test.go +++ b/internal/service/appconfig/extension_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/extenstion_association_test.go b/internal/service/appconfig/extenstion_association_test.go index c57fd9fc0c6c..4c950454b85d 100644 --- a/internal/service/appconfig/extenstion_association_test.go +++ b/internal/service/appconfig/extenstion_association_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/hosted_configuration_version_test.go b/internal/service/appconfig/hosted_configuration_version_test.go index bba8e92d35df..4295dc000174 100644 --- a/internal/service/appconfig/hosted_configuration_version_test.go +++ b/internal/service/appconfig/hosted_configuration_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappconfig "github.com/hashicorp/terraform-provider-aws/internal/service/appconfig" diff --git a/internal/service/appconfig/sweep.go b/internal/service/appconfig/sweep.go index d0e39361ebef..eae09cd0f685 100644 --- a/internal/service/appconfig/sweep.go +++ b/internal/service/appconfig/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/appflow/connector_profile_test.go b/internal/service/appflow/connector_profile_test.go index d96fc1124e54..69198ec39993 100644 --- a/internal/service/appflow/connector_profile_test.go +++ b/internal/service/appflow/connector_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appflow" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappflow "github.com/hashicorp/terraform-provider-aws/internal/service/appflow" diff --git a/internal/service/appflow/flow_test.go b/internal/service/appflow/flow_test.go index a1bad77f2059..54efac0bb89a 100644 --- a/internal/service/appflow/flow_test.go +++ b/internal/service/appflow/flow_test.go @@ -8,9 +8,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/appflow" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappflow "github.com/hashicorp/terraform-provider-aws/internal/service/appflow" diff --git a/internal/service/appintegrations/data_integration_test.go b/internal/service/appintegrations/data_integration_test.go index 2e76c5091017..96a03909cdab 100644 --- a/internal/service/appintegrations/data_integration_test.go +++ b/internal/service/appintegrations/data_integration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appintegrationsservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/appintegrations/event_integration_data_source_test.go b/internal/service/appintegrations/event_integration_data_source_test.go index 8427d85d25b0..d1d653c64cb0 100644 --- a/internal/service/appintegrations/event_integration_data_source_test.go +++ b/internal/service/appintegrations/event_integration_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appintegrationsservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appintegrations/event_integration_test.go b/internal/service/appintegrations/event_integration_test.go index 500e4356ddcf..92f745fb19a6 100644 --- a/internal/service/appintegrations/event_integration_test.go +++ b/internal/service/appintegrations/event_integration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appintegrationsservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappintegrations "github.com/hashicorp/terraform-provider-aws/internal/service/appintegrations" diff --git a/internal/service/applicationinsights/application_test.go b/internal/service/applicationinsights/application_test.go index e67ec308bf9a..6fcac3aead86 100644 --- a/internal/service/applicationinsights/application_test.go +++ b/internal/service/applicationinsights/application_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/applicationinsights" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapplicationinsights "github.com/hashicorp/terraform-provider-aws/internal/service/applicationinsights" diff --git a/internal/service/applicationinsights/sweep.go b/internal/service/applicationinsights/sweep.go index 270a0c03b0b5..64f5320fd380 100644 --- a/internal/service/applicationinsights/sweep.go +++ b/internal/service/applicationinsights/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/applicationinsights" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/appmesh/gateway_route_data_source_test.go b/internal/service/appmesh/gateway_route_data_source_test.go index b51f7723e0bf..4b2da858f384 100644 --- a/internal/service/appmesh/gateway_route_data_source_test.go +++ b/internal/service/appmesh/gateway_route_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/gateway_route_test.go b/internal/service/appmesh/gateway_route_test.go index 7632ebcb7b19..567841db610e 100644 --- a/internal/service/appmesh/gateway_route_test.go +++ b/internal/service/appmesh/gateway_route_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/mesh_data_source_test.go b/internal/service/appmesh/mesh_data_source_test.go index ab83ef909ace..954315add1c1 100644 --- a/internal/service/appmesh/mesh_data_source_test.go +++ b/internal/service/appmesh/mesh_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/mesh_test.go b/internal/service/appmesh/mesh_test.go index 3e6a208eb35b..afffabb80c63 100644 --- a/internal/service/appmesh/mesh_test.go +++ b/internal/service/appmesh/mesh_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/route_data_source_test.go b/internal/service/appmesh/route_data_source_test.go index cf4e7c654f5e..c7fe4d7f7e95 100644 --- a/internal/service/appmesh/route_data_source_test.go +++ b/internal/service/appmesh/route_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/route_test.go b/internal/service/appmesh/route_test.go index 05e73f7fc32c..f3efe38f4f92 100644 --- a/internal/service/appmesh/route_test.go +++ b/internal/service/appmesh/route_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/sweep.go b/internal/service/appmesh/sweep.go index d4e589f3e121..82259919ab5c 100644 --- a/internal/service/appmesh/sweep.go +++ b/internal/service/appmesh/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appmesh" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/appmesh/virtual_gateway_data_source_test.go b/internal/service/appmesh/virtual_gateway_data_source_test.go index 112f4cc54b5a..ffe066155e57 100644 --- a/internal/service/appmesh/virtual_gateway_data_source_test.go +++ b/internal/service/appmesh/virtual_gateway_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/virtual_gateway_test.go b/internal/service/appmesh/virtual_gateway_test.go index 4bafc9a4c5fa..1c5044ab53b5 100644 --- a/internal/service/appmesh/virtual_gateway_test.go +++ b/internal/service/appmesh/virtual_gateway_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/virtual_node_data_source_test.go b/internal/service/appmesh/virtual_node_data_source_test.go index 7ad5bf0fa105..d48e082a06dc 100644 --- a/internal/service/appmesh/virtual_node_data_source_test.go +++ b/internal/service/appmesh/virtual_node_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/virtual_node_test.go b/internal/service/appmesh/virtual_node_test.go index edf11e7c4379..cdcd059cebd5 100644 --- a/internal/service/appmesh/virtual_node_test.go +++ b/internal/service/appmesh/virtual_node_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/virtual_router_data_source_test.go b/internal/service/appmesh/virtual_router_data_source_test.go index 665f2e73f449..9d220c64ef47 100644 --- a/internal/service/appmesh/virtual_router_data_source_test.go +++ b/internal/service/appmesh/virtual_router_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/virtual_router_test.go b/internal/service/appmesh/virtual_router_test.go index a7082d5cb6f7..04db985830cc 100644 --- a/internal/service/appmesh/virtual_router_test.go +++ b/internal/service/appmesh/virtual_router_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/appmesh/virtual_service_data_source_test.go b/internal/service/appmesh/virtual_service_data_source_test.go index 5c8867802d32..3c50e8f83480 100644 --- a/internal/service/appmesh/virtual_service_data_source_test.go +++ b/internal/service/appmesh/virtual_service_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/appmesh/virtual_service_test.go b/internal/service/appmesh/virtual_service_test.go index 92df78c74195..896de0b0785f 100644 --- a/internal/service/appmesh/virtual_service_test.go +++ b/internal/service/appmesh/virtual_service_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appmesh" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappmesh "github.com/hashicorp/terraform-provider-aws/internal/service/appmesh" diff --git a/internal/service/apprunner/auto_scaling_configuration_version_test.go b/internal/service/apprunner/auto_scaling_configuration_version_test.go index 1b92ea285f50..5993a2fb1f9a 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version_test.go +++ b/internal/service/apprunner/auto_scaling_configuration_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/connection_test.go b/internal/service/apprunner/connection_test.go index 5e144d49a9e8..c0647ae3c955 100644 --- a/internal/service/apprunner/connection_test.go +++ b/internal/service/apprunner/connection_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/custom_domain_association_test.go b/internal/service/apprunner/custom_domain_association_test.go index 6bf482e197ef..ec53414e3a99 100644 --- a/internal/service/apprunner/custom_domain_association_test.go +++ b/internal/service/apprunner/custom_domain_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/observability_configuration_version_test.go b/internal/service/apprunner/observability_configuration_version_test.go index e35d2a382456..dea20a331ea4 100644 --- a/internal/service/apprunner/observability_configuration_version_test.go +++ b/internal/service/apprunner/observability_configuration_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/service_test.go b/internal/service/apprunner/service_test.go index a0d80919f1ef..5a05db345bac 100644 --- a/internal/service/apprunner/service_test.go +++ b/internal/service/apprunner/service_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/sweep.go b/internal/service/apprunner/sweep.go index 8dd8cc1970d4..832046965c19 100644 --- a/internal/service/apprunner/sweep.go +++ b/internal/service/apprunner/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/apprunner/vpc_connector_test.go b/internal/service/apprunner/vpc_connector_test.go index 48cbba0080e0..f00418aee8e5 100644 --- a/internal/service/apprunner/vpc_connector_test.go +++ b/internal/service/apprunner/vpc_connector_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/apprunner" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/apprunner/vpc_ingress_connection_test.go b/internal/service/apprunner/vpc_ingress_connection_test.go index 74a616d495ba..4144e5eccd3f 100644 --- a/internal/service/apprunner/vpc_ingress_connection_test.go +++ b/internal/service/apprunner/vpc_ingress_connection_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfapprunner "github.com/hashicorp/terraform-provider-aws/internal/service/apprunner" diff --git a/internal/service/appstream/directory_config_test.go b/internal/service/appstream/directory_config_test.go index a2fa2655dc85..75c8e0079887 100644 --- a/internal/service/appstream/directory_config_test.go +++ b/internal/service/appstream/directory_config_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/fleet_stack_association_test.go b/internal/service/appstream/fleet_stack_association_test.go index 4e994421a2b9..fb703d583465 100644 --- a/internal/service/appstream/fleet_stack_association_test.go +++ b/internal/service/appstream/fleet_stack_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appstream" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/fleet_test.go b/internal/service/appstream/fleet_test.go index 1b556050d1ba..4aeae96d1172 100644 --- a/internal/service/appstream/fleet_test.go +++ b/internal/service/appstream/fleet_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/image_builder_test.go b/internal/service/appstream/image_builder_test.go index beed16254066..23eff0e49aea 100644 --- a/internal/service/appstream/image_builder_test.go +++ b/internal/service/appstream/image_builder_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appstream" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/stack_test.go b/internal/service/appstream/stack_test.go index cde042a0a218..7ab989d69451 100644 --- a/internal/service/appstream/stack_test.go +++ b/internal/service/appstream/stack_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appstream" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/sweep.go b/internal/service/appstream/sweep.go index 3af96bca2824..83070ca2f48d 100644 --- a/internal/service/appstream/sweep.go +++ b/internal/service/appstream/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/appstream/user_stack_association_test.go b/internal/service/appstream/user_stack_association_test.go index b206a2f8cd7b..41b44e6bfd36 100644 --- a/internal/service/appstream/user_stack_association_test.go +++ b/internal/service/appstream/user_stack_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appstream/user_test.go b/internal/service/appstream/user_test.go index c8da2bba99ce..7c0599f75a1c 100644 --- a/internal/service/appstream/user_test.go +++ b/internal/service/appstream/user_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfappstream "github.com/hashicorp/terraform-provider-aws/internal/service/appstream" diff --git a/internal/service/appsync/api_cache_test.go b/internal/service/appsync/api_cache_test.go index 6aea856b2972..aae4e6baa0d3 100644 --- a/internal/service/appsync/api_cache_test.go +++ b/internal/service/appsync/api_cache_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appsync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/api_key_test.go b/internal/service/appsync/api_key_test.go index 810bbf88309f..4c107be7a69d 100644 --- a/internal/service/appsync/api_key_test.go +++ b/internal/service/appsync/api_key_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/datasource_test.go b/internal/service/appsync/datasource_test.go index 32b9b3b73731..5e6fb55ebf01 100644 --- a/internal/service/appsync/datasource_test.go +++ b/internal/service/appsync/datasource_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appsync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/domain_name_api_association_test.go b/internal/service/appsync/domain_name_api_association_test.go index 916c128d0321..4230317b265a 100644 --- a/internal/service/appsync/domain_name_api_association_test.go +++ b/internal/service/appsync/domain_name_api_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/domain_name_test.go b/internal/service/appsync/domain_name_test.go index 05e5dde87f42..c479f816cc55 100644 --- a/internal/service/appsync/domain_name_test.go +++ b/internal/service/appsync/domain_name_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/function_test.go b/internal/service/appsync/function_test.go index ba0b632e6d68..42688d6c390f 100644 --- a/internal/service/appsync/function_test.go +++ b/internal/service/appsync/function_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/graphql_api_test.go b/internal/service/appsync/graphql_api_test.go index 3f95a978a799..87ace70d9fd3 100644 --- a/internal/service/appsync/graphql_api_test.go +++ b/internal/service/appsync/graphql_api_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/resolver_test.go b/internal/service/appsync/resolver_test.go index 6da6d317c1ad..34ba71197fb9 100644 --- a/internal/service/appsync/resolver_test.go +++ b/internal/service/appsync/resolver_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/appsync/sweep.go b/internal/service/appsync/sweep.go index 7732c2684268..a56b19af8cc9 100644 --- a/internal/service/appsync/sweep.go +++ b/internal/service/appsync/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/appsync/type_test.go b/internal/service/appsync/type_test.go index 7ef5c3ffe4ab..490db332149e 100644 --- a/internal/service/appsync/type_test.go +++ b/internal/service/appsync/type_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/appsync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" diff --git a/internal/service/athena/data_catalog_test.go b/internal/service/athena/data_catalog_test.go index 9ca99f9ed22a..26370c77414e 100644 --- a/internal/service/athena/data_catalog_test.go +++ b/internal/service/athena/data_catalog_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" diff --git a/internal/service/athena/database_test.go b/internal/service/athena/database_test.go index bf32c096dd32..8aa64a255363 100644 --- a/internal/service/athena/database_test.go +++ b/internal/service/athena/database_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" diff --git a/internal/service/athena/named_query_test.go b/internal/service/athena/named_query_test.go index 1c95388d475d..5d0f4e92ae12 100644 --- a/internal/service/athena/named_query_test.go +++ b/internal/service/athena/named_query_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/athena/sweep.go b/internal/service/athena/sweep.go index 918f105f18c9..18a22d40d7ee 100644 --- a/internal/service/athena/sweep.go +++ b/internal/service/athena/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/athena/workgroup_test.go b/internal/service/athena/workgroup_test.go index 05209da2050d..0699fa4227ba 100644 --- a/internal/service/athena/workgroup_test.go +++ b/internal/service/athena/workgroup_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfathena "github.com/hashicorp/terraform-provider-aws/internal/service/athena" diff --git a/internal/service/auditmanager/account_registration_test.go b/internal/service/auditmanager/account_registration_test.go index 6b0becf10922..88f0ab969f64 100644 --- a/internal/service/auditmanager/account_registration_test.go +++ b/internal/service/auditmanager/account_registration_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/auditmanager" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/assessment_delegation_test.go b/internal/service/auditmanager/assessment_delegation_test.go index bfb7b29e359c..dcabf55fa0a0 100644 --- a/internal/service/auditmanager/assessment_delegation_test.go +++ b/internal/service/auditmanager/assessment_delegation_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/assessment_report_test.go b/internal/service/auditmanager/assessment_report_test.go index 0cfcabd04bba..fa227e74990a 100644 --- a/internal/service/auditmanager/assessment_report_test.go +++ b/internal/service/auditmanager/assessment_report_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/assessment_test.go b/internal/service/auditmanager/assessment_test.go index 9254b5d11899..514e8b7382ed 100644 --- a/internal/service/auditmanager/assessment_test.go +++ b/internal/service/auditmanager/assessment_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/control_data_source_test.go b/internal/service/auditmanager/control_data_source_test.go index 28a6a3dcf4d4..847669ee50be 100644 --- a/internal/service/auditmanager/control_data_source_test.go +++ b/internal/service/auditmanager/control_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/auditmanager/control_test.go b/internal/service/auditmanager/control_test.go index 8b3a80e98f6c..60a9178ead61 100644 --- a/internal/service/auditmanager/control_test.go +++ b/internal/service/auditmanager/control_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/framework_data_source_test.go b/internal/service/auditmanager/framework_data_source_test.go index b3b01dcc2ad6..808c97ff1c45 100644 --- a/internal/service/auditmanager/framework_data_source_test.go +++ b/internal/service/auditmanager/framework_data_source_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/auditmanager/framework_share_test.go b/internal/service/auditmanager/framework_share_test.go index 8a4db045f321..094c0d2cdfc0 100644 --- a/internal/service/auditmanager/framework_share_test.go +++ b/internal/service/auditmanager/framework_share_test.go @@ -8,10 +8,10 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/framework_test.go b/internal/service/auditmanager/framework_test.go index cf895da098c0..77f587fd0e66 100644 --- a/internal/service/auditmanager/framework_test.go +++ b/internal/service/auditmanager/framework_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/organization_admin_account_registration_test.go b/internal/service/auditmanager/organization_admin_account_registration_test.go index d6d06ba6f644..65ef0999c4f7 100644 --- a/internal/service/auditmanager/organization_admin_account_registration_test.go +++ b/internal/service/auditmanager/organization_admin_account_registration_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/auditmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/auditmanager/sweep.go b/internal/service/auditmanager/sweep.go index 58d7de879812..521b92819966 100644 --- a/internal/service/auditmanager/sweep.go +++ b/internal/service/auditmanager/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/auditmanager" "github.com/aws/aws-sdk-go-v2/service/auditmanager/types" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/autoscaling/attachment_test.go b/internal/service/autoscaling/attachment_test.go index 3c78e26fd4dc..4c79f721f802 100644 --- a/internal/service/autoscaling/attachment_test.go +++ b/internal/service/autoscaling/attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/group_data_source_test.go b/internal/service/autoscaling/group_data_source_test.go index 50e91b115704..56b327e3a605 100644 --- a/internal/service/autoscaling/group_data_source_test.go +++ b/internal/service/autoscaling/group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/autoscaling/group_tag_test.go b/internal/service/autoscaling/group_tag_test.go index eaae050ecf15..1823deb8b1fd 100644 --- a/internal/service/autoscaling/group_tag_test.go +++ b/internal/service/autoscaling/group_tag_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index 677269243fa4..f27520a537d5 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/groups_data_source_test.go b/internal/service/autoscaling/groups_data_source_test.go index ceafebddefde..82d7220e1cb3 100644 --- a/internal/service/autoscaling/groups_data_source_test.go +++ b/internal/service/autoscaling/groups_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/autoscaling/launch_configuration_data_source_test.go b/internal/service/autoscaling/launch_configuration_data_source_test.go index 205fb4f49790..c4dbe62ef4c4 100644 --- a/internal/service/autoscaling/launch_configuration_data_source_test.go +++ b/internal/service/autoscaling/launch_configuration_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/autoscaling/launch_configuration_test.go b/internal/service/autoscaling/launch_configuration_test.go index 72b3083907bf..d0838f5be027 100644 --- a/internal/service/autoscaling/launch_configuration_test.go +++ b/internal/service/autoscaling/launch_configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/lifecycle_hook_test.go b/internal/service/autoscaling/lifecycle_hook_test.go index 1da400679f35..3ef892b2ba60 100644 --- a/internal/service/autoscaling/lifecycle_hook_test.go +++ b/internal/service/autoscaling/lifecycle_hook_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/notification_test.go b/internal/service/autoscaling/notification_test.go index bb1cef04ebfc..591cec1f2760 100644 --- a/internal/service/autoscaling/notification_test.go +++ b/internal/service/autoscaling/notification_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/autoscaling/policy_test.go b/internal/service/autoscaling/policy_test.go index 03e7183a21cd..fc021df693e5 100644 --- a/internal/service/autoscaling/policy_test.go +++ b/internal/service/autoscaling/policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/schedule_test.go b/internal/service/autoscaling/schedule_test.go index 5909a48c3479..52fbd9fbd491 100644 --- a/internal/service/autoscaling/schedule_test.go +++ b/internal/service/autoscaling/schedule_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscaling "github.com/hashicorp/terraform-provider-aws/internal/service/autoscaling" diff --git a/internal/service/autoscaling/sweep.go b/internal/service/autoscaling/sweep.go index 7b426b3c13a1..b3014430a363 100644 --- a/internal/service/autoscaling/sweep.go +++ b/internal/service/autoscaling/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/autoscalingplans/scaling_plan_test.go b/internal/service/autoscalingplans/scaling_plan_test.go index b9e8fc480cc7..6ff314a9586a 100644 --- a/internal/service/autoscalingplans/scaling_plan_test.go +++ b/internal/service/autoscalingplans/scaling_plan_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscalingplans" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfautoscalingplans "github.com/hashicorp/terraform-provider-aws/internal/service/autoscalingplans" diff --git a/internal/service/autoscalingplans/sweep.go b/internal/service/autoscalingplans/sweep.go index 371b684a69fc..42da9b2a4483 100644 --- a/internal/service/autoscalingplans/sweep.go +++ b/internal/service/autoscalingplans/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscalingplans" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/backup/framework_data_source_test.go b/internal/service/backup/framework_data_source_test.go index e2c9f9576cc0..7241967788be 100644 --- a/internal/service/backup/framework_data_source_test.go +++ b/internal/service/backup/framework_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/backup/framework_test.go b/internal/service/backup/framework_test.go index 38aa964c4614..6a636a4859a9 100644 --- a/internal/service/backup/framework_test.go +++ b/internal/service/backup/framework_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/global_settings_test.go b/internal/service/backup/global_settings_test.go index 2aea122a9877..3d543d7f2944 100644 --- a/internal/service/backup/global_settings_test.go +++ b/internal/service/backup/global_settings_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/backup/plan_data_source_test.go b/internal/service/backup/plan_data_source_test.go index 79fa27bc47d2..87d84a782087 100644 --- a/internal/service/backup/plan_data_source_test.go +++ b/internal/service/backup/plan_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/backup/plan_test.go b/internal/service/backup/plan_test.go index 78cb47f3d66e..5f13d3cd83d9 100644 --- a/internal/service/backup/plan_test.go +++ b/internal/service/backup/plan_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/region_settings_test.go b/internal/service/backup/region_settings_test.go index e55ff38de1a7..00aa30529fc4 100644 --- a/internal/service/backup/region_settings_test.go +++ b/internal/service/backup/region_settings_test.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/service/backup" "github.com/aws/aws-sdk-go/service/fsx" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/backup/report_plan_data_source_test.go b/internal/service/backup/report_plan_data_source_test.go index 574449461189..bb6d61658816 100644 --- a/internal/service/backup/report_plan_data_source_test.go +++ b/internal/service/backup/report_plan_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/backup/report_plan_test.go b/internal/service/backup/report_plan_test.go index defe59f5d327..1049545754c9 100644 --- a/internal/service/backup/report_plan_test.go +++ b/internal/service/backup/report_plan_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/selection_data_source_test.go b/internal/service/backup/selection_data_source_test.go index 2ec08247969e..09f77df58238 100644 --- a/internal/service/backup/selection_data_source_test.go +++ b/internal/service/backup/selection_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/backup/selection_test.go b/internal/service/backup/selection_test.go index 399ba3410e37..70a94e5ec402 100644 --- a/internal/service/backup/selection_test.go +++ b/internal/service/backup/selection_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/sweep.go b/internal/service/backup/sweep.go index 9ca18eb5bca1..c4660f7404e7 100644 --- a/internal/service/backup/sweep.go +++ b/internal/service/backup/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/backup/vault_data_source_test.go b/internal/service/backup/vault_data_source_test.go index 84f41c7bef36..8cbc5ddbc41f 100644 --- a/internal/service/backup/vault_data_source_test.go +++ b/internal/service/backup/vault_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/backup/vault_lock_configuration_test.go b/internal/service/backup/vault_lock_configuration_test.go index 12b5c025a8b3..f3a458bc3c00 100644 --- a/internal/service/backup/vault_lock_configuration_test.go +++ b/internal/service/backup/vault_lock_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/vault_notifications_test.go b/internal/service/backup/vault_notifications_test.go index 6d8e83e15f88..33cd6568deed 100644 --- a/internal/service/backup/vault_notifications_test.go +++ b/internal/service/backup/vault_notifications_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/vault_policy_test.go b/internal/service/backup/vault_policy_test.go index 2e127c2c0675..7280bb15138d 100644 --- a/internal/service/backup/vault_policy_test.go +++ b/internal/service/backup/vault_policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/backup/vault_test.go b/internal/service/backup/vault_test.go index 12ea933f10f5..ccc6d7e19e03 100644 --- a/internal/service/backup/vault_test.go +++ b/internal/service/backup/vault_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbackup "github.com/hashicorp/terraform-provider-aws/internal/service/backup" diff --git a/internal/service/batch/compute_environment_data_source_test.go b/internal/service/batch/compute_environment_data_source_test.go index b0be035b2212..26b6c42f0f26 100644 --- a/internal/service/batch/compute_environment_data_source_test.go +++ b/internal/service/batch/compute_environment_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index 9049574fa4f2..be78e2d10690 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index 47baab9cb2d8..7fee0e88cbb7 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" diff --git a/internal/service/batch/job_queue_data_source_test.go b/internal/service/batch/job_queue_data_source_test.go index 59cf72c33c4d..d8ed204dfedc 100644 --- a/internal/service/batch/job_queue_data_source_test.go +++ b/internal/service/batch/job_queue_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/batch/job_queue_test.go b/internal/service/batch/job_queue_test.go index 1429a9796f83..48da70fa3a62 100644 --- a/internal/service/batch/job_queue_test.go +++ b/internal/service/batch/job_queue_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" diff --git a/internal/service/batch/scheduling_policy_data_source_test.go b/internal/service/batch/scheduling_policy_data_source_test.go index 01f34f02e42f..1e23eb0dd71a 100644 --- a/internal/service/batch/scheduling_policy_data_source_test.go +++ b/internal/service/batch/scheduling_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/batch/scheduling_policy_test.go b/internal/service/batch/scheduling_policy_test.go index fe7ed88c1ef3..b6b2422ff9cf 100644 --- a/internal/service/batch/scheduling_policy_test.go +++ b/internal/service/batch/scheduling_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbatch "github.com/hashicorp/terraform-provider-aws/internal/service/batch" diff --git a/internal/service/batch/sweep.go b/internal/service/batch/sweep.go index e55339bcc831..3d025ab5885b 100644 --- a/internal/service/batch/sweep.go +++ b/internal/service/batch/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/iam" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/budgets/budget_action_test.go b/internal/service/budgets/budget_action_test.go index c83e811853d8..3421715852b6 100644 --- a/internal/service/budgets/budget_action_test.go +++ b/internal/service/budgets/budget_action_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/budgets" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbudgets "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" diff --git a/internal/service/budgets/budget_test.go b/internal/service/budgets/budget_test.go index 37f9688416aa..0d304c4d4386 100644 --- a/internal/service/budgets/budget_test.go +++ b/internal/service/budgets/budget_test.go @@ -8,9 +8,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/budgets" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfbudgets "github.com/hashicorp/terraform-provider-aws/internal/service/budgets" diff --git a/internal/service/budgets/sweep.go b/internal/service/budgets/sweep.go index 389f8333aa9f..9009d5e936e5 100644 --- a/internal/service/budgets/sweep.go +++ b/internal/service/budgets/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/budgets" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ce/anomaly_monitor_test.go b/internal/service/ce/anomaly_monitor_test.go index 1d8f1f8958cd..051f3032cce5 100644 --- a/internal/service/ce/anomaly_monitor_test.go +++ b/internal/service/ce/anomaly_monitor_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/costexplorer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ce/anomaly_subscription_test.go b/internal/service/ce/anomaly_subscription_test.go index 2ae3e8d815d7..53335e7e6630 100644 --- a/internal/service/ce/anomaly_subscription_test.go +++ b/internal/service/ce/anomaly_subscription_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/costexplorer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ce/cost_allocation_tag_test.go b/internal/service/ce/cost_allocation_tag_test.go index 9e5625798e83..a818c1570337 100644 --- a/internal/service/ce/cost_allocation_tag_test.go +++ b/internal/service/ce/cost_allocation_tag_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/costexplorer" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ce/cost_category_data_source_test.go b/internal/service/ce/cost_category_data_source_test.go index a195c2e1fc90..0736d5a2ded1 100644 --- a/internal/service/ce/cost_category_data_source_test.go +++ b/internal/service/ce/cost_category_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/costexplorer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ce/cost_category_test.go b/internal/service/ce/cost_category_test.go index ee3595a62362..fe55c756c8c3 100644 --- a/internal/service/ce/cost_category_test.go +++ b/internal/service/ce/cost_category_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/costexplorer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfce "github.com/hashicorp/terraform-provider-aws/internal/service/ce" diff --git a/internal/service/ce/tags_data_source_test.go b/internal/service/ce/tags_data_source_test.go index 5d37130bf97a..dbbccbcaefcc 100644 --- a/internal/service/ce/tags_data_source_test.go +++ b/internal/service/ce/tags_data_source_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/aws/aws-sdk-go/service/costexplorer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/chime/voice_connector_group_test.go b/internal/service/chime/voice_connector_group_test.go index 4edf64dfb9e3..43b4050dfde4 100644 --- a/internal/service/chime/voice_connector_group_test.go +++ b/internal/service/chime/voice_connector_group_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_logging_test.go b/internal/service/chime/voice_connector_logging_test.go index 08a92ab8b801..908f6161b2f8 100644 --- a/internal/service/chime/voice_connector_logging_test.go +++ b/internal/service/chime/voice_connector_logging_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_origination_test.go b/internal/service/chime/voice_connector_origination_test.go index ee6a959dd5ee..781c93e99b7f 100644 --- a/internal/service/chime/voice_connector_origination_test.go +++ b/internal/service/chime/voice_connector_origination_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_streaming_test.go b/internal/service/chime/voice_connector_streaming_test.go index 06bfced4f753..2336bc5aa47a 100644 --- a/internal/service/chime/voice_connector_streaming_test.go +++ b/internal/service/chime/voice_connector_streaming_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/chime" "github.com/aws/aws-sdk-go/service/chimesdkvoice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_termination_credentials_test.go b/internal/service/chime/voice_connector_termination_credentials_test.go index 7ebbbe7222f0..883e8fdca3b9 100644 --- a/internal/service/chime/voice_connector_termination_credentials_test.go +++ b/internal/service/chime/voice_connector_termination_credentials_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_termination_test.go b/internal/service/chime/voice_connector_termination_test.go index 019ae3c65cd0..7a2320758a9c 100644 --- a/internal/service/chime/voice_connector_termination_test.go +++ b/internal/service/chime/voice_connector_termination_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chime/voice_connector_test.go b/internal/service/chime/voice_connector_test.go index 6b3142cddd79..2403124931bd 100644 --- a/internal/service/chime/voice_connector_test.go +++ b/internal/service/chime/voice_connector_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chime" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfchime "github.com/hashicorp/terraform-provider-aws/internal/service/chime" diff --git a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_test.go b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_test.go index e299eaa4e687..04ea77aa1400 100644 --- a/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_test.go +++ b/internal/service/chimesdkmediapipelines/media_insights_pipeline_configuration_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chimesdkmediapipelines" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/chimesdkvoice/voice_profile_domain_test.go b/internal/service/chimesdkvoice/voice_profile_domain_test.go index 5aaf63161f71..bdc534281eb8 100644 --- a/internal/service/chimesdkvoice/voice_profile_domain_test.go +++ b/internal/service/chimesdkvoice/voice_profile_domain_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/chimesdkvoice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/cloud9/environment_ec2_test.go b/internal/service/cloud9/environment_ec2_test.go index f6aa17ccb7a5..478a2e8a3077 100644 --- a/internal/service/cloud9/environment_ec2_test.go +++ b/internal/service/cloud9/environment_ec2_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloud9" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloud9 "github.com/hashicorp/terraform-provider-aws/internal/service/cloud9" diff --git a/internal/service/cloud9/environment_membership_test.go b/internal/service/cloud9/environment_membership_test.go index 7c2abd13e3fc..f6642d562286 100644 --- a/internal/service/cloud9/environment_membership_test.go +++ b/internal/service/cloud9/environment_membership_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloud9" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloud9 "github.com/hashicorp/terraform-provider-aws/internal/service/cloud9" diff --git a/internal/service/cloud9/sweep.go b/internal/service/cloud9/sweep.go index eda79277976c..3705252f984b 100644 --- a/internal/service/cloud9/sweep.go +++ b/internal/service/cloud9/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloud9" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cloudcontrol/resource_data_source_test.go b/internal/service/cloudcontrol/resource_data_source_test.go index 5dc773608135..1828b2af7d88 100644 --- a/internal/service/cloudcontrol/resource_data_source_test.go +++ b/internal/service/cloudcontrol/resource_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudcontrol/resource_test.go b/internal/service/cloudcontrol/resource_test.go index 3a8c5353293a..8f4813b5a31d 100644 --- a/internal/service/cloudcontrol/resource_test.go +++ b/internal/service/cloudcontrol/resource_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudcontrol "github.com/hashicorp/terraform-provider-aws/internal/service/cloudcontrol" diff --git a/internal/service/cloudformation/export_data_source_test.go b/internal/service/cloudformation/export_data_source_test.go index 2512bb195131..00431019b30d 100644 --- a/internal/service/cloudformation/export_data_source_test.go +++ b/internal/service/cloudformation/export_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudformation/stack_data_source_test.go b/internal/service/cloudformation/stack_data_source_test.go index be56c3fd252a..159170a70c78 100644 --- a/internal/service/cloudformation/stack_data_source_test.go +++ b/internal/service/cloudformation/stack_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudformation/stack_set_instance_test.go b/internal/service/cloudformation/stack_set_instance_test.go index 6bcca6d78d96..7fd74c3f9921 100644 --- a/internal/service/cloudformation/stack_set_instance_test.go +++ b/internal/service/cloudformation/stack_set_instance_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" diff --git a/internal/service/cloudformation/stack_set_test.go b/internal/service/cloudformation/stack_set_test.go index b5e0fd1466d5..e48ddcdab96e 100644 --- a/internal/service/cloudformation/stack_set_test.go +++ b/internal/service/cloudformation/stack_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" diff --git a/internal/service/cloudformation/stack_test.go b/internal/service/cloudformation/stack_test.go index 0358b89fa1cb..ee46c2ad3467 100644 --- a/internal/service/cloudformation/stack_test.go +++ b/internal/service/cloudformation/stack_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" diff --git a/internal/service/cloudformation/sweep.go b/internal/service/cloudformation/sweep.go index 90b0445b081d..819a14e0d981 100644 --- a/internal/service/cloudformation/sweep.go +++ b/internal/service/cloudformation/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cloudformation/type_data_source_test.go b/internal/service/cloudformation/type_data_source_test.go index 0675b43c1adc..dba6de99e97e 100644 --- a/internal/service/cloudformation/type_data_source_test.go +++ b/internal/service/cloudformation/type_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudformation/type_test.go b/internal/service/cloudformation/type_test.go index 55a0c8b287ca..87565e64687e 100644 --- a/internal/service/cloudformation/type_test.go +++ b/internal/service/cloudformation/type_test.go @@ -14,9 +14,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" diff --git a/internal/service/cloudfront/cache_policy_data_source_test.go b/internal/service/cloudfront/cache_policy_data_source_test.go index ebeb2f6ba45c..ef5ee39f7b8e 100644 --- a/internal/service/cloudfront/cache_policy_data_source_test.go +++ b/internal/service/cloudfront/cache_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/cache_policy_test.go b/internal/service/cloudfront/cache_policy_test.go index 05c52a0ffc72..c0dc785f2c32 100644 --- a/internal/service/cloudfront/cache_policy_test.go +++ b/internal/service/cloudfront/cache_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/distribution_data_source_test.go b/internal/service/cloudfront/distribution_data_source_test.go index 4c1cd8eb3005..e8ecf7b3d491 100644 --- a/internal/service/cloudfront/distribution_data_source_test.go +++ b/internal/service/cloudfront/distribution_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/distribution_test.go b/internal/service/cloudfront/distribution_test.go index ad71615058eb..8b954f4b5b7c 100644 --- a/internal/service/cloudfront/distribution_test.go +++ b/internal/service/cloudfront/distribution_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/field_level_encryption_config_test.go b/internal/service/cloudfront/field_level_encryption_config_test.go index 2509b795555a..7639e852b3f3 100644 --- a/internal/service/cloudfront/field_level_encryption_config_test.go +++ b/internal/service/cloudfront/field_level_encryption_config_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/field_level_encryption_profile_test.go b/internal/service/cloudfront/field_level_encryption_profile_test.go index c9034febd057..4891fc97eb5c 100644 --- a/internal/service/cloudfront/field_level_encryption_profile_test.go +++ b/internal/service/cloudfront/field_level_encryption_profile_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/function_data_source_test.go b/internal/service/cloudfront/function_data_source_test.go index 7a3f772c4fe8..262a2a2f7026 100644 --- a/internal/service/cloudfront/function_data_source_test.go +++ b/internal/service/cloudfront/function_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/function_test.go b/internal/service/cloudfront/function_test.go index 9c001d4ee947..a0a76a8d6c38 100644 --- a/internal/service/cloudfront/function_test.go +++ b/internal/service/cloudfront/function_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/key_group_test.go b/internal/service/cloudfront/key_group_test.go index 57c88d25093a..ca78e067e83d 100644 --- a/internal/service/cloudfront/key_group_test.go +++ b/internal/service/cloudfront/key_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/log_delivery_canonical_user_id_data_source_test.go b/internal/service/cloudfront/log_delivery_canonical_user_id_data_source_test.go index d8ac73a612c6..1a729e6c3f46 100644 --- a/internal/service/cloudfront/log_delivery_canonical_user_id_data_source_test.go +++ b/internal/service/cloudfront/log_delivery_canonical_user_id_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/monitoring_subscription_test.go b/internal/service/cloudfront/monitoring_subscription_test.go index 8a1a76879da9..f651a949c7bf 100644 --- a/internal/service/cloudfront/monitoring_subscription_test.go +++ b/internal/service/cloudfront/monitoring_subscription_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/origin_access_control_test.go b/internal/service/cloudfront/origin_access_control_test.go index caa3a3619d7b..70c34153e0ff 100644 --- a/internal/service/cloudfront/origin_access_control_test.go +++ b/internal/service/cloudfront/origin_access_control_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/cloudfront/origin_access_identities_data_source_test.go b/internal/service/cloudfront/origin_access_identities_data_source_test.go index c7d241068fcb..284309c2b1eb 100644 --- a/internal/service/cloudfront/origin_access_identities_data_source_test.go +++ b/internal/service/cloudfront/origin_access_identities_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/origin_access_identity_data_source_test.go b/internal/service/cloudfront/origin_access_identity_data_source_test.go index 2e068757715e..da6d138fe23d 100644 --- a/internal/service/cloudfront/origin_access_identity_data_source_test.go +++ b/internal/service/cloudfront/origin_access_identity_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/origin_access_identity_test.go b/internal/service/cloudfront/origin_access_identity_test.go index 5546680bcf67..dfa6b90f478f 100644 --- a/internal/service/cloudfront/origin_access_identity_test.go +++ b/internal/service/cloudfront/origin_access_identity_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/origin_request_policy_data_source_test.go b/internal/service/cloudfront/origin_request_policy_data_source_test.go index 8049d96c2920..b8746b4fe082 100644 --- a/internal/service/cloudfront/origin_request_policy_data_source_test.go +++ b/internal/service/cloudfront/origin_request_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/origin_request_policy_test.go b/internal/service/cloudfront/origin_request_policy_test.go index ee86184ae7f4..651516f53502 100644 --- a/internal/service/cloudfront/origin_request_policy_test.go +++ b/internal/service/cloudfront/origin_request_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/public_key_test.go b/internal/service/cloudfront/public_key_test.go index bef8d2533b53..cf6b9db5fa4e 100644 --- a/internal/service/cloudfront/public_key_test.go +++ b/internal/service/cloudfront/public_key_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/realtime_log_config_data_source_test.go b/internal/service/cloudfront/realtime_log_config_data_source_test.go index 59302c96defe..badb9e07c4eb 100644 --- a/internal/service/cloudfront/realtime_log_config_data_source_test.go +++ b/internal/service/cloudfront/realtime_log_config_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/realtime_log_config_test.go b/internal/service/cloudfront/realtime_log_config_test.go index 4e6edf92af15..66428152e11f 100644 --- a/internal/service/cloudfront/realtime_log_config_test.go +++ b/internal/service/cloudfront/realtime_log_config_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/response_headers_policy_data_source_test.go b/internal/service/cloudfront/response_headers_policy_data_source_test.go index 57799bea2d35..2cacecabff26 100644 --- a/internal/service/cloudfront/response_headers_policy_data_source_test.go +++ b/internal/service/cloudfront/response_headers_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudfront/response_headers_policy_test.go b/internal/service/cloudfront/response_headers_policy_test.go index 21010358226a..74608af7c439 100644 --- a/internal/service/cloudfront/response_headers_policy_test.go +++ b/internal/service/cloudfront/response_headers_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudfront" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudfront "github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront" diff --git a/internal/service/cloudfront/sweep.go b/internal/service/cloudfront/sweep.go index 88e1e2c2b307..5492e6e58aa1 100644 --- a/internal/service/cloudfront/sweep.go +++ b/internal/service/cloudfront/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/cloudfront/validate_test.go b/internal/service/cloudfront/validate_test.go index db2d4c3cb8fc..6493517af08c 100644 --- a/internal/service/cloudfront/validate_test.go +++ b/internal/service/cloudfront/validate_test.go @@ -3,7 +3,7 @@ package cloudfront import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidPublicKeyName(t *testing.T) { diff --git a/internal/service/cloudhsmv2/cluster_data_source_test.go b/internal/service/cloudhsmv2/cluster_data_source_test.go index e59b5274e391..5bdf3ba4b822 100644 --- a/internal/service/cloudhsmv2/cluster_data_source_test.go +++ b/internal/service/cloudhsmv2/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudhsmv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cloudhsmv2/cluster_test.go b/internal/service/cloudhsmv2/cluster_test.go index f1a3fc4e681d..e8264ec55a64 100644 --- a/internal/service/cloudhsmv2/cluster_test.go +++ b/internal/service/cloudhsmv2/cluster_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudhsmv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudhsmv2 "github.com/hashicorp/terraform-provider-aws/internal/service/cloudhsmv2" diff --git a/internal/service/cloudhsmv2/hsm_test.go b/internal/service/cloudhsmv2/hsm_test.go index f4b791c08b52..29ff8c75ac43 100644 --- a/internal/service/cloudhsmv2/hsm_test.go +++ b/internal/service/cloudhsmv2/hsm_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudhsmv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudhsmv2 "github.com/hashicorp/terraform-provider-aws/internal/service/cloudhsmv2" diff --git a/internal/service/cloudhsmv2/sweep.go b/internal/service/cloudhsmv2/sweep.go index 85ac8dc04a1d..e8595ed4347f 100644 --- a/internal/service/cloudhsmv2/sweep.go +++ b/internal/service/cloudhsmv2/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudhsmv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cloudsearch/domain_service_access_policy_test.go b/internal/service/cloudsearch/domain_service_access_policy_test.go index 698c79bbeca2..eab083baf35f 100644 --- a/internal/service/cloudsearch/domain_service_access_policy_test.go +++ b/internal/service/cloudsearch/domain_service_access_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudsearch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudsearch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudsearch" diff --git a/internal/service/cloudsearch/domain_test.go b/internal/service/cloudsearch/domain_test.go index d59e6ac2dd87..52917b4e6ebf 100644 --- a/internal/service/cloudsearch/domain_test.go +++ b/internal/service/cloudsearch/domain_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudsearch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudsearch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudsearch" diff --git a/internal/service/cloudsearch/sweep.go b/internal/service/cloudsearch/sweep.go index 56406f98db8a..4f1fb2d88468 100644 --- a/internal/service/cloudsearch/sweep.go +++ b/internal/service/cloudsearch/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudsearch" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cloudtrail/cloudtrail_test.go b/internal/service/cloudtrail/cloudtrail_test.go index 63c92b0db850..37c370cebb2e 100644 --- a/internal/service/cloudtrail/cloudtrail_test.go +++ b/internal/service/cloudtrail/cloudtrail_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudtrail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" diff --git a/internal/service/cloudtrail/event_data_store_test.go b/internal/service/cloudtrail/event_data_store_test.go index deaab87ccc16..98459b62356b 100644 --- a/internal/service/cloudtrail/event_data_store_test.go +++ b/internal/service/cloudtrail/event_data_store_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudtrail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" diff --git a/internal/service/cloudtrail/service_account_data_source_test.go b/internal/service/cloudtrail/service_account_data_source_test.go index d728a3e215b5..891c20e1cd09 100644 --- a/internal/service/cloudtrail/service_account_data_source_test.go +++ b/internal/service/cloudtrail/service_account_data_source_test.go @@ -3,7 +3,7 @@ package cloudtrail_test import ( "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfcloudtrail "github.com/hashicorp/terraform-provider-aws/internal/service/cloudtrail" ) diff --git a/internal/service/cloudtrail/sweep.go b/internal/service/cloudtrail/sweep.go index 49d1ed74ae60..c5f02e0eec4c 100644 --- a/internal/service/cloudtrail/sweep.go +++ b/internal/service/cloudtrail/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/cloudtrail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cloudwatch/composite_alarm_test.go b/internal/service/cloudwatch/composite_alarm_test.go index 8cc018fc19d9..73ab07006583 100644 --- a/internal/service/cloudwatch/composite_alarm_test.go +++ b/internal/service/cloudwatch/composite_alarm_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" diff --git a/internal/service/cloudwatch/dashboard_test.go b/internal/service/cloudwatch/dashboard_test.go index 3a59be878c58..6cb630e0d8b7 100644 --- a/internal/service/cloudwatch/dashboard_test.go +++ b/internal/service/cloudwatch/dashboard_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" diff --git a/internal/service/cloudwatch/metric_alarm_test.go b/internal/service/cloudwatch/metric_alarm_test.go index 7376ba806711..2340e8428abe 100755 --- a/internal/service/cloudwatch/metric_alarm_test.go +++ b/internal/service/cloudwatch/metric_alarm_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" diff --git a/internal/service/cloudwatch/metric_stream_test.go b/internal/service/cloudwatch/metric_stream_test.go index 2a0bc4e31be7..7ac21d17f01c 100644 --- a/internal/service/cloudwatch/metric_stream_test.go +++ b/internal/service/cloudwatch/metric_stream_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatch" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatch "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" diff --git a/internal/service/cloudwatch/sweep.go b/internal/service/cloudwatch/sweep.go index 47c1deba63cf..f4619bc40da2 100644 --- a/internal/service/cloudwatch/sweep.go +++ b/internal/service/cloudwatch/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codeartifact/authorization_token_data_source_test.go b/internal/service/codeartifact/authorization_token_data_source_test.go index d0b55e2e0084..d1924de8a8ef 100644 --- a/internal/service/codeartifact/authorization_token_data_source_test.go +++ b/internal/service/codeartifact/authorization_token_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codeartifact" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/codeartifact/domain_permissions_policy_test.go b/internal/service/codeartifact/domain_permissions_policy_test.go index 2b3cce32af38..4fb87b25aee8 100644 --- a/internal/service/codeartifact/domain_permissions_policy_test.go +++ b/internal/service/codeartifact/domain_permissions_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" diff --git a/internal/service/codeartifact/domain_test.go b/internal/service/codeartifact/domain_test.go index e6dcfeef50d2..9b28ecc718d5 100644 --- a/internal/service/codeartifact/domain_test.go +++ b/internal/service/codeartifact/domain_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" diff --git a/internal/service/codeartifact/repository_endpoint_data_source_test.go b/internal/service/codeartifact/repository_endpoint_data_source_test.go index 5c16abe5473e..375cc03ad3b4 100644 --- a/internal/service/codeartifact/repository_endpoint_data_source_test.go +++ b/internal/service/codeartifact/repository_endpoint_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codeartifact" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/codeartifact/repository_permissions_policy_test.go b/internal/service/codeartifact/repository_permissions_policy_test.go index fe0ef48422ad..309e42cb6868 100644 --- a/internal/service/codeartifact/repository_permissions_policy_test.go +++ b/internal/service/codeartifact/repository_permissions_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" diff --git a/internal/service/codeartifact/repository_test.go b/internal/service/codeartifact/repository_test.go index 912236d4d55d..0f7517c025a8 100644 --- a/internal/service/codeartifact/repository_test.go +++ b/internal/service/codeartifact/repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodeartifact "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" diff --git a/internal/service/codeartifact/sweep.go b/internal/service/codeartifact/sweep.go index e859c5991215..b5d135503bef 100644 --- a/internal/service/codeartifact/sweep.go +++ b/internal/service/codeartifact/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codebuild/project_test.go b/internal/service/codebuild/project_test.go index 07e358911ac2..8bdf09776f2e 100644 --- a/internal/service/codebuild/project_test.go +++ b/internal/service/codebuild/project_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codebuild" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" diff --git a/internal/service/codebuild/report_group_test.go b/internal/service/codebuild/report_group_test.go index b8bf5fd37073..4b98f3cb3f1b 100644 --- a/internal/service/codebuild/report_group_test.go +++ b/internal/service/codebuild/report_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codebuild" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" diff --git a/internal/service/codebuild/resource_policy_test.go b/internal/service/codebuild/resource_policy_test.go index 5cfdad446b38..584f052da430 100644 --- a/internal/service/codebuild/resource_policy_test.go +++ b/internal/service/codebuild/resource_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codebuild" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" diff --git a/internal/service/codebuild/source_credential_test.go b/internal/service/codebuild/source_credential_test.go index 0d9dcf03be73..83e2cdeedc5f 100644 --- a/internal/service/codebuild/source_credential_test.go +++ b/internal/service/codebuild/source_credential_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codebuild" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodebuild "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" diff --git a/internal/service/codebuild/sweep.go b/internal/service/codebuild/sweep.go index c3db3da86963..0e8f6fd482a5 100644 --- a/internal/service/codebuild/sweep.go +++ b/internal/service/codebuild/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codebuild" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codebuild/webhook_test.go b/internal/service/codebuild/webhook_test.go index 988d08ac773a..ccd0af560fd0 100644 --- a/internal/service/codebuild/webhook_test.go +++ b/internal/service/codebuild/webhook_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codebuild" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/codecommit/approval_rule_template_association_test.go b/internal/service/codecommit/approval_rule_template_association_test.go index 6ad8b954e093..cab6e8741da7 100644 --- a/internal/service/codecommit/approval_rule_template_association_test.go +++ b/internal/service/codecommit/approval_rule_template_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codecommit" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" diff --git a/internal/service/codecommit/approval_rule_template_data_source_test.go b/internal/service/codecommit/approval_rule_template_data_source_test.go index 9891c0ed7b56..af906d26b6ac 100644 --- a/internal/service/codecommit/approval_rule_template_data_source_test.go +++ b/internal/service/codecommit/approval_rule_template_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codecommit" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/codecommit/approval_rule_template_test.go b/internal/service/codecommit/approval_rule_template_test.go index d3a4ed06ef44..f734a11a6453 100644 --- a/internal/service/codecommit/approval_rule_template_test.go +++ b/internal/service/codecommit/approval_rule_template_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codecommit" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodecommit "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" diff --git a/internal/service/codecommit/repository_data_source_test.go b/internal/service/codecommit/repository_data_source_test.go index 10e4f0cdbf82..4f5e19386e85 100644 --- a/internal/service/codecommit/repository_data_source_test.go +++ b/internal/service/codecommit/repository_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codecommit" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/codecommit/repository_test.go b/internal/service/codecommit/repository_test.go index 81f2cdeb6497..8d6fe8a5400a 100644 --- a/internal/service/codecommit/repository_test.go +++ b/internal/service/codecommit/repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codecommit" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/codecommit/trigger_test.go b/internal/service/codecommit/trigger_test.go index 1c29a9130a0d..84ecd61e9dee 100644 --- a/internal/service/codecommit/trigger_test.go +++ b/internal/service/codecommit/trigger_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codecommit" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index cb6337eb89e9..0f4d474269b2 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codegurureviewer" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/codegurureviewer/sweep.go b/internal/service/codegurureviewer/sweep.go index 1becaa2747fc..dbc5a7b9466e 100644 --- a/internal/service/codegurureviewer/sweep.go +++ b/internal/service/codegurureviewer/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codegurureviewer" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codepipeline/codepipeline_test.go b/internal/service/codepipeline/codepipeline_test.go index 3cf07baa5274..6f89104b3261 100644 --- a/internal/service/codepipeline/codepipeline_test.go +++ b/internal/service/codepipeline/codepipeline_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/codepipeline" "github.com/aws/aws-sdk-go/service/codestarconnections" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/codepipeline/custom_action_type_test.go b/internal/service/codepipeline/custom_action_type_test.go index d932ed4949b1..a6fba1249f10 100644 --- a/internal/service/codepipeline/custom_action_type_test.go +++ b/internal/service/codepipeline/custom_action_type_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/codepipeline" "github.com/aws/aws-sdk-go/service/codestarconnections" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodepipeline "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" diff --git a/internal/service/codepipeline/sweep.go b/internal/service/codepipeline/sweep.go index 952e11fbb60a..71b79ef3acde 100644 --- a/internal/service/codepipeline/sweep.go +++ b/internal/service/codepipeline/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codepipeline" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codepipeline/webhook_test.go b/internal/service/codepipeline/webhook_test.go index 013905c6e0c1..c65f2ce61564 100644 --- a/internal/service/codepipeline/webhook_test.go +++ b/internal/service/codepipeline/webhook_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codepipeline" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/codestarconnections/connection_data_source_test.go b/internal/service/codestarconnections/connection_data_source_test.go index 276d901732cd..37033b456ec2 100644 --- a/internal/service/codestarconnections/connection_data_source_test.go +++ b/internal/service/codestarconnections/connection_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codestarconnections" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/codestarconnections/connection_test.go b/internal/service/codestarconnections/connection_test.go index ad6837382593..7634a0c598e6 100644 --- a/internal/service/codestarconnections/connection_test.go +++ b/internal/service/codestarconnections/connection_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codestarconnections" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodestarconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" diff --git a/internal/service/codestarconnections/host_test.go b/internal/service/codestarconnections/host_test.go index 27d08866d0fc..5b2dcac40486 100644 --- a/internal/service/codestarconnections/host_test.go +++ b/internal/service/codestarconnections/host_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/codestarconnections" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodestarconnections "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" diff --git a/internal/service/codestarconnections/sweep.go b/internal/service/codestarconnections/sweep.go index 193aa2d228d8..15ca1dd51bcb 100644 --- a/internal/service/codestarconnections/sweep.go +++ b/internal/service/codestarconnections/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codestarconnections" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/codestarnotifications/notification_rule_test.go b/internal/service/codestarnotifications/notification_rule_test.go index e7c8bd8cc369..753421d6a37f 100644 --- a/internal/service/codestarnotifications/notification_rule_test.go +++ b/internal/service/codestarnotifications/notification_rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codestarnotifications" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/cognitoidentity/pool_provider_principal_tag_test.go b/internal/service/cognitoidentity/pool_provider_principal_tag_test.go index b75ffc037d84..9ef54e5ae99e 100644 --- a/internal/service/cognitoidentity/pool_provider_principal_tag_test.go +++ b/internal/service/cognitoidentity/pool_provider_principal_tag_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidentity "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidentity" diff --git a/internal/service/cognitoidentity/pool_roles_attachment_test.go b/internal/service/cognitoidentity/pool_roles_attachment_test.go index 07c00a77b582..d139a741d981 100644 --- a/internal/service/cognitoidentity/pool_roles_attachment_test.go +++ b/internal/service/cognitoidentity/pool_roles_attachment_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidentity "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidentity" diff --git a/internal/service/cognitoidentity/pool_test.go b/internal/service/cognitoidentity/pool_test.go index 8189ad4d1df4..2fb1c9cff3aa 100644 --- a/internal/service/cognitoidentity/pool_test.go +++ b/internal/service/cognitoidentity/pool_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidentity "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidentity" diff --git a/internal/service/cognitoidp/identity_provider_test.go b/internal/service/cognitoidp/identity_provider_test.go index a41278b16baf..95e7b4ad817b 100644 --- a/internal/service/cognitoidp/identity_provider_test.go +++ b/internal/service/cognitoidp/identity_provider_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/managed_user_pool_client_test.go b/internal/service/cognitoidp/managed_user_pool_client_test.go index 159397323fa5..6f893f20e433 100644 --- a/internal/service/cognitoidp/managed_user_pool_client_test.go +++ b/internal/service/cognitoidp/managed_user_pool_client_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" ) diff --git a/internal/service/cognitoidp/resource_server_test.go b/internal/service/cognitoidp/resource_server_test.go index c230649c8072..6ea023cc790d 100644 --- a/internal/service/cognitoidp/resource_server_test.go +++ b/internal/service/cognitoidp/resource_server_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/risk_configuration_test.go b/internal/service/cognitoidp/risk_configuration_test.go index a0503c3f2155..3f84b0866b7c 100644 --- a/internal/service/cognitoidp/risk_configuration_test.go +++ b/internal/service/cognitoidp/risk_configuration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/sweep.go b/internal/service/cognitoidp/sweep.go index 6148bedf58d0..bbe4a2762d55 100644 --- a/internal/service/cognitoidp/sweep.go +++ b/internal/service/cognitoidp/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/cognitoidp/user_group_test.go b/internal/service/cognitoidp/user_group_test.go index 3a522788d5fa..505135e8d0ae 100644 --- a/internal/service/cognitoidp/user_group_test.go +++ b/internal/service/cognitoidp/user_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/cognitoidp/user_in_group_test.go b/internal/service/cognitoidp/user_in_group_test.go index 8538555a0785..74446959ed50 100644 --- a/internal/service/cognitoidp/user_in_group_test.go +++ b/internal/service/cognitoidp/user_in_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/user_pool_client_data_source_test.go b/internal/service/cognitoidp/user_pool_client_data_source_test.go index 334bb3f3cb89..c18a7871aa25 100644 --- a/internal/service/cognitoidp/user_pool_client_data_source_test.go +++ b/internal/service/cognitoidp/user_pool_client_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cognitoidp/user_pool_client_test.go b/internal/service/cognitoidp/user_pool_client_test.go index 93f75b030c40..3b2123225d49 100644 --- a/internal/service/cognitoidp/user_pool_client_test.go +++ b/internal/service/cognitoidp/user_pool_client_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/pinpoint" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/user_pool_clients_data_source_test.go b/internal/service/cognitoidp/user_pool_clients_data_source_test.go index 304d20a92bea..2a888e3c2988 100644 --- a/internal/service/cognitoidp/user_pool_clients_data_source_test.go +++ b/internal/service/cognitoidp/user_pool_clients_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index e13a8a520ac7..8d5e880b1ae2 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/user_pool_signing_certificate_data_source_test.go b/internal/service/cognitoidp/user_pool_signing_certificate_data_source_test.go index 9a7f1f913b35..e808b8a1dfd3 100644 --- a/internal/service/cognitoidp/user_pool_signing_certificate_data_source_test.go +++ b/internal/service/cognitoidp/user_pool_signing_certificate_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 0f7ecd02fbbd..2a5c54fe9a87 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/user_pool_ui_customization_test.go b/internal/service/cognitoidp/user_pool_ui_customization_test.go index 20b68338fff4..f6df2abaa5dd 100644 --- a/internal/service/cognitoidp/user_pool_ui_customization_test.go +++ b/internal/service/cognitoidp/user_pool_ui_customization_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/cognitoidp/user_pools_data_source_test.go b/internal/service/cognitoidp/user_pools_data_source_test.go index d756316b5ff4..b4a104c4b9e8 100644 --- a/internal/service/cognitoidp/user_pools_data_source_test.go +++ b/internal/service/cognitoidp/user_pools_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cognitoidp/user_test.go b/internal/service/cognitoidp/user_test.go index 7c2807026a75..36eb401ea56f 100644 --- a/internal/service/cognitoidp/user_test.go +++ b/internal/service/cognitoidp/user_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcognitoidp "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" diff --git a/internal/service/comprehend/document_classifier_test.go b/internal/service/comprehend/document_classifier_test.go index 11ab07f3dc6e..99cbe105dd6d 100644 --- a/internal/service/comprehend/document_classifier_test.go +++ b/internal/service/comprehend/document_classifier_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/comprehend" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcomprehend "github.com/hashicorp/terraform-provider-aws/internal/service/comprehend" diff --git a/internal/service/comprehend/entity_recognizer_test.go b/internal/service/comprehend/entity_recognizer_test.go index 09c36824c062..2c55b82ffd22 100644 --- a/internal/service/comprehend/entity_recognizer_test.go +++ b/internal/service/comprehend/entity_recognizer_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/comprehend" "github.com/aws/aws-sdk-go-v2/service/comprehend/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcomprehend "github.com/hashicorp/terraform-provider-aws/internal/service/comprehend" diff --git a/internal/service/configservice/config_rule_test.go b/internal/service/configservice/config_rule_test.go index 1b0d2cb75052..522e1e42b4cc 100644 --- a/internal/service/configservice/config_rule_test.go +++ b/internal/service/configservice/config_rule_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" diff --git a/internal/service/configservice/configuration_aggregator_test.go b/internal/service/configservice/configuration_aggregator_test.go index f1109b2f4048..2b0b6cb7ef6b 100644 --- a/internal/service/configservice/configuration_aggregator_test.go +++ b/internal/service/configservice/configuration_aggregator_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" diff --git a/internal/service/configservice/configuration_recorder_status_test.go b/internal/service/configservice/configuration_recorder_status_test.go index 7b8ee5ec74a5..23de77510958 100644 --- a/internal/service/configservice/configuration_recorder_status_test.go +++ b/internal/service/configservice/configuration_recorder_status_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/configservice/configuration_recorder_test.go b/internal/service/configservice/configuration_recorder_test.go index 947d52bb7e69..61363619597f 100644 --- a/internal/service/configservice/configuration_recorder_test.go +++ b/internal/service/configservice/configuration_recorder_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/configservice/conformance_pack_test.go b/internal/service/configservice/conformance_pack_test.go index 992cfea5fdea..dc677e9832a4 100644 --- a/internal/service/configservice/conformance_pack_test.go +++ b/internal/service/configservice/conformance_pack_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" diff --git a/internal/service/configservice/delivery_channel_test.go b/internal/service/configservice/delivery_channel_test.go index c61580642e7f..b40e5acb2453 100644 --- a/internal/service/configservice/delivery_channel_test.go +++ b/internal/service/configservice/delivery_channel_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/configservice/organization_conformance_pack_test.go b/internal/service/configservice/organization_conformance_pack_test.go index 7cda954c0d0c..36445abde32b 100644 --- a/internal/service/configservice/organization_conformance_pack_test.go +++ b/internal/service/configservice/organization_conformance_pack_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" diff --git a/internal/service/configservice/organization_custom_policy_rule_test.go b/internal/service/configservice/organization_custom_policy_rule_test.go index 31f4f129fd7f..ecf22d094019 100644 --- a/internal/service/configservice/organization_custom_policy_rule_test.go +++ b/internal/service/configservice/organization_custom_policy_rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/configservice/organization_custom_rule_test.go b/internal/service/configservice/organization_custom_rule_test.go index 7dfaa61e8e9f..45042df5e86b 100644 --- a/internal/service/configservice/organization_custom_rule_test.go +++ b/internal/service/configservice/organization_custom_rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/configservice/organization_managed_rule_test.go b/internal/service/configservice/organization_managed_rule_test.go index 0fcbc2a58cf4..43baab30f5ea 100644 --- a/internal/service/configservice/organization_managed_rule_test.go +++ b/internal/service/configservice/organization_managed_rule_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconfig "github.com/hashicorp/terraform-provider-aws/internal/service/configservice" diff --git a/internal/service/configservice/remediation_configuration_test.go b/internal/service/configservice/remediation_configuration_test.go index 3c7666e60e1a..d7483cd6e50e 100644 --- a/internal/service/configservice/remediation_configuration_test.go +++ b/internal/service/configservice/remediation_configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/configservice/sweep.go b/internal/service/configservice/sweep.go index da1bace06158..212747d5c7c7 100644 --- a/internal/service/configservice/sweep.go +++ b/internal/service/configservice/sweep.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/connect/bot_association_data_source_test.go b/internal/service/connect/bot_association_data_source_test.go index 9df9450f87d1..b09e0edfb75e 100644 --- a/internal/service/connect/bot_association_data_source_test.go +++ b/internal/service/connect/bot_association_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/bot_association_test.go b/internal/service/connect/bot_association_test.go index e356936b36a8..13da007c90d1 100644 --- a/internal/service/connect/bot_association_test.go +++ b/internal/service/connect/bot_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/contact_flow_data_source_test.go b/internal/service/connect/contact_flow_data_source_test.go index b9cf8e10cb05..c0292eb9e52a 100644 --- a/internal/service/connect/contact_flow_data_source_test.go +++ b/internal/service/connect/contact_flow_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/contact_flow_module_data_source_test.go b/internal/service/connect/contact_flow_module_data_source_test.go index e4c4e03754d0..82f8c22087b6 100644 --- a/internal/service/connect/contact_flow_module_data_source_test.go +++ b/internal/service/connect/contact_flow_module_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/contact_flow_module_test.go b/internal/service/connect/contact_flow_module_test.go index 67ebce63e1ca..66f18f9f912b 100644 --- a/internal/service/connect/contact_flow_module_test.go +++ b/internal/service/connect/contact_flow_module_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/contact_flow_test.go b/internal/service/connect/contact_flow_test.go index 63df98c624b6..7a97383516d0 100644 --- a/internal/service/connect/contact_flow_test.go +++ b/internal/service/connect/contact_flow_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/hours_of_operation_data_source_test.go b/internal/service/connect/hours_of_operation_data_source_test.go index 678d2b394047..c275f0044f58 100644 --- a/internal/service/connect/hours_of_operation_data_source_test.go +++ b/internal/service/connect/hours_of_operation_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/hours_of_operation_test.go b/internal/service/connect/hours_of_operation_test.go index a915972bb2f5..e33b1a40beba 100644 --- a/internal/service/connect/hours_of_operation_test.go +++ b/internal/service/connect/hours_of_operation_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/instance_data_source_test.go b/internal/service/connect/instance_data_source_test.go index 698305ae1eea..ee1e838e8df2 100644 --- a/internal/service/connect/instance_data_source_test.go +++ b/internal/service/connect/instance_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/instance_storage_config_data_source_test.go b/internal/service/connect/instance_storage_config_data_source_test.go index 87bd4fb0cff6..6c2df116535d 100644 --- a/internal/service/connect/instance_storage_config_data_source_test.go +++ b/internal/service/connect/instance_storage_config_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/instance_storage_config_test.go b/internal/service/connect/instance_storage_config_test.go index a29a3b484f99..4bf6bc8490d6 100644 --- a/internal/service/connect/instance_storage_config_test.go +++ b/internal/service/connect/instance_storage_config_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/instance_test.go b/internal/service/connect/instance_test.go index 2bd790a74c55..f8af578a359a 100644 --- a/internal/service/connect/instance_test.go +++ b/internal/service/connect/instance_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/connect/lambda_function_association_data_source_test.go b/internal/service/connect/lambda_function_association_data_source_test.go index 418fbc8e8274..f70070218c16 100644 --- a/internal/service/connect/lambda_function_association_data_source_test.go +++ b/internal/service/connect/lambda_function_association_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/lambda_function_association_test.go b/internal/service/connect/lambda_function_association_test.go index 94f555853362..5a73709599b6 100644 --- a/internal/service/connect/lambda_function_association_test.go +++ b/internal/service/connect/lambda_function_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/phone_number_test.go b/internal/service/connect/phone_number_test.go index 25886314479f..68f361e0e8ab 100644 --- a/internal/service/connect/phone_number_test.go +++ b/internal/service/connect/phone_number_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/prompt_data_source_test.go b/internal/service/connect/prompt_data_source_test.go index 0da58c36b21a..3efad2f15609 100644 --- a/internal/service/connect/prompt_data_source_test.go +++ b/internal/service/connect/prompt_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/queue_data_source_test.go b/internal/service/connect/queue_data_source_test.go index 318bdda5ef84..e2eb1347758f 100644 --- a/internal/service/connect/queue_data_source_test.go +++ b/internal/service/connect/queue_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/queue_test.go b/internal/service/connect/queue_test.go index 635629215f8a..e54f3f477ebf 100644 --- a/internal/service/connect/queue_test.go +++ b/internal/service/connect/queue_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/quick_connect_data_source_test.go b/internal/service/connect/quick_connect_data_source_test.go index 0fe0c585f3bc..22e102836000 100644 --- a/internal/service/connect/quick_connect_data_source_test.go +++ b/internal/service/connect/quick_connect_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/quick_connect_test.go b/internal/service/connect/quick_connect_test.go index 0d05539f78b3..4eadddf4e1f7 100644 --- a/internal/service/connect/quick_connect_test.go +++ b/internal/service/connect/quick_connect_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/routing_profile_data_source_test.go b/internal/service/connect/routing_profile_data_source_test.go index acab8cc4fbd2..309ac12603d4 100644 --- a/internal/service/connect/routing_profile_data_source_test.go +++ b/internal/service/connect/routing_profile_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/routing_profile_test.go b/internal/service/connect/routing_profile_test.go index 2c981eb7c384..0357a80ed388 100644 --- a/internal/service/connect/routing_profile_test.go +++ b/internal/service/connect/routing_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/security_profile_data_source_test.go b/internal/service/connect/security_profile_data_source_test.go index 320d62aa9c44..4c28629ca19f 100644 --- a/internal/service/connect/security_profile_data_source_test.go +++ b/internal/service/connect/security_profile_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/security_profile_test.go b/internal/service/connect/security_profile_test.go index bc51bbf33f10..76204aeade28 100644 --- a/internal/service/connect/security_profile_test.go +++ b/internal/service/connect/security_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/sweep.go b/internal/service/connect/sweep.go index 35bca5f3dd4e..9ce6a7c055e3 100644 --- a/internal/service/connect/sweep.go +++ b/internal/service/connect/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/connect/user_hierarchy_group_data_source_test.go b/internal/service/connect/user_hierarchy_group_data_source_test.go index c46c37209409..b360f1136515 100644 --- a/internal/service/connect/user_hierarchy_group_data_source_test.go +++ b/internal/service/connect/user_hierarchy_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/user_hierarchy_group_test.go b/internal/service/connect/user_hierarchy_group_test.go index 367e72304d12..c45d91b4c3a3 100644 --- a/internal/service/connect/user_hierarchy_group_test.go +++ b/internal/service/connect/user_hierarchy_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/user_hierarchy_structure_data_source_test.go b/internal/service/connect/user_hierarchy_structure_data_source_test.go index b14d43500245..95d16acc1ffb 100644 --- a/internal/service/connect/user_hierarchy_structure_data_source_test.go +++ b/internal/service/connect/user_hierarchy_structure_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/connect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/user_hierarchy_structure_test.go b/internal/service/connect/user_hierarchy_structure_test.go index 206f207002e2..a53145f9d50f 100644 --- a/internal/service/connect/user_hierarchy_structure_test.go +++ b/internal/service/connect/user_hierarchy_structure_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/user_test.go b/internal/service/connect/user_test.go index 9106773e9286..5eccb60ecb06 100644 --- a/internal/service/connect/user_test.go +++ b/internal/service/connect/user_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/connect/vocabulary_test.go b/internal/service/connect/vocabulary_test.go index aebef8c3aaca..5147ddb535a7 100644 --- a/internal/service/connect/vocabulary_test.go +++ b/internal/service/connect/vocabulary_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfconnect "github.com/hashicorp/terraform-provider-aws/internal/service/connect" diff --git a/internal/service/controltower/control_test.go b/internal/service/controltower/control_test.go index ef09f6df6409..dcf6636357d1 100644 --- a/internal/service/controltower/control_test.go +++ b/internal/service/controltower/control_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/controltower" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfcontroltower "github.com/hashicorp/terraform-provider-aws/internal/service/controltower" diff --git a/internal/service/controltower/controls_data_source_test.go b/internal/service/controltower/controls_data_source_test.go index 3b87f5042f6a..9879e244ef3a 100644 --- a/internal/service/controltower/controls_data_source_test.go +++ b/internal/service/controltower/controls_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/service/cloudtrail" "github.com/aws/aws-sdk-go/service/controltower" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/cur/report_definition_data_source_test.go b/internal/service/cur/report_definition_data_source_test.go index a5069fc79d3a..e3052c42c2b0 100644 --- a/internal/service/cur/report_definition_data_source_test.go +++ b/internal/service/cur/report_definition_data_source_test.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" cur "github.com/aws/aws-sdk-go/service/costandusagereportservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/cur/report_definition_test.go b/internal/service/cur/report_definition_test.go index 4f928fb0f0c8..36e63bab9b5a 100644 --- a/internal/service/cur/report_definition_test.go +++ b/internal/service/cur/report_definition_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" cur "github.com/aws/aws-sdk-go/service/costandusagereportservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcur "github.com/hashicorp/terraform-provider-aws/internal/service/cur" diff --git a/internal/service/cur/sweep.go b/internal/service/cur/sweep.go index 729ddef0cf49..9b6b02e3d0ec 100644 --- a/internal/service/cur/sweep.go +++ b/internal/service/cur/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" cur "github.com/aws/aws-sdk-go/service/costandusagereportservice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/dataexchange/data_set_test.go b/internal/service/dataexchange/data_set_test.go index 2fd1b3ec888f..ae9e9222803e 100644 --- a/internal/service/dataexchange/data_set_test.go +++ b/internal/service/dataexchange/data_set_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/dataexchange" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdataexchange "github.com/hashicorp/terraform-provider-aws/internal/service/dataexchange" diff --git a/internal/service/dataexchange/revision_test.go b/internal/service/dataexchange/revision_test.go index b88c2ff1700f..888538b2f9ae 100644 --- a/internal/service/dataexchange/revision_test.go +++ b/internal/service/dataexchange/revision_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/dataexchange" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdataexchange "github.com/hashicorp/terraform-provider-aws/internal/service/dataexchange" diff --git a/internal/service/dataexchange/sweep.go b/internal/service/dataexchange/sweep.go index d46f67cd5661..eb0ac8d1528d 100644 --- a/internal/service/dataexchange/sweep.go +++ b/internal/service/dataexchange/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/datapipeline/pipeline_data_source_test.go b/internal/service/datapipeline/pipeline_data_source_test.go index f9e88a0fea81..167187d7c9be 100644 --- a/internal/service/datapipeline/pipeline_data_source_test.go +++ b/internal/service/datapipeline/pipeline_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/datapipeline" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/datapipeline/pipeline_definition_data_source_test.go b/internal/service/datapipeline/pipeline_definition_data_source_test.go index b88347460598..9bc5c3f4a441 100644 --- a/internal/service/datapipeline/pipeline_definition_data_source_test.go +++ b/internal/service/datapipeline/pipeline_definition_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/datapipeline" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/datapipeline/pipeline_definition_test.go b/internal/service/datapipeline/pipeline_definition_test.go index 9b14dee4c798..7408d6b3a3f6 100644 --- a/internal/service/datapipeline/pipeline_definition_test.go +++ b/internal/service/datapipeline/pipeline_definition_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatapipeline "github.com/hashicorp/terraform-provider-aws/internal/service/datapipeline" diff --git a/internal/service/datapipeline/pipeline_test.go b/internal/service/datapipeline/pipeline_test.go index e2e6903d7048..38d0ba448503 100644 --- a/internal/service/datapipeline/pipeline_test.go +++ b/internal/service/datapipeline/pipeline_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatapipeline "github.com/hashicorp/terraform-provider-aws/internal/service/datapipeline" diff --git a/internal/service/datasync/agent_test.go b/internal/service/datasync/agent_test.go index 5fb668871d81..a9b00c59eeff 100644 --- a/internal/service/datasync/agent_test.go +++ b/internal/service/datasync/agent_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_efs_test.go b/internal/service/datasync/location_efs_test.go index ea39eca5ef10..7ae40f99cb82 100644 --- a/internal/service/datasync/location_efs_test.go +++ b/internal/service/datasync/location_efs_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_fsx_lustre_file_system_test.go b/internal/service/datasync/location_fsx_lustre_file_system_test.go index 17896c67e3dc..7bdf913f4a3a 100644 --- a/internal/service/datasync/location_fsx_lustre_file_system_test.go +++ b/internal/service/datasync/location_fsx_lustre_file_system_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/fsx" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_fsx_openzfs_file_system_test.go b/internal/service/datasync/location_fsx_openzfs_file_system_test.go index 6886a7c0cc48..f97916d093dc 100644 --- a/internal/service/datasync/location_fsx_openzfs_file_system_test.go +++ b/internal/service/datasync/location_fsx_openzfs_file_system_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/fsx" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_fsx_windows_file_system_test.go b/internal/service/datasync/location_fsx_windows_file_system_test.go index 98cc478f8bf0..e3e12db6ece7 100644 --- a/internal/service/datasync/location_fsx_windows_file_system_test.go +++ b/internal/service/datasync/location_fsx_windows_file_system_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/fsx" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_hdfs_test.go b/internal/service/datasync/location_hdfs_test.go index 36ed1ad282b7..10ca92e3c451 100644 --- a/internal/service/datasync/location_hdfs_test.go +++ b/internal/service/datasync/location_hdfs_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_nfs_test.go b/internal/service/datasync/location_nfs_test.go index 089b36ac937a..391d88766f7a 100644 --- a/internal/service/datasync/location_nfs_test.go +++ b/internal/service/datasync/location_nfs_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/datasync/location_object_storage_test.go b/internal/service/datasync/location_object_storage_test.go index 9b86d6fe4bd4..17177fcc9bda 100644 --- a/internal/service/datasync/location_object_storage_test.go +++ b/internal/service/datasync/location_object_storage_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_s3_test.go b/internal/service/datasync/location_s3_test.go index d5326a0d0305..38089aadd8b2 100644 --- a/internal/service/datasync/location_s3_test.go +++ b/internal/service/datasync/location_s3_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/datasync/location_smb_test.go b/internal/service/datasync/location_smb_test.go index 0ae0349fbd8b..5101164a7493 100644 --- a/internal/service/datasync/location_smb_test.go +++ b/internal/service/datasync/location_smb_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/datasync/sweep.go b/internal/service/datasync/sweep.go index 809bab3a0358..dd1912e048d3 100644 --- a/internal/service/datasync/sweep.go +++ b/internal/service/datasync/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/datasync/task_test.go b/internal/service/datasync/task_test.go index dd26a86280d5..7bc00939cd3c 100644 --- a/internal/service/datasync/task_test.go +++ b/internal/service/datasync/task_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdatasync "github.com/hashicorp/terraform-provider-aws/internal/service/datasync" diff --git a/internal/service/dax/cluster_test.go b/internal/service/dax/cluster_test.go index 8b923c1a1d14..0d8b63e5c2ab 100644 --- a/internal/service/dax/cluster_test.go +++ b/internal/service/dax/cluster_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dax" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/dax/parameter_group_test.go b/internal/service/dax/parameter_group_test.go index e8fe0bcffbed..69439f9970de 100644 --- a/internal/service/dax/parameter_group_test.go +++ b/internal/service/dax/parameter_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dax" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/dax/subnet_group_test.go b/internal/service/dax/subnet_group_test.go index c8b699b441b5..626e0b5eed50 100644 --- a/internal/service/dax/subnet_group_test.go +++ b/internal/service/dax/subnet_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dax" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/dax/sweep.go b/internal/service/dax/sweep.go index 643d37071287..698378419426 100644 --- a/internal/service/dax/sweep.go +++ b/internal/service/dax/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/dax" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/deploy/app_test.go b/internal/service/deploy/app_test.go index cd781e0cfdf8..39f4f3c3e4e9 100644 --- a/internal/service/deploy/app_test.go +++ b/internal/service/deploy/app_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodedeploy "github.com/hashicorp/terraform-provider-aws/internal/service/deploy" diff --git a/internal/service/deploy/deployment_config_test.go b/internal/service/deploy/deployment_config_test.go index 3dc84840048d..95a5cdca72e8 100644 --- a/internal/service/deploy/deployment_config_test.go +++ b/internal/service/deploy/deployment_config_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/deploy/deployment_group_test.go b/internal/service/deploy/deployment_group_test.go index f5ff5ae7e9c4..1934c99cc506 100644 --- a/internal/service/deploy/deployment_group_test.go +++ b/internal/service/deploy/deployment_group_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcodedeploy "github.com/hashicorp/terraform-provider-aws/internal/service/deploy" diff --git a/internal/service/deploy/sweep.go b/internal/service/deploy/sweep.go index 18ae167e0b7a..5a01f74b72e3 100644 --- a/internal/service/deploy/sweep.go +++ b/internal/service/deploy/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/detective/graph_test.go b/internal/service/detective/graph_test.go index 8a2b38c462d0..3325f3a8b4b6 100644 --- a/internal/service/detective/graph_test.go +++ b/internal/service/detective/graph_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/detective" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" diff --git a/internal/service/detective/invitation_accepter_test.go b/internal/service/detective/invitation_accepter_test.go index b5fcb699d869..af57541355a3 100644 --- a/internal/service/detective/invitation_accepter_test.go +++ b/internal/service/detective/invitation_accepter_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/detective" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" diff --git a/internal/service/detective/member_test.go b/internal/service/detective/member_test.go index 99ef1b923172..d8a8015bd292 100644 --- a/internal/service/detective/member_test.go +++ b/internal/service/detective/member_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/detective" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdetective "github.com/hashicorp/terraform-provider-aws/internal/service/detective" diff --git a/internal/service/devicefarm/device_pool_test.go b/internal/service/devicefarm/device_pool_test.go index a713bc6d5e24..0d75d01c2ecf 100644 --- a/internal/service/devicefarm/device_pool_test.go +++ b/internal/service/devicefarm/device_pool_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/devicefarm/instance_profile_test.go b/internal/service/devicefarm/instance_profile_test.go index 014e073cab94..2463b47e39bb 100644 --- a/internal/service/devicefarm/instance_profile_test.go +++ b/internal/service/devicefarm/instance_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/devicefarm/network_profile_test.go b/internal/service/devicefarm/network_profile_test.go index dd9036735168..63825397f5cb 100644 --- a/internal/service/devicefarm/network_profile_test.go +++ b/internal/service/devicefarm/network_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/devicefarm/project_test.go b/internal/service/devicefarm/project_test.go index f7631e53d0ba..1375cbe5760b 100644 --- a/internal/service/devicefarm/project_test.go +++ b/internal/service/devicefarm/project_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/devicefarm/sweep.go b/internal/service/devicefarm/sweep.go index 1b0d76982192..45f675e7ebdc 100644 --- a/internal/service/devicefarm/sweep.go +++ b/internal/service/devicefarm/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/devicefarm" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/devicefarm/test_grid_project_test.go b/internal/service/devicefarm/test_grid_project_test.go index 4b3f136c9f2c..0e526cd0820f 100644 --- a/internal/service/devicefarm/test_grid_project_test.go +++ b/internal/service/devicefarm/test_grid_project_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/devicefarm/upload_test.go b/internal/service/devicefarm/upload_test.go index 544befa811e9..f08e88f08d07 100644 --- a/internal/service/devicefarm/upload_test.go +++ b/internal/service/devicefarm/upload_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/devicefarm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdevicefarm "github.com/hashicorp/terraform-provider-aws/internal/service/devicefarm" diff --git a/internal/service/directconnect/acc_test.go b/internal/service/directconnect/acc_test.go index 742cdc9fd5db..cfafa793e015 100644 --- a/internal/service/directconnect/acc_test.go +++ b/internal/service/directconnect/acc_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/directconnect/bgp_peer_test.go b/internal/service/directconnect/bgp_peer_test.go index 5ec792af3514..88df1c72a2b2 100644 --- a/internal/service/directconnect/bgp_peer_test.go +++ b/internal/service/directconnect/bgp_peer_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/directconnect/connection_association_test.go b/internal/service/directconnect/connection_association_test.go index 03e13de7ebe6..5eab320d80f6 100644 --- a/internal/service/directconnect/connection_association_test.go +++ b/internal/service/directconnect/connection_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/connection_confirmation_test.go b/internal/service/directconnect/connection_confirmation_test.go index 4a2afe30ee50..f16e38c2a9c9 100644 --- a/internal/service/directconnect/connection_confirmation_test.go +++ b/internal/service/directconnect/connection_confirmation_test.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/connection_data_source_test.go b/internal/service/directconnect/connection_data_source_test.go index 409b1fe627d0..6d78c53330b4 100644 --- a/internal/service/directconnect/connection_data_source_test.go +++ b/internal/service/directconnect/connection_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/connection_test.go b/internal/service/directconnect/connection_test.go index 4bfe85053dcd..24278239a0ed 100644 --- a/internal/service/directconnect/connection_test.go +++ b/internal/service/directconnect/connection_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/gateway_association_proposal_test.go b/internal/service/directconnect/gateway_association_proposal_test.go index 3159b834269b..c27810054d3a 100644 --- a/internal/service/directconnect/gateway_association_proposal_test.go +++ b/internal/service/directconnect/gateway_association_proposal_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/gateway_association_test.go b/internal/service/directconnect/gateway_association_test.go index c15df7286295..47bf79744c31 100644 --- a/internal/service/directconnect/gateway_association_test.go +++ b/internal/service/directconnect/gateway_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/gateway_data_source_test.go b/internal/service/directconnect/gateway_data_source_test.go index 888fa15f1e0e..d168c9773d18 100644 --- a/internal/service/directconnect/gateway_data_source_test.go +++ b/internal/service/directconnect/gateway_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/gateway_test.go b/internal/service/directconnect/gateway_test.go index 046355a4c11f..18fb9ff30994 100644 --- a/internal/service/directconnect/gateway_test.go +++ b/internal/service/directconnect/gateway_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/hosted_connection_test.go b/internal/service/directconnect/hosted_connection_test.go index 2e4815d79913..d6f4111e312c 100644 --- a/internal/service/directconnect/hosted_connection_test.go +++ b/internal/service/directconnect/hosted_connection_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/hosted_private_virtual_interface_test.go b/internal/service/directconnect/hosted_private_virtual_interface_test.go index c7925dc6f238..c1b339bf00b5 100644 --- a/internal/service/directconnect/hosted_private_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_private_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/hosted_public_virtual_interface_test.go b/internal/service/directconnect/hosted_public_virtual_interface_test.go index daa97ec5b82b..28182612ccef 100644 --- a/internal/service/directconnect/hosted_public_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_public_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/hosted_transit_virtual_interface_test.go b/internal/service/directconnect/hosted_transit_virtual_interface_test.go index f955cd4da425..f389ad45d7b4 100644 --- a/internal/service/directconnect/hosted_transit_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_transit_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/lag_test.go b/internal/service/directconnect/lag_test.go index 46741a3e6cdc..32f029b8346c 100644 --- a/internal/service/directconnect/lag_test.go +++ b/internal/service/directconnect/lag_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdirectconnect "github.com/hashicorp/terraform-provider-aws/internal/service/directconnect" diff --git a/internal/service/directconnect/location_data_source_test.go b/internal/service/directconnect/location_data_source_test.go index 52fc8926ee6b..6d810b39c0e8 100644 --- a/internal/service/directconnect/location_data_source_test.go +++ b/internal/service/directconnect/location_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/macsec_key_test.go b/internal/service/directconnect/macsec_key_test.go index 332f771183ce..c5adedc98c5e 100644 --- a/internal/service/directconnect/macsec_key_test.go +++ b/internal/service/directconnect/macsec_key_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/private_virtual_interface_test.go b/internal/service/directconnect/private_virtual_interface_test.go index 424c6da4369a..7541eb451871 100644 --- a/internal/service/directconnect/private_virtual_interface_test.go +++ b/internal/service/directconnect/private_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/public_virtual_interface_test.go b/internal/service/directconnect/public_virtual_interface_test.go index 25e8a24ae826..5d461876baa0 100644 --- a/internal/service/directconnect/public_virtual_interface_test.go +++ b/internal/service/directconnect/public_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/router_configuration_data_source_test.go b/internal/service/directconnect/router_configuration_data_source_test.go index 3972d6235bd9..68cd61cc2f8f 100644 --- a/internal/service/directconnect/router_configuration_data_source_test.go +++ b/internal/service/directconnect/router_configuration_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directconnect" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/directconnect/sweep.go b/internal/service/directconnect/sweep.go index f362bf05acea..727f58cc035b 100644 --- a/internal/service/directconnect/sweep.go +++ b/internal/service/directconnect/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/directconnect/transit_virtual_interface_test.go b/internal/service/directconnect/transit_virtual_interface_test.go index 3bd760b952b1..868a6933cbd6 100644 --- a/internal/service/directconnect/transit_virtual_interface_test.go +++ b/internal/service/directconnect/transit_virtual_interface_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dlm/lifecycle_policy_test.go b/internal/service/dlm/lifecycle_policy_test.go index edffb6b598cf..e220bf2a0800 100644 --- a/internal/service/dlm/lifecycle_policy_test.go +++ b/internal/service/dlm/lifecycle_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dlm" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdlm "github.com/hashicorp/terraform-provider-aws/internal/service/dlm" diff --git a/internal/service/dlm/sweep.go b/internal/service/dlm/sweep.go index 3e97d17cac41..55824d25156f 100644 --- a/internal/service/dlm/sweep.go +++ b/internal/service/dlm/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dlm" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/dms/certificate_data_source_test.go b/internal/service/dms/certificate_data_source_test.go index 97ca4372c666..d92e005ae845 100644 --- a/internal/service/dms/certificate_data_source_test.go +++ b/internal/service/dms/certificate_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/certificate_test.go b/internal/service/dms/certificate_test.go index c1e33e87c8f0..9f3af0042ea1 100644 --- a/internal/service/dms/certificate_test.go +++ b/internal/service/dms/certificate_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" diff --git a/internal/service/dms/endpoint_data_source_test.go b/internal/service/dms/endpoint_data_source_test.go index 668e5fa1d03f..7dc5b1fd0639 100644 --- a/internal/service/dms/endpoint_data_source_test.go +++ b/internal/service/dms/endpoint_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/endpoint_test.go b/internal/service/dms/endpoint_test.go index f52bb3d377c1..0a8e0132adf4 100644 --- a/internal/service/dms/endpoint_test.go +++ b/internal/service/dms/endpoint_test.go @@ -7,9 +7,9 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" diff --git a/internal/service/dms/event_subscription_test.go b/internal/service/dms/event_subscription_test.go index fc4ee7ce1404..1fdd8650d087 100644 --- a/internal/service/dms/event_subscription_test.go +++ b/internal/service/dms/event_subscription_test.go @@ -9,9 +9,9 @@ import ( dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" diff --git a/internal/service/dms/replication_instance_data_source_test.go b/internal/service/dms/replication_instance_data_source_test.go index 3bc1135d2aac..f29302e4a468 100644 --- a/internal/service/dms/replication_instance_data_source_test.go +++ b/internal/service/dms/replication_instance_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/replication_instance_test.go b/internal/service/dms/replication_instance_test.go index 63bdc7507bb0..ccb10525caf8 100644 --- a/internal/service/dms/replication_instance_test.go +++ b/internal/service/dms/replication_instance_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/dms/replication_subnet_group_data_source_test.go b/internal/service/dms/replication_subnet_group_data_source_test.go index 07126f81e87e..4b761aba4018 100644 --- a/internal/service/dms/replication_subnet_group_data_source_test.go +++ b/internal/service/dms/replication_subnet_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/replication_subnet_group_test.go b/internal/service/dms/replication_subnet_group_test.go index 16e87f470222..3ec940c1bec8 100644 --- a/internal/service/dms/replication_subnet_group_test.go +++ b/internal/service/dms/replication_subnet_group_test.go @@ -7,10 +7,10 @@ import ( "github.com/aws/aws-sdk-go/aws" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/dms/replication_task_data_source_test.go b/internal/service/dms/replication_task_data_source_test.go index af2a287dd2ce..8cd2658aaeb0 100644 --- a/internal/service/dms/replication_task_data_source_test.go +++ b/internal/service/dms/replication_task_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/replication_task_test.go b/internal/service/dms/replication_task_test.go index 5253a4c3b0ca..141884dd57c0 100644 --- a/internal/service/dms/replication_task_test.go +++ b/internal/service/dms/replication_task_test.go @@ -7,9 +7,9 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdms "github.com/hashicorp/terraform-provider-aws/internal/service/dms" diff --git a/internal/service/dms/s3_endpoint_test.go b/internal/service/dms/s3_endpoint_test.go index 406bf626698d..d234512f4c11 100644 --- a/internal/service/dms/s3_endpoint_test.go +++ b/internal/service/dms/s3_endpoint_test.go @@ -5,8 +5,8 @@ import ( "testing" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dms/sweep.go b/internal/service/dms/sweep.go index 3ae48aa6b43f..e1d608798fd5 100644 --- a/internal/service/dms/sweep.go +++ b/internal/service/dms/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/docdb/cluster_instance_test.go b/internal/service/docdb/cluster_instance_test.go index 8c9fd976abf8..679f15c4cfe7 100644 --- a/internal/service/docdb/cluster_instance_test.go +++ b/internal/service/docdb/cluster_instance_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/docdb/cluster_parameter_group_test.go b/internal/service/docdb/cluster_parameter_group_test.go index 615eeee4dbe6..27b1c0568a0c 100644 --- a/internal/service/docdb/cluster_parameter_group_test.go +++ b/internal/service/docdb/cluster_parameter_group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" diff --git a/internal/service/docdb/cluster_snapshot_test.go b/internal/service/docdb/cluster_snapshot_test.go index 75ad8456b098..612816536501 100644 --- a/internal/service/docdb/cluster_snapshot_test.go +++ b/internal/service/docdb/cluster_snapshot_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/docdb/cluster_test.go b/internal/service/docdb/cluster_test.go index 69129d3240fa..d993f835f737 100644 --- a/internal/service/docdb/cluster_test.go +++ b/internal/service/docdb/cluster_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/docdb/engine_version_data_source_test.go b/internal/service/docdb/engine_version_data_source_test.go index c32ac5e9bf09..5358faba3528 100644 --- a/internal/service/docdb/engine_version_data_source_test.go +++ b/internal/service/docdb/engine_version_data_source_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/docdb/event_subscription_test.go b/internal/service/docdb/event_subscription_test.go index aa78c91e04a2..49e4ef54a663 100644 --- a/internal/service/docdb/event_subscription_test.go +++ b/internal/service/docdb/event_subscription_test.go @@ -6,10 +6,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/docdb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" diff --git a/internal/service/docdb/global_cluster_test.go b/internal/service/docdb/global_cluster_test.go index 66d6284bf3d7..34c83ef31cc8 100644 --- a/internal/service/docdb/global_cluster_test.go +++ b/internal/service/docdb/global_cluster_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" diff --git a/internal/service/docdb/orderable_db_instance_data_source_test.go b/internal/service/docdb/orderable_db_instance_data_source_test.go index 3a4725e8f49e..a728e8142af3 100644 --- a/internal/service/docdb/orderable_db_instance_data_source_test.go +++ b/internal/service/docdb/orderable_db_instance_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/docdb/subnet_group_test.go b/internal/service/docdb/subnet_group_test.go index e0a951360207..cba6758cd58f 100644 --- a/internal/service/docdb/subnet_group_test.go +++ b/internal/service/docdb/subnet_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdocdb "github.com/hashicorp/terraform-provider-aws/internal/service/docdb" diff --git a/internal/service/docdb/sweep.go b/internal/service/docdb/sweep.go index 844aa3fd1351..e39133addd27 100644 --- a/internal/service/docdb/sweep.go +++ b/internal/service/docdb/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ds/conditional_forwarder_test.go b/internal/service/ds/conditional_forwarder_test.go index 9db04f7700cb..7ff9b77b8616 100644 --- a/internal/service/ds/conditional_forwarder_test.go +++ b/internal/service/ds/conditional_forwarder_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/ds/directory_data_source_test.go b/internal/service/ds/directory_data_source_test.go index 2f3101acc17c..61e5dd542e0d 100644 --- a/internal/service/ds/directory_data_source_test.go +++ b/internal/service/ds/directory_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ds/directory_test.go b/internal/service/ds/directory_test.go index 071b021733b4..7a3c22146037 100644 --- a/internal/service/ds/directory_test.go +++ b/internal/service/ds/directory_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/ds/log_subscription_test.go b/internal/service/ds/log_subscription_test.go index ce36e17e8b59..080d4a4a2fc0 100644 --- a/internal/service/ds/log_subscription_test.go +++ b/internal/service/ds/log_subscription_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/ds/radius_settings_test.go b/internal/service/ds/radius_settings_test.go index a3c83ef9256c..8305c36a619d 100644 --- a/internal/service/ds/radius_settings_test.go +++ b/internal/service/ds/radius_settings_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/ds/region_test.go b/internal/service/ds/region_test.go index 5d784d1bd738..536c1c220413 100644 --- a/internal/service/ds/region_test.go +++ b/internal/service/ds/region_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/ds/shared_directory_accepter_test.go b/internal/service/ds/shared_directory_accepter_test.go index 07fd1f3d1dc2..1a4e1ea2e418 100644 --- a/internal/service/ds/shared_directory_accepter_test.go +++ b/internal/service/ds/shared_directory_accepter_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ds/shared_directory_test.go b/internal/service/ds/shared_directory_test.go index 5348f2e4e5f7..5ec24a5ba673 100644 --- a/internal/service/ds/shared_directory_test.go +++ b/internal/service/ds/shared_directory_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/directoryservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/ds/sweep.go b/internal/service/ds/sweep.go index 51348e7f7d2a..23b6a9fffcd5 100644 --- a/internal/service/ds/sweep.go +++ b/internal/service/ds/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ds/trust_test.go b/internal/service/ds/trust_test.go index 1d40521a4398..abea132f044c 100644 --- a/internal/service/ds/trust_test.go +++ b/internal/service/ds/trust_test.go @@ -7,9 +7,9 @@ import ( "testing" awstypes "github.com/aws/aws-sdk-go-v2/service/directoryservice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfds "github.com/hashicorp/terraform-provider-aws/internal/service/ds" diff --git a/internal/service/dynamodb/contributor_insights_test.go b/internal/service/dynamodb/contributor_insights_test.go index 00f726bd31fe..4397379679ea 100644 --- a/internal/service/dynamodb/contributor_insights_test.go +++ b/internal/service/dynamodb/contributor_insights_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" diff --git a/internal/service/dynamodb/global_table_test.go b/internal/service/dynamodb/global_table_test.go index b08b88d09100..7e5b724761e2 100644 --- a/internal/service/dynamodb/global_table_test.go +++ b/internal/service/dynamodb/global_table_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" diff --git a/internal/service/dynamodb/kinesis_streaming_destination_test.go b/internal/service/dynamodb/kinesis_streaming_destination_test.go index 4f4033cfa4ae..95a4c644f493 100644 --- a/internal/service/dynamodb/kinesis_streaming_destination_test.go +++ b/internal/service/dynamodb/kinesis_streaming_destination_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" diff --git a/internal/service/dynamodb/sweep.go b/internal/service/dynamodb/sweep.go index 7984262b2025..7e370158021b 100644 --- a/internal/service/dynamodb/sweep.go +++ b/internal/service/dynamodb/sweep.go @@ -14,8 +14,8 @@ import ( "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/dynamodb/table_data_source_test.go b/internal/service/dynamodb/table_data_source_test.go index 57079a575f48..b8f20b5bdb07 100644 --- a/internal/service/dynamodb/table_data_source_test.go +++ b/internal/service/dynamodb/table_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/dynamodb/table_item_data_source_test.go b/internal/service/dynamodb/table_item_data_source_test.go index 27d820e27add..71cd5fbc79d4 100644 --- a/internal/service/dynamodb/table_item_data_source_test.go +++ b/internal/service/dynamodb/table_item_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/dynamodb/table_item_test.go b/internal/service/dynamodb/table_item_test.go index b4cd31a78daf..df4ef6728cc2 100644 --- a/internal/service/dynamodb/table_item_test.go +++ b/internal/service/dynamodb/table_item_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" diff --git a/internal/service/dynamodb/table_replica_test.go b/internal/service/dynamodb/table_replica_test.go index cbcfea94fa42..ddd88542a2cb 100644 --- a/internal/service/dynamodb/table_replica_test.go +++ b/internal/service/dynamodb/table_replica_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index aeb6e7111ed0..60f4d62ee081 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/dynamodb/tag_gen_test.go b/internal/service/dynamodb/tag_gen_test.go index c706509f5000..145ace7fc774 100644 --- a/internal/service/dynamodb/tag_gen_test.go +++ b/internal/service/dynamodb/tag_gen_test.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" diff --git a/internal/service/dynamodb/tag_test.go b/internal/service/dynamodb/tag_test.go index 969c8ab627ef..044235f52dbe 100644 --- a/internal/service/dynamodb/tag_test.go +++ b/internal/service/dynamodb/tag_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/dynamodb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfdynamodb "github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb" ) diff --git a/internal/service/ec2/ebs_default_kms_key_data_source_test.go b/internal/service/ec2/ebs_default_kms_key_data_source_test.go index a035118862f0..4df502a1de9d 100644 --- a/internal/service/ec2/ebs_default_kms_key_data_source_test.go +++ b/internal/service/ec2/ebs_default_kms_key_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ebs_default_kms_key_test.go b/internal/service/ec2/ebs_default_kms_key_test.go index 9478385f7cf0..d8775a38bd41 100644 --- a/internal/service/ec2/ebs_default_kms_key_test.go +++ b/internal/service/ec2/ebs_default_kms_key_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" diff --git a/internal/service/ec2/ebs_encryption_by_default_data_source_test.go b/internal/service/ec2/ebs_encryption_by_default_data_source_test.go index c4c401268b7a..4a4673ce9749 100644 --- a/internal/service/ec2/ebs_encryption_by_default_data_source_test.go +++ b/internal/service/ec2/ebs_encryption_by_default_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ec2/ebs_encryption_by_default_test.go b/internal/service/ec2/ebs_encryption_by_default_test.go index 870d1c65dcba..58954600f0d6 100644 --- a/internal/service/ec2/ebs_encryption_by_default_test.go +++ b/internal/service/ec2/ebs_encryption_by_default_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ec2/ebs_snapshot_copy_test.go b/internal/service/ec2/ebs_snapshot_copy_test.go index 3b296df117e7..98b02559ef65 100644 --- a/internal/service/ec2/ebs_snapshot_copy_test.go +++ b/internal/service/ec2/ebs_snapshot_copy_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go b/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go index 947554076ee8..d2411a29da51 100644 --- a/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go +++ b/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ebs_snapshot_data_source_test.go b/internal/service/ec2/ebs_snapshot_data_source_test.go index a0899e0a199e..904493826abc 100644 --- a/internal/service/ec2/ebs_snapshot_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ebs_snapshot_ids_data_source_test.go b/internal/service/ec2/ebs_snapshot_ids_data_source_test.go index 3c78ccd611f2..b299f8b77c5e 100644 --- a/internal/service/ec2/ebs_snapshot_ids_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_ids_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ebs_snapshot_import_test.go b/internal/service/ec2/ebs_snapshot_import_test.go index 2be07029a830..188ea31e7089 100644 --- a/internal/service/ec2/ebs_snapshot_import_test.go +++ b/internal/service/ec2/ebs_snapshot_import_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/ec2/ebs_snapshot_test.go b/internal/service/ec2/ebs_snapshot_test.go index a2a2c4fe3dac..f446f42e0bf3 100644 --- a/internal/service/ec2/ebs_snapshot_test.go +++ b/internal/service/ec2/ebs_snapshot_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ebs_volume_attachment_test.go b/internal/service/ec2/ebs_volume_attachment_test.go index b845f726839d..e0b35628f3fa 100644 --- a/internal/service/ec2/ebs_volume_attachment_test.go +++ b/internal/service/ec2/ebs_volume_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ebs_volume_data_source_test.go b/internal/service/ec2/ebs_volume_data_source_test.go index 551fafe714c9..80db98eaee35 100644 --- a/internal/service/ec2/ebs_volume_data_source_test.go +++ b/internal/service/ec2/ebs_volume_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ebs_volume_test.go b/internal/service/ec2/ebs_volume_test.go index aa515fd8169f..6c8fe4dfbae1 100644 --- a/internal/service/ec2/ebs_volume_test.go +++ b/internal/service/ec2/ebs_volume_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ebs_volumes_data_source_test.go b/internal/service/ec2/ebs_volumes_data_source_test.go index 09d88b96dc0b..9d0dfad2b518 100644 --- a/internal/service/ec2/ebs_volumes_data_source_test.go +++ b/internal/service/ec2/ebs_volumes_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_ami_copy_test.go b/internal/service/ec2/ec2_ami_copy_test.go index da79d21763a3..6dd77c5e9ad4 100644 --- a/internal/service/ec2/ec2_ami_copy_test.go +++ b/internal/service/ec2/ec2_ami_copy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_ami_data_source_test.go b/internal/service/ec2/ec2_ami_data_source_test.go index b5d0d38b40fb..dc3b00ce2f60 100644 --- a/internal/service/ec2/ec2_ami_data_source_test.go +++ b/internal/service/ec2/ec2_ami_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_ami_from_instance_test.go b/internal/service/ec2/ec2_ami_from_instance_test.go index 01693a452f51..1de81d672c3a 100644 --- a/internal/service/ec2/ec2_ami_from_instance_test.go +++ b/internal/service/ec2/ec2_ami_from_instance_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/ec2_ami_ids_data_source_test.go b/internal/service/ec2/ec2_ami_ids_data_source_test.go index 381dc3c96212..ba4339d2c79a 100644 --- a/internal/service/ec2/ec2_ami_ids_data_source_test.go +++ b/internal/service/ec2/ec2_ami_ids_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_ami_launch_permission_test.go b/internal/service/ec2/ec2_ami_launch_permission_test.go index e6e2ab93c79a..1d14b888ebca 100644 --- a/internal/service/ec2/ec2_ami_launch_permission_test.go +++ b/internal/service/ec2/ec2_ami_launch_permission_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_ami_test.go b/internal/service/ec2/ec2_ami_test.go index 81528e53157e..da3111bb1a32 100644 --- a/internal/service/ec2/ec2_ami_test.go +++ b/internal/service/ec2/ec2_ami_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_availability_zone_data_source_test.go b/internal/service/ec2/ec2_availability_zone_data_source_test.go index 867126648b64..764eb16cc7ff 100644 --- a/internal/service/ec2/ec2_availability_zone_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zone_data_source_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_availability_zone_group_test.go b/internal/service/ec2/ec2_availability_zone_group_test.go index b440433cd9ca..490e824cf15b 100644 --- a/internal/service/ec2/ec2_availability_zone_group_test.go +++ b/internal/service/ec2/ec2_availability_zone_group_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_availability_zones_data_source_test.go b/internal/service/ec2/ec2_availability_zones_data_source_test.go index 42efc3354ab9..3313502a3892 100644 --- a/internal/service/ec2/ec2_availability_zones_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zones_data_source_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_capacity_reservation_test.go b/internal/service/ec2/ec2_capacity_reservation_test.go index eef966ef9418..1f3e04c5f593 100644 --- a/internal/service/ec2/ec2_capacity_reservation_test.go +++ b/internal/service/ec2/ec2_capacity_reservation_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_eip_association_test.go b/internal/service/ec2/ec2_eip_association_test.go index 6eede43c6fed..59eabb3a3d59 100644 --- a/internal/service/ec2/ec2_eip_association_test.go +++ b/internal/service/ec2/ec2_eip_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_eip_data_source_test.go b/internal/service/ec2/ec2_eip_data_source_test.go index 1bc0cde18b91..001fb4b6a38b 100644 --- a/internal/service/ec2/ec2_eip_data_source_test.go +++ b/internal/service/ec2/ec2_eip_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_eip_test.go b/internal/service/ec2/ec2_eip_test.go index f705c0d0d61a..b570f6bade56 100644 --- a/internal/service/ec2/ec2_eip_test.go +++ b/internal/service/ec2/ec2_eip_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_eips_data_source_test.go b/internal/service/ec2/ec2_eips_data_source_test.go index 7afd1e756e25..06a1ff54fa48 100644 --- a/internal/service/ec2/ec2_eips_data_source_test.go +++ b/internal/service/ec2/ec2_eips_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_fleet_test.go b/internal/service/ec2/ec2_fleet_test.go index d0aadc550250..7f2bf2a15f1a 100644 --- a/internal/service/ec2/ec2_fleet_test.go +++ b/internal/service/ec2/ec2_fleet_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_host_data_source_test.go b/internal/service/ec2/ec2_host_data_source_test.go index a7fc56a4fb01..d0328e270d1f 100644 --- a/internal/service/ec2/ec2_host_data_source_test.go +++ b/internal/service/ec2/ec2_host_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_host_test.go b/internal/service/ec2/ec2_host_test.go index 8dc698b7d6c6..5af07e0fa7a5 100644 --- a/internal/service/ec2/ec2_host_test.go +++ b/internal/service/ec2/ec2_host_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_instance_data_source_test.go b/internal/service/ec2/ec2_instance_data_source_test.go index 970b89478bf3..d7daef3dec85 100644 --- a/internal/service/ec2/ec2_instance_data_source_test.go +++ b/internal/service/ec2/ec2_instance_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_instance_state_test.go b/internal/service/ec2/ec2_instance_state_test.go index 74ea27a1f71b..e9831f287c48 100644 --- a/internal/service/ec2/ec2_instance_state_test.go +++ b/internal/service/ec2/ec2_instance_state_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_instance_test.go b/internal/service/ec2/ec2_instance_test.go index ce0252dc1704..a874a11e32d5 100644 --- a/internal/service/ec2/ec2_instance_test.go +++ b/internal/service/ec2/ec2_instance_test.go @@ -17,10 +17,10 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_instance_type_data_source_test.go b/internal/service/ec2/ec2_instance_type_data_source_test.go index ed6ba0f48a27..c46a9e574284 100644 --- a/internal/service/ec2/ec2_instance_type_data_source_test.go +++ b/internal/service/ec2/ec2_instance_type_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_instance_type_offering_data_source_test.go b/internal/service/ec2/ec2_instance_type_offering_data_source_test.go index 9111d6a84e24..d142281472b8 100644 --- a/internal/service/ec2/ec2_instance_type_offering_data_source_test.go +++ b/internal/service/ec2/ec2_instance_type_offering_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_instance_type_offerings_data_source_test.go b/internal/service/ec2/ec2_instance_type_offerings_data_source_test.go index 553997c2008c..b604a354776f 100644 --- a/internal/service/ec2/ec2_instance_type_offerings_data_source_test.go +++ b/internal/service/ec2/ec2_instance_type_offerings_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/ec2/ec2_instance_types_data_source_test.go b/internal/service/ec2/ec2_instance_types_data_source_test.go index 9028f3a4cbf6..93c6af35f369 100644 --- a/internal/service/ec2/ec2_instance_types_data_source_test.go +++ b/internal/service/ec2/ec2_instance_types_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index 2c41a41aaf01..8dea633ef428 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_key_pair_data_source_test.go b/internal/service/ec2/ec2_key_pair_data_source_test.go index a5064f007e26..13debd181b16 100644 --- a/internal/service/ec2/ec2_key_pair_data_source_test.go +++ b/internal/service/ec2/ec2_key_pair_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/ec2_key_pair_test.go b/internal/service/ec2/ec2_key_pair_test.go index b319a7714746..f6a781c56b27 100644 --- a/internal/service/ec2/ec2_key_pair_test.go +++ b/internal/service/ec2/ec2_key_pair_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_launch_template_data_source_test.go b/internal/service/ec2/ec2_launch_template_data_source_test.go index ea38ba37bb53..c857670d55db 100644 --- a/internal/service/ec2/ec2_launch_template_data_source_test.go +++ b/internal/service/ec2/ec2_launch_template_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_launch_template_test.go b/internal/service/ec2/ec2_launch_template_test.go index 2f40037cea05..2db034581bb1 100644 --- a/internal/service/ec2/ec2_launch_template_test.go +++ b/internal/service/ec2/ec2_launch_template_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_placement_group_test.go b/internal/service/ec2/ec2_placement_group_test.go index dfa321332984..99c0c04bb127 100644 --- a/internal/service/ec2/ec2_placement_group_test.go +++ b/internal/service/ec2/ec2_placement_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go b/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go index 95039a4c65a9..b3dd166332d3 100644 --- a/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go +++ b/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go b/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go index 8ae2ee7c74e6..5d9e095fc858 100644 --- a/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go +++ b/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ec2_serial_console_access_data_source_test.go b/internal/service/ec2/ec2_serial_console_access_data_source_test.go index f858f2df530e..8cf072933b47 100644 --- a/internal/service/ec2/ec2_serial_console_access_data_source_test.go +++ b/internal/service/ec2/ec2_serial_console_access_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ec2/ec2_serial_console_access_test.go b/internal/service/ec2/ec2_serial_console_access_test.go index 5874fb9be4f4..dcb8d2f47061 100644 --- a/internal/service/ec2/ec2_serial_console_access_test.go +++ b/internal/service/ec2/ec2_serial_console_access_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go index 064a2ddfd4d1..ddc1d07f52c3 100644 --- a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go +++ b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_spot_fleet_request_test.go b/internal/service/ec2/ec2_spot_fleet_request_test.go index a251715b052a..d8adc3845c59 100644 --- a/internal/service/ec2/ec2_spot_fleet_request_test.go +++ b/internal/service/ec2/ec2_spot_fleet_request_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_spot_instance_request_test.go b/internal/service/ec2/ec2_spot_instance_request_test.go index 34021a3f8fc0..1f3f3802257f 100644 --- a/internal/service/ec2/ec2_spot_instance_request_test.go +++ b/internal/service/ec2/ec2_spot_instance_request_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ec2_spot_price_data_source_test.go b/internal/service/ec2/ec2_spot_price_data_source_test.go index 534fc610756f..7bab9c688fc5 100644 --- a/internal/service/ec2/ec2_spot_price_data_source_test.go +++ b/internal/service/ec2/ec2_spot_price_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/ec2/ipam_byoip_test.go b/internal/service/ec2/ipam_byoip_test.go index 663543e52851..d7dfa9edbf66 100644 --- a/internal/service/ec2/ipam_byoip_test.go +++ b/internal/service/ec2/ipam_byoip_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_organization_admin_account_test.go b/internal/service/ec2/ipam_organization_admin_account_test.go index be643f7fee25..efdeecea328c 100644 --- a/internal/service/ec2/ipam_organization_admin_account_test.go +++ b/internal/service/ec2/ipam_organization_admin_account_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_pool_cidr_allocation_test.go b/internal/service/ec2/ipam_pool_cidr_allocation_test.go index 9815ea5a3e3b..f7ab727a519b 100644 --- a/internal/service/ec2/ipam_pool_cidr_allocation_test.go +++ b/internal/service/ec2/ipam_pool_cidr_allocation_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_pool_cidr_test.go b/internal/service/ec2/ipam_pool_cidr_test.go index 6fe0ccd96ec5..859efbb1796a 100644 --- a/internal/service/ec2/ipam_pool_cidr_test.go +++ b/internal/service/ec2/ipam_pool_cidr_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_pool_cidrs_data_source_test.go b/internal/service/ec2/ipam_pool_cidrs_data_source_test.go index a4a9b10003d5..9110a1ab7c8a 100644 --- a/internal/service/ec2/ipam_pool_cidrs_data_source_test.go +++ b/internal/service/ec2/ipam_pool_cidrs_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_pool_data_source_test.go b/internal/service/ec2/ipam_pool_data_source_test.go index c89cffe210b9..3bb731a328c8 100644 --- a/internal/service/ec2/ipam_pool_data_source_test.go +++ b/internal/service/ec2/ipam_pool_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_pool_test.go b/internal/service/ec2/ipam_pool_test.go index 49f7aed4490d..70f85bca3c05 100644 --- a/internal/service/ec2/ipam_pool_test.go +++ b/internal/service/ec2/ipam_pool_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_pools_data_source_test.go b/internal/service/ec2/ipam_pools_data_source_test.go index dae331374cf5..a9b5ee61db22 100644 --- a/internal/service/ec2/ipam_pools_data_source_test.go +++ b/internal/service/ec2/ipam_pools_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_preview_next_cidr_data_source_test.go b/internal/service/ec2/ipam_preview_next_cidr_data_source_test.go index b33d00423bc9..d7046e729f38 100644 --- a/internal/service/ec2/ipam_preview_next_cidr_data_source_test.go +++ b/internal/service/ec2/ipam_preview_next_cidr_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_preview_next_cidr_test.go b/internal/service/ec2/ipam_preview_next_cidr_test.go index 3cd45ce79304..49a3fb6487d9 100644 --- a/internal/service/ec2/ipam_preview_next_cidr_test.go +++ b/internal/service/ec2/ipam_preview_next_cidr_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/ipam_resource_discovery_association_test.go b/internal/service/ec2/ipam_resource_discovery_association_test.go index 7b6a80ce1345..46e302241ead 100644 --- a/internal/service/ec2/ipam_resource_discovery_association_test.go +++ b/internal/service/ec2/ipam_resource_discovery_association_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_resource_discovery_test.go b/internal/service/ec2/ipam_resource_discovery_test.go index 24770aa2bde4..33d0b42e4b32 100644 --- a/internal/service/ec2/ipam_resource_discovery_test.go +++ b/internal/service/ec2/ipam_resource_discovery_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_scope_test.go b/internal/service/ec2/ipam_scope_test.go index 60f851055b72..3e520c8606ce 100644 --- a/internal/service/ec2/ipam_scope_test.go +++ b/internal/service/ec2/ipam_scope_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/ipam_test.go b/internal/service/ec2/ipam_test.go index dcc1dfd81f5f..3787a401610a 100644 --- a/internal/service/ec2/ipam_test.go +++ b/internal/service/ec2/ipam_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/outposts_coip_pool_data_source_test.go b/internal/service/ec2/outposts_coip_pool_data_source_test.go index 607c503351bd..ac1679625d80 100644 --- a/internal/service/ec2/outposts_coip_pool_data_source_test.go +++ b/internal/service/ec2/outposts_coip_pool_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_coip_pools_data_source_test.go b/internal/service/ec2/outposts_coip_pools_data_source_test.go index ae4f2db07bf1..47aec236ee10 100644 --- a/internal/service/ec2/outposts_coip_pools_data_source_test.go +++ b/internal/service/ec2/outposts_coip_pools_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_data_source_test.go b/internal/service/ec2/outposts_local_gateway_data_source_test.go index 2a07812a7d31..9254fb184d93 100644 --- a/internal/service/ec2/outposts_local_gateway_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_route_table_data_source_test.go b/internal/service/ec2/outposts_local_gateway_route_table_data_source_test.go index 0a98d5a338d3..db08d739d467 100644 --- a/internal/service/ec2/outposts_local_gateway_route_table_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_table_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go index 098a8c8404df..21a24cd140c5 100644 --- a/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_table_vpc_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/outposts_local_gateway_route_tables_data_source_test.go b/internal/service/ec2/outposts_local_gateway_route_tables_data_source_test.go index a7b63fcc7668..eb0d7299e1ef 100644 --- a/internal/service/ec2/outposts_local_gateway_route_tables_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_tables_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_route_test.go b/internal/service/ec2/outposts_local_gateway_route_test.go index 695f2e475fbf..7acf327d4d2c 100644 --- a/internal/service/ec2/outposts_local_gateway_route_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/outposts_local_gateway_virtual_interface_data_source_test.go b/internal/service/ec2/outposts_local_gateway_virtual_interface_data_source_test.go index 5e52d38573e1..621853465053 100644 --- a/internal/service/ec2/outposts_local_gateway_virtual_interface_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_virtual_interface_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_virtual_interface_group_data_source_test.go b/internal/service/ec2/outposts_local_gateway_virtual_interface_group_data_source_test.go index 204f7c4ad206..974c28d3acb1 100644 --- a/internal/service/ec2/outposts_local_gateway_virtual_interface_group_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_virtual_interface_group_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateway_virtual_interface_groups_data_source_test.go b/internal/service/ec2/outposts_local_gateway_virtual_interface_groups_data_source_test.go index d3c3acd27239..e3538f60b4b6 100644 --- a/internal/service/ec2/outposts_local_gateway_virtual_interface_groups_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_virtual_interface_groups_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/outposts_local_gateways_data_source_test.go b/internal/service/ec2/outposts_local_gateways_data_source_test.go index 3f50e9416e73..ef96873a10eb 100644 --- a/internal/service/ec2/outposts_local_gateways_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateways_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/sweep.go b/internal/service/ec2/sweep.go index 96a8917ab471..865ed4a466e8 100644 --- a/internal/service/ec2/sweep.go +++ b/internal/service/ec2/sweep.go @@ -13,8 +13,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ec2/tag_gen_test.go b/internal/service/ec2/tag_gen_test.go index d036b175de58..2edee85ef263 100644 --- a/internal/service/ec2/tag_gen_test.go +++ b/internal/service/ec2/tag_gen_test.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/tag_test.go b/internal/service/ec2/tag_test.go index 72f85b915a89..16113b129e09 100644 --- a/internal/service/ec2/tag_test.go +++ b/internal/service/ec2/tag_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/transitgateway_attachment_data_source_test.go b/internal/service/ec2/transitgateway_attachment_data_source_test.go index f84a95c3364e..25ed3b449ffd 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_attachment_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_attachments_data_source_test.go b/internal/service/ec2/transitgateway_attachments_data_source_test.go index e4498e18576f..0973bbe6ce59 100644 --- a/internal/service/ec2/transitgateway_attachments_data_source_test.go +++ b/internal/service/ec2/transitgateway_attachments_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_connect_data_source_test.go b/internal/service/ec2/transitgateway_connect_data_source_test.go index 0e342d448f7a..b55ae375b975 100644 --- a/internal/service/ec2/transitgateway_connect_data_source_test.go +++ b/internal/service/ec2/transitgateway_connect_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_connect_peer_data_source_test.go b/internal/service/ec2/transitgateway_connect_peer_data_source_test.go index ad7a8ce1020e..20c7261712d4 100644 --- a/internal/service/ec2/transitgateway_connect_peer_data_source_test.go +++ b/internal/service/ec2/transitgateway_connect_peer_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_connect_peer_test.go b/internal/service/ec2/transitgateway_connect_peer_test.go index 1687f4ccc7f7..2cf732b24a46 100644 --- a/internal/service/ec2/transitgateway_connect_peer_test.go +++ b/internal/service/ec2/transitgateway_connect_peer_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_connect_test.go b/internal/service/ec2/transitgateway_connect_test.go index 3dc0205fa532..1e272f19c723 100644 --- a/internal/service/ec2/transitgateway_connect_test.go +++ b/internal/service/ec2/transitgateway_connect_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_data_source_test.go b/internal/service/ec2/transitgateway_data_source_test.go index a81b868add15..d25beccbae7d 100644 --- a/internal/service/ec2/transitgateway_data_source_test.go +++ b/internal/service/ec2/transitgateway_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_dx_gateway_attachment_data_source_test.go b/internal/service/ec2/transitgateway_dx_gateway_attachment_data_source_test.go index b43484e0a555..3ba0680e3455 100644 --- a/internal/service/ec2/transitgateway_dx_gateway_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_dx_gateway_attachment_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_multicast_domain_association_test.go b/internal/service/ec2/transitgateway_multicast_domain_association_test.go index 71eb8403566d..b8ebbd47368d 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_association_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go b/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go index dbc9492411dd..60c9e39ebf7c 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_multicast_domain_test.go b/internal/service/ec2/transitgateway_multicast_domain_test.go index 1bd059069a77..2e6524ba4123 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_multicast_group_member_test.go b/internal/service/ec2/transitgateway_multicast_group_member_test.go index dbc8c93a90c6..96a60bbc5fbc 100644 --- a/internal/service/ec2/transitgateway_multicast_group_member_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_member_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_multicast_group_source_test.go b/internal/service/ec2/transitgateway_multicast_group_source_test.go index a4ed8526c932..f82db5fdc890 100644 --- a/internal/service/ec2/transitgateway_multicast_group_source_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go b/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go index 48491ddb7742..60e3ea62a95d 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) diff --git a/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go b/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go index a497bca9ce71..2c8a0eb17e28 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_peering_attachment_test.go b/internal/service/ec2/transitgateway_peering_attachment_test.go index c2d42e696b0b..38394fbf32df 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_policy_table_association_test.go b/internal/service/ec2/transitgateway_policy_table_association_test.go index a53863da5f76..1a647ed23336 100644 --- a/internal/service/ec2/transitgateway_policy_table_association_test.go +++ b/internal/service/ec2/transitgateway_policy_table_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_policy_table_test.go b/internal/service/ec2/transitgateway_policy_table_test.go index b2794f9be7ce..6870bacf2529 100644 --- a/internal/service/ec2/transitgateway_policy_table_test.go +++ b/internal/service/ec2/transitgateway_policy_table_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_prefix_list_reference_test.go b/internal/service/ec2/transitgateway_prefix_list_reference_test.go index b871ec167d3c..eac01fa33f06 100644 --- a/internal/service/ec2/transitgateway_prefix_list_reference_test.go +++ b/internal/service/ec2/transitgateway_prefix_list_reference_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_route_table_association_test.go b/internal/service/ec2/transitgateway_route_table_association_test.go index e4caa43290ad..1e756c14a3ff 100644 --- a/internal/service/ec2/transitgateway_route_table_association_test.go +++ b/internal/service/ec2/transitgateway_route_table_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_route_table_associations_data_source_test.go b/internal/service/ec2/transitgateway_route_table_associations_data_source_test.go index a746cf13a290..abd4caf8cf83 100644 --- a/internal/service/ec2/transitgateway_route_table_associations_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_table_associations_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_route_table_data_source_test.go b/internal/service/ec2/transitgateway_route_table_data_source_test.go index a79fa50cd912..ef48a8d3052c 100644 --- a/internal/service/ec2/transitgateway_route_table_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_table_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_route_table_propagation_test.go b/internal/service/ec2/transitgateway_route_table_propagation_test.go index 968b39c58978..68597c553710 100644 --- a/internal/service/ec2/transitgateway_route_table_propagation_test.go +++ b/internal/service/ec2/transitgateway_route_table_propagation_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_route_table_propagations_data_source_test.go b/internal/service/ec2/transitgateway_route_table_propagations_data_source_test.go index 628b813eb402..afb612dc855a 100644 --- a/internal/service/ec2/transitgateway_route_table_propagations_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_table_propagations_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_route_table_test.go b/internal/service/ec2/transitgateway_route_table_test.go index c0ade555b735..7f9285598847 100644 --- a/internal/service/ec2/transitgateway_route_table_test.go +++ b/internal/service/ec2/transitgateway_route_table_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_route_tables_data_source_test.go b/internal/service/ec2/transitgateway_route_tables_data_source_test.go index bb824002429d..d4cf704336cc 100644 --- a/internal/service/ec2/transitgateway_route_tables_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_tables_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_route_test.go b/internal/service/ec2/transitgateway_route_test.go index a12332a209f8..545e023426fd 100644 --- a/internal/service/ec2/transitgateway_route_test.go +++ b/internal/service/ec2/transitgateway_route_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_test.go b/internal/service/ec2/transitgateway_test.go index 64f5596c60b2..e3417054be1c 100644 --- a/internal/service/ec2/transitgateway_test.go +++ b/internal/service/ec2/transitgateway_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go b/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go index ca74636dda74..32a4c8c93f83 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go b/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go index c944ee063ca0..a8586e1e8d78 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_vpc_attachment_test.go b/internal/service/ec2/transitgateway_vpc_attachment_test.go index 780eea4407e0..b8d74a117e20 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go b/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go index c5dc02affc5e..f90b7a91619b 100644 --- a/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go b/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go index f02b0e70fd4e..dd1e70577497 100644 --- a/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_data_source_test.go b/internal/service/ec2/vpc_data_source_test.go index 6ec25e036f5c..8816d391d97c 100644 --- a/internal/service/ec2/vpc_data_source_test.go +++ b/internal/service/ec2/vpc_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_default_network_acl_test.go b/internal/service/ec2/vpc_default_network_acl_test.go index 6d830984a9a0..dc65912c54fa 100644 --- a/internal/service/ec2/vpc_default_network_acl_test.go +++ b/internal/service/ec2/vpc_default_network_acl_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_default_route_table_test.go b/internal/service/ec2/vpc_default_route_table_test.go index fbf9d1c18b98..ac8469a52c34 100644 --- a/internal/service/ec2/vpc_default_route_table_test.go +++ b/internal/service/ec2/vpc_default_route_table_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_default_security_group_test.go b/internal/service/ec2/vpc_default_security_group_test.go index 1bd543181110..a28115dd121a 100644 --- a/internal/service/ec2/vpc_default_security_group_test.go +++ b/internal/service/ec2/vpc_default_security_group_test.go @@ -6,9 +6,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_default_subnet_test.go b/internal/service/ec2/vpc_default_subnet_test.go index 6aede2d89408..09586d3e5cfe 100644 --- a/internal/service/ec2/vpc_default_subnet_test.go +++ b/internal/service/ec2/vpc_default_subnet_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go b/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go index 1b30e7ed39a1..f1cc0027c930 100644 --- a/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go +++ b/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/vpc_default_vpc_test.go b/internal/service/ec2/vpc_default_vpc_test.go index b2331ed0b534..b257f91bd5c4 100644 --- a/internal/service/ec2/vpc_default_vpc_test.go +++ b/internal/service/ec2/vpc_default_vpc_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_dhcp_options_association_test.go b/internal/service/ec2/vpc_dhcp_options_association_test.go index 60fc4e30634d..9e428f041e28 100644 --- a/internal/service/ec2/vpc_dhcp_options_association_test.go +++ b/internal/service/ec2/vpc_dhcp_options_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_dhcp_options_data_source_test.go b/internal/service/ec2/vpc_dhcp_options_data_source_test.go index 7f221e3aa3be..eb803743744e 100644 --- a/internal/service/ec2/vpc_dhcp_options_data_source_test.go +++ b/internal/service/ec2/vpc_dhcp_options_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_dhcp_options_test.go b/internal/service/ec2/vpc_dhcp_options_test.go index 13379ecf453d..2ad7351c1769 100644 --- a/internal/service/ec2/vpc_dhcp_options_test.go +++ b/internal/service/ec2/vpc_dhcp_options_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_egress_only_internet_gateway_test.go b/internal/service/ec2/vpc_egress_only_internet_gateway_test.go index b0b1df37f439..aa19bfef2e97 100644 --- a/internal/service/ec2/vpc_egress_only_internet_gateway_test.go +++ b/internal/service/ec2/vpc_egress_only_internet_gateway_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go index 5efa3b706050..26abbc39e075 100644 --- a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_connection_notification_test.go b/internal/service/ec2/vpc_endpoint_connection_notification_test.go index a29ba9ba1fd7..2c66d6f6daea 100644 --- a/internal/service/ec2/vpc_endpoint_connection_notification_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_notification_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_data_source_test.go b/internal/service/ec2/vpc_endpoint_data_source_test.go index a6d4592d69c3..af8b7d2ab930 100644 --- a/internal/service/ec2/vpc_endpoint_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_endpoint_policy_test.go b/internal/service/ec2/vpc_endpoint_policy_test.go index 424d84619282..2c31a75fd3c8 100644 --- a/internal/service/ec2/vpc_endpoint_policy_test.go +++ b/internal/service/ec2/vpc_endpoint_policy_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/vpc_endpoint_route_table_association_test.go b/internal/service/ec2/vpc_endpoint_route_table_association_test.go index 8d1100b92838..99dc4d29be60 100644 --- a/internal/service/ec2/vpc_endpoint_route_table_association_test.go +++ b/internal/service/ec2/vpc_endpoint_route_table_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_security_group_association_test.go b/internal/service/ec2/vpc_endpoint_security_group_association_test.go index baf1a4d08dcb..6ba2f0194200 100644 --- a/internal/service/ec2/vpc_endpoint_security_group_association_test.go +++ b/internal/service/ec2/vpc_endpoint_security_group_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go b/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go index 63ce86df6fe5..2aa40c650f87 100644 --- a/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go +++ b/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_service_data_source_test.go b/internal/service/ec2/vpc_endpoint_service_data_source_test.go index 49c7c737173f..fdb84bdb094a 100644 --- a/internal/service/ec2/vpc_endpoint_service_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_service_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_endpoint_service_test.go b/internal/service/ec2/vpc_endpoint_service_test.go index d39b123478ed..4a6256575a4d 100644 --- a/internal/service/ec2/vpc_endpoint_service_test.go +++ b/internal/service/ec2/vpc_endpoint_service_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_subnet_association_test.go b/internal/service/ec2/vpc_endpoint_subnet_association_test.go index 27e1942755b7..9deac9879eca 100644 --- a/internal/service/ec2/vpc_endpoint_subnet_association_test.go +++ b/internal/service/ec2/vpc_endpoint_subnet_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_endpoint_test.go b/internal/service/ec2/vpc_endpoint_test.go index 4b35f5be5f8f..ecf6e70e93fa 100644 --- a/internal/service/ec2/vpc_endpoint_test.go +++ b/internal/service/ec2/vpc_endpoint_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 35ccd118078b..c26f36db7166 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_internet_gateway_attachment_test.go b/internal/service/ec2/vpc_internet_gateway_attachment_test.go index cf463b4517e7..15f18946c5fb 100644 --- a/internal/service/ec2/vpc_internet_gateway_attachment_test.go +++ b/internal/service/ec2/vpc_internet_gateway_attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_internet_gateway_data_source_test.go b/internal/service/ec2/vpc_internet_gateway_data_source_test.go index 432a267243ca..3621f7da9111 100644 --- a/internal/service/ec2/vpc_internet_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_internet_gateway_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_internet_gateway_test.go b/internal/service/ec2/vpc_internet_gateway_test.go index 5a82526b38a0..c4209f6f9841 100644 --- a/internal/service/ec2/vpc_internet_gateway_test.go +++ b/internal/service/ec2/vpc_internet_gateway_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go b/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go index 26216f243550..fd8418d20b44 100644 --- a/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go +++ b/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go b/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go index 8d0ace5323b4..bf0261a822e4 100644 --- a/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go +++ b/internal/service/ec2/vpc_ipv6_cidr_block_association_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_main_route_table_association_test.go b/internal/service/ec2/vpc_main_route_table_association_test.go index 93a75576f093..db9499bdb19e 100644 --- a/internal/service/ec2/vpc_main_route_table_association_test.go +++ b/internal/service/ec2/vpc_main_route_table_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_managed_prefix_list_data_source_test.go b/internal/service/ec2/vpc_managed_prefix_list_data_source_test.go index e28f8674a804..a7c8669044c3 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_data_source_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ec2/vpc_managed_prefix_list_entry_test.go b/internal/service/ec2/vpc_managed_prefix_list_entry_test.go index 0631579b8e5e..b7bc76a6eb1c 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_entry_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_entry_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_managed_prefix_list_test.go b/internal/service/ec2/vpc_managed_prefix_list_test.go index b33c031a7a9f..d600c837c9cd 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_managed_prefix_lists_data_source_test.go b/internal/service/ec2/vpc_managed_prefix_lists_data_source_test.go index d4b0a8001bc5..5f3ddabdb7ad 100644 --- a/internal/service/ec2/vpc_managed_prefix_lists_data_source_test.go +++ b/internal/service/ec2/vpc_managed_prefix_lists_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_nat_gateway_data_source_test.go b/internal/service/ec2/vpc_nat_gateway_data_source_test.go index 34b2e5b6b531..41b9bfbfbd89 100644 --- a/internal/service/ec2/vpc_nat_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateway_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_nat_gateway_test.go b/internal/service/ec2/vpc_nat_gateway_test.go index 58c3d52ac755..e4dce97a54e3 100644 --- a/internal/service/ec2/vpc_nat_gateway_test.go +++ b/internal/service/ec2/vpc_nat_gateway_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_nat_gateways_data_source_test.go b/internal/service/ec2/vpc_nat_gateways_data_source_test.go index c91b4886ddba..04930e5dfe1b 100644 --- a/internal/service/ec2/vpc_nat_gateways_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateways_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_acl_association_test.go b/internal/service/ec2/vpc_network_acl_association_test.go index 851db371678c..aaeef877d871 100644 --- a/internal/service/ec2/vpc_network_acl_association_test.go +++ b/internal/service/ec2/vpc_network_acl_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_acl_rule_test.go b/internal/service/ec2/vpc_network_acl_rule_test.go index 1d69223b888e..b2279f01fe6e 100644 --- a/internal/service/ec2/vpc_network_acl_rule_test.go +++ b/internal/service/ec2/vpc_network_acl_rule_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_acl_test.go b/internal/service/ec2/vpc_network_acl_test.go index 7b6300582196..310fb996158f 100644 --- a/internal/service/ec2/vpc_network_acl_test.go +++ b/internal/service/ec2/vpc_network_acl_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_acls_data_source_test.go b/internal/service/ec2/vpc_network_acls_data_source_test.go index a4a04ad2b74f..292bf1bcc75a 100644 --- a/internal/service/ec2/vpc_network_acls_data_source_test.go +++ b/internal/service/ec2/vpc_network_acls_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_insights_analysis_data_source_test.go b/internal/service/ec2/vpc_network_insights_analysis_data_source_test.go index 3ae5baf3745b..16146ca87617 100644 --- a/internal/service/ec2/vpc_network_insights_analysis_data_source_test.go +++ b/internal/service/ec2/vpc_network_insights_analysis_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_insights_analysis_test.go b/internal/service/ec2/vpc_network_insights_analysis_test.go index 263fde4e7294..3037782933e0 100644 --- a/internal/service/ec2/vpc_network_insights_analysis_test.go +++ b/internal/service/ec2/vpc_network_insights_analysis_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_insights_path_data_source_test.go b/internal/service/ec2/vpc_network_insights_path_data_source_test.go index 606caba0ec88..baa9895b7d3f 100644 --- a/internal/service/ec2/vpc_network_insights_path_data_source_test.go +++ b/internal/service/ec2/vpc_network_insights_path_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_insights_path_test.go b/internal/service/ec2/vpc_network_insights_path_test.go index 441b13a77d6d..81ca17240378 100644 --- a/internal/service/ec2/vpc_network_insights_path_test.go +++ b/internal/service/ec2/vpc_network_insights_path_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_interface_attachment_test.go b/internal/service/ec2/vpc_network_interface_attachment_test.go index f1a5d61bf910..dc65d6811555 100644 --- a/internal/service/ec2/vpc_network_interface_attachment_test.go +++ b/internal/service/ec2/vpc_network_interface_attachment_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_interface_data_source_test.go b/internal/service/ec2/vpc_network_interface_data_source_test.go index 1ead4dd8342c..506a7c767a90 100644 --- a/internal/service/ec2/vpc_network_interface_data_source_test.go +++ b/internal/service/ec2/vpc_network_interface_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_interface_sg_attachment_test.go b/internal/service/ec2/vpc_network_interface_sg_attachment_test.go index ea35601f59b0..3fa30781571b 100644 --- a/internal/service/ec2/vpc_network_interface_sg_attachment_test.go +++ b/internal/service/ec2/vpc_network_interface_sg_attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_interface_test.go b/internal/service/ec2/vpc_network_interface_test.go index 30ec4f6636a0..22ca6d4b8fec 100644 --- a/internal/service/ec2/vpc_network_interface_test.go +++ b/internal/service/ec2/vpc_network_interface_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_network_interfaces_data_source_test.go b/internal/service/ec2/vpc_network_interfaces_data_source_test.go index 2d974bfb10f9..733d53434e1f 100644 --- a/internal/service/ec2/vpc_network_interfaces_data_source_test.go +++ b/internal/service/ec2/vpc_network_interfaces_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_network_performance_metric_subscription_test.go b/internal/service/ec2/vpc_network_performance_metric_subscription_test.go index b3c890c47969..6fcc8dc81172 100644 --- a/internal/service/ec2/vpc_network_performance_metric_subscription_test.go +++ b/internal/service/ec2/vpc_network_performance_metric_subscription_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_peering_connection_accepter_test.go b/internal/service/ec2/vpc_peering_connection_accepter_test.go index ede218c5fdb0..cdd8400a374a 100644 --- a/internal/service/ec2/vpc_peering_connection_accepter_test.go +++ b/internal/service/ec2/vpc_peering_connection_accepter_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_peering_connection_data_source_test.go b/internal/service/ec2/vpc_peering_connection_data_source_test.go index ea5d204049e2..cbf9d7db847a 100644 --- a/internal/service/ec2/vpc_peering_connection_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connection_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_peering_connection_options_test.go b/internal/service/ec2/vpc_peering_connection_options_test.go index c690767e9e2a..305dab6e6b5c 100644 --- a/internal/service/ec2/vpc_peering_connection_options_test.go +++ b/internal/service/ec2/vpc_peering_connection_options_test.go @@ -7,10 +7,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_peering_connection_test.go b/internal/service/ec2/vpc_peering_connection_test.go index 369583cf640c..d1b8a5102a03 100644 --- a/internal/service/ec2/vpc_peering_connection_test.go +++ b/internal/service/ec2/vpc_peering_connection_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_peering_connections_data_source_test.go b/internal/service/ec2/vpc_peering_connections_data_source_test.go index f3314bbbf56c..fdde68f31f53 100644 --- a/internal/service/ec2/vpc_peering_connections_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connections_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_prefix_list_data_source_test.go b/internal/service/ec2/vpc_prefix_list_data_source_test.go index fd2dea7f1197..51c840cac9a8 100644 --- a/internal/service/ec2/vpc_prefix_list_data_source_test.go +++ b/internal/service/ec2/vpc_prefix_list_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_route_data_source_test.go b/internal/service/ec2/vpc_route_data_source_test.go index f1cf3dd9c2a5..08666b3abb35 100644 --- a/internal/service/ec2/vpc_route_data_source_test.go +++ b/internal/service/ec2/vpc_route_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_route_table_association_test.go b/internal/service/ec2/vpc_route_table_association_test.go index 49309af2e3dc..49db9c6834de 100644 --- a/internal/service/ec2/vpc_route_table_association_test.go +++ b/internal/service/ec2/vpc_route_table_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_route_table_data_source_test.go b/internal/service/ec2/vpc_route_table_data_source_test.go index 099c441182ac..f6f907793cdd 100644 --- a/internal/service/ec2/vpc_route_table_data_source_test.go +++ b/internal/service/ec2/vpc_route_table_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index 125e9cb73007..c35184c418be 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_route_tables_data_source_test.go b/internal/service/ec2/vpc_route_tables_data_source_test.go index 28cd7e1bd07a..8dbf6a99c795 100644 --- a/internal/service/ec2/vpc_route_tables_data_source_test.go +++ b/internal/service/ec2/vpc_route_tables_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_route_test.go b/internal/service/ec2/vpc_route_test.go index 78d2ddbeee56..a8af4cdada38 100644 --- a/internal/service/ec2/vpc_route_test.go +++ b/internal/service/ec2/vpc_route_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_security_group_data_source_test.go b/internal/service/ec2/vpc_security_group_data_source_test.go index 9c4c2c5201f9..6c7e6c3e0a68 100644 --- a/internal/service/ec2/vpc_security_group_data_source_test.go +++ b/internal/service/ec2/vpc_security_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_security_group_egress_rule_test.go b/internal/service/ec2/vpc_security_group_egress_rule_test.go index 1080203a4c7b..8eb0ca399765 100644 --- a/internal/service/ec2/vpc_security_group_egress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_egress_rule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_security_group_ingress_rule_test.go b/internal/service/ec2/vpc_security_group_ingress_rule_test.go index 74ea9fffffd8..841cfd8bd955 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_test.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_security_group_rule_data_source_test.go b/internal/service/ec2/vpc_security_group_rule_data_source_test.go index c879e9cf3fd7..4e46a4e7a3cc 100644 --- a/internal/service/ec2/vpc_security_group_rule_data_source_test.go +++ b/internal/service/ec2/vpc_security_group_rule_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_security_group_rule_test.go b/internal/service/ec2/vpc_security_group_rule_test.go index d70559b5864d..35d2ff865777 100644 --- a/internal/service/ec2/vpc_security_group_rule_test.go +++ b/internal/service/ec2/vpc_security_group_rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" ) diff --git a/internal/service/ec2/vpc_security_group_rules_data_source_test.go b/internal/service/ec2/vpc_security_group_rules_data_source_test.go index f83bb9034541..6e5132a8db7e 100644 --- a/internal/service/ec2/vpc_security_group_rules_data_source_test.go +++ b/internal/service/ec2/vpc_security_group_rules_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index bd41547e1394..ceec0ead0b30 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -11,11 +11,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ec2/vpc_security_groups_data_source_test.go b/internal/service/ec2/vpc_security_groups_data_source_test.go index d3fdaf3f3620..7bfbad0ea625 100644 --- a/internal/service/ec2/vpc_security_groups_data_source_test.go +++ b/internal/service/ec2/vpc_security_groups_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go index 5d58b7122597..6c9c6b35c0c6 100644 --- a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go +++ b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_subnet_data_source_test.go b/internal/service/ec2/vpc_subnet_data_source_test.go index 7f9ab39fbf14..c0f2d1776d32 100644 --- a/internal/service/ec2/vpc_subnet_data_source_test.go +++ b/internal/service/ec2/vpc_subnet_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_subnet_test.go b/internal/service/ec2/vpc_subnet_test.go index bd359acf2871..596d0e2100d0 100644 --- a/internal/service/ec2/vpc_subnet_test.go +++ b/internal/service/ec2/vpc_subnet_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_subnets_data_source_test.go b/internal/service/ec2/vpc_subnets_data_source_test.go index 1181498d64ff..fead1db346aa 100644 --- a/internal/service/ec2/vpc_subnets_data_source_test.go +++ b/internal/service/ec2/vpc_subnets_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index f45a6eae41de..22f7762588fd 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go b/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go index d983b41106e8..ea6c4487639e 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_test.go b/internal/service/ec2/vpc_traffic_mirror_filter_test.go index c4a3c47cf848..61688fba043b 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_traffic_mirror_session_test.go b/internal/service/ec2/vpc_traffic_mirror_session_test.go index a1ba4624451a..5092d816bbd0 100644 --- a/internal/service/ec2/vpc_traffic_mirror_session_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_session_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_traffic_mirror_target_test.go b/internal/service/ec2/vpc_traffic_mirror_target_test.go index a07b4dc4ba56..9b42c50a0abe 100644 --- a/internal/service/ec2/vpc_traffic_mirror_target_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_target_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpc_vpcs_data_source_test.go b/internal/service/ec2/vpc_vpcs_data_source_test.go index 967ac41856cd..fa99093c1891 100644 --- a/internal/service/ec2/vpc_vpcs_data_source_test.go +++ b/internal/service/ec2/vpc_vpcs_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpnclient_authorization_rule_test.go b/internal/service/ec2/vpnclient_authorization_rule_test.go index bcf5db529267..b417afa51b78 100644 --- a/internal/service/ec2/vpnclient_authorization_rule_test.go +++ b/internal/service/ec2/vpnclient_authorization_rule_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnclient_endpoint_data_source_test.go b/internal/service/ec2/vpnclient_endpoint_data_source_test.go index b3f48dc7989c..1a57186887d6 100644 --- a/internal/service/ec2/vpnclient_endpoint_data_source_test.go +++ b/internal/service/ec2/vpnclient_endpoint_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpnclient_endpoint_test.go b/internal/service/ec2/vpnclient_endpoint_test.go index 73bd1be3f99d..33383b883744 100644 --- a/internal/service/ec2/vpnclient_endpoint_test.go +++ b/internal/service/ec2/vpnclient_endpoint_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/experimental/sync" diff --git a/internal/service/ec2/vpnclient_network_association_test.go b/internal/service/ec2/vpnclient_network_association_test.go index eedfecea78b7..8bf74975f891 100644 --- a/internal/service/ec2/vpnclient_network_association_test.go +++ b/internal/service/ec2/vpnclient_network_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnclient_route_test.go b/internal/service/ec2/vpnclient_route_test.go index 151a98948ec4..8b5c92fb3a23 100644 --- a/internal/service/ec2/vpnclient_route_test.go +++ b/internal/service/ec2/vpnclient_route_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_connection_route_test.go b/internal/service/ec2/vpnsite_connection_route_test.go index 77d25e8eebd1..4a19b19a8b7d 100644 --- a/internal/service/ec2/vpnsite_connection_route_test.go +++ b/internal/service/ec2/vpnsite_connection_route_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_connection_test.go b/internal/service/ec2/vpnsite_connection_test.go index 6a311159948f..6750075d904a 100644 --- a/internal/service/ec2/vpnsite_connection_test.go +++ b/internal/service/ec2/vpnsite_connection_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go b/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go index 4d294d9f35cc..36ea0257a3f0 100644 --- a/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go +++ b/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpnsite_customer_gateway_test.go b/internal/service/ec2/vpnsite_customer_gateway_test.go index e270a9b3b651..9dd38beb6533 100644 --- a/internal/service/ec2/vpnsite_customer_gateway_test.go +++ b/internal/service/ec2/vpnsite_customer_gateway_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_gateway_attachment_test.go b/internal/service/ec2/vpnsite_gateway_attachment_test.go index 0ac60dc5da08..4b4d13b7456d 100644 --- a/internal/service/ec2/vpnsite_gateway_attachment_test.go +++ b/internal/service/ec2/vpnsite_gateway_attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_gateway_data_source_test.go b/internal/service/ec2/vpnsite_gateway_data_source_test.go index c3ca8c14c131..cdc9972ad66c 100644 --- a/internal/service/ec2/vpnsite_gateway_data_source_test.go +++ b/internal/service/ec2/vpnsite_gateway_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go index f82837abc07c..417b969694a9 100644 --- a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go +++ b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/vpnsite_gateway_test.go b/internal/service/ec2/vpnsite_gateway_test.go index ecc026628a85..893b1eb06ec6 100644 --- a/internal/service/ec2/vpnsite_gateway_test.go +++ b/internal/service/ec2/vpnsite_gateway_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ec2/wavelength_carrier_gateway_test.go b/internal/service/ec2/wavelength_carrier_gateway_test.go index db4d90662376..f4e49589fd1a 100644 --- a/internal/service/ec2/wavelength_carrier_gateway_test.go +++ b/internal/service/ec2/wavelength_carrier_gateway_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/ecr/authorization_token_data_source_test.go b/internal/service/ecr/authorization_token_data_source_test.go index ad3768261920..2d0968909c41 100644 --- a/internal/service/ecr/authorization_token_data_source_test.go +++ b/internal/service/ecr/authorization_token_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecr/errorcheck_test.go b/internal/service/ecr/errorcheck_test.go index 79ca9647768c..2ebd3ad64814 100644 --- a/internal/service/ecr/errorcheck_test.go +++ b/internal/service/ecr/errorcheck_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecr/image_data_source_test.go b/internal/service/ecr/image_data_source_test.go index db64fcd543dd..05f03bc1e766 100644 --- a/internal/service/ecr/image_data_source_test.go +++ b/internal/service/ecr/image_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecr/lifecycle_policy_test.go b/internal/service/ecr/lifecycle_policy_test.go index c3d81223bf2c..bd5aebd6bc9c 100644 --- a/internal/service/ecr/lifecycle_policy_test.go +++ b/internal/service/ecr/lifecycle_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/ecr/pull_through_cache_rule_test.go b/internal/service/ecr/pull_through_cache_rule_test.go index b82df726887d..a09c78d65bc7 100644 --- a/internal/service/ecr/pull_through_cache_rule_test.go +++ b/internal/service/ecr/pull_through_cache_rule_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" diff --git a/internal/service/ecr/registry_policy_test.go b/internal/service/ecr/registry_policy_test.go index eaca6d9c7aa5..27fe5cece5e7 100644 --- a/internal/service/ecr/registry_policy_test.go +++ b/internal/service/ecr/registry_policy_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" diff --git a/internal/service/ecr/registry_scanning_configuration_test.go b/internal/service/ecr/registry_scanning_configuration_test.go index 9d9eba9ead59..3037112c6d1a 100644 --- a/internal/service/ecr/registry_scanning_configuration_test.go +++ b/internal/service/ecr/registry_scanning_configuration_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ecr/replication_configuration_test.go b/internal/service/ecr/replication_configuration_test.go index 9fd6608216f6..52ff076887d0 100644 --- a/internal/service/ecr/replication_configuration_test.go +++ b/internal/service/ecr/replication_configuration_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ecr/repository_data_source_test.go b/internal/service/ecr/repository_data_source_test.go index dc73b460b66b..2c84980a2e68 100644 --- a/internal/service/ecr/repository_data_source_test.go +++ b/internal/service/ecr/repository_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecr/repository_policy_test.go b/internal/service/ecr/repository_policy_test.go index 94d6e2fa43d1..4f791adab031 100644 --- a/internal/service/ecr/repository_policy_test.go +++ b/internal/service/ecr/repository_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" diff --git a/internal/service/ecr/repository_test.go b/internal/service/ecr/repository_test.go index 9b314b1ac6cc..aa4b91c45229 100644 --- a/internal/service/ecr/repository_test.go +++ b/internal/service/ecr/repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecr "github.com/hashicorp/terraform-provider-aws/internal/service/ecr" diff --git a/internal/service/ecr/sweep.go b/internal/service/ecr/sweep.go index cc3e134c8b53..d25ed4fcc017 100644 --- a/internal/service/ecr/sweep.go +++ b/internal/service/ecr/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ecrpublic/authorization_token_data_source_test.go b/internal/service/ecrpublic/authorization_token_data_source_test.go index 8b5d2b1a7ece..1a192008b2d4 100644 --- a/internal/service/ecrpublic/authorization_token_data_source_test.go +++ b/internal/service/ecrpublic/authorization_token_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecrpublic/repository_policy_test.go b/internal/service/ecrpublic/repository_policy_test.go index 6580a9a3e6d0..8fad4640fba6 100644 --- a/internal/service/ecrpublic/repository_policy_test.go +++ b/internal/service/ecrpublic/repository_policy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ecrpublic" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecrpublic "github.com/hashicorp/terraform-provider-aws/internal/service/ecrpublic" diff --git a/internal/service/ecrpublic/repository_test.go b/internal/service/ecrpublic/repository_test.go index aebb34488d76..a1f1f8d52712 100644 --- a/internal/service/ecrpublic/repository_test.go +++ b/internal/service/ecrpublic/repository_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ecrpublic" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecrpublic "github.com/hashicorp/terraform-provider-aws/internal/service/ecrpublic" diff --git a/internal/service/ecrpublic/sweep.go b/internal/service/ecrpublic/sweep.go index 7ac66b28e44f..5a896ac43726 100644 --- a/internal/service/ecrpublic/sweep.go +++ b/internal/service/ecrpublic/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecrpublic" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ecs/account_setting_default_test.go b/internal/service/ecs/account_setting_default_test.go index 7c556064e136..6b6d98a03742 100644 --- a/internal/service/ecs/account_setting_default_test.go +++ b/internal/service/ecs/account_setting_default_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index 02745b79dbfb..583a089cce9b 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/cluster_capacity_providers_test.go b/internal/service/ecs/cluster_capacity_providers_test.go index d05b4271b43d..f058fe832f5e 100644 --- a/internal/service/ecs/cluster_capacity_providers_test.go +++ b/internal/service/ecs/cluster_capacity_providers_test.go @@ -6,9 +6,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" ) diff --git a/internal/service/ecs/cluster_data_source_test.go b/internal/service/ecs/cluster_data_source_test.go index bc1c21a1e328..481c23ab198d 100644 --- a/internal/service/ecs/cluster_data_source_test.go +++ b/internal/service/ecs/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecs/cluster_test.go b/internal/service/ecs/cluster_test.go index 794c13aaa12c..f5ad0a79ba3e 100644 --- a/internal/service/ecs/cluster_test.go +++ b/internal/service/ecs/cluster_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/container_definition_data_source_test.go b/internal/service/ecs/container_definition_data_source_test.go index e18fdb079d31..0e172591d034 100644 --- a/internal/service/ecs/container_definition_data_source_test.go +++ b/internal/service/ecs/container_definition_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecs/service_data_source_test.go b/internal/service/ecs/service_data_source_test.go index b2da89f7e43d..98aa9337e7c4 100644 --- a/internal/service/ecs/service_data_source_test.go +++ b/internal/service/ecs/service_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index 03f05a0b35fc..58c1ae51bf88 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -12,10 +12,10 @@ import ( "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/aws-sdk-go/service/servicediscovery" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/sweep.go b/internal/service/ecs/sweep.go index bf2f99aab858..173d113e4799 100644 --- a/internal/service/ecs/sweep.go +++ b/internal/service/ecs/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ecs/tag_gen_test.go b/internal/service/ecs/tag_gen_test.go index d36c1b041207..0c7adab4d36c 100644 --- a/internal/service/ecs/tag_gen_test.go +++ b/internal/service/ecs/tag_gen_test.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/ecs" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/tag_test.go b/internal/service/ecs/tag_test.go index 0e8f04b79327..18fe71ade121 100644 --- a/internal/service/ecs/tag_test.go +++ b/internal/service/ecs/tag_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/task_definition_data_source_test.go b/internal/service/ecs/task_definition_data_source_test.go index 998b660a50f7..d6fdce77d71d 100644 --- a/internal/service/ecs/task_definition_data_source_test.go +++ b/internal/service/ecs/task_definition_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecs/task_definition_test.go b/internal/service/ecs/task_definition_test.go index a5efecfa1d75..29ec6e71fecd 100644 --- a/internal/service/ecs/task_definition_test.go +++ b/internal/service/ecs/task_definition_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/ecs/task_execution_data_source_test.go b/internal/service/ecs/task_execution_data_source_test.go index a08a9ef67217..ff4cabc6e806 100644 --- a/internal/service/ecs/task_execution_data_source_test.go +++ b/internal/service/ecs/task_execution_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ecs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ecs/task_set_test.go b/internal/service/ecs/task_set_test.go index 5658ee64a38f..4d2ba27de2f0 100644 --- a/internal/service/ecs/task_set_test.go +++ b/internal/service/ecs/task_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfecs "github.com/hashicorp/terraform-provider-aws/internal/service/ecs" diff --git a/internal/service/efs/access_point_data_source_test.go b/internal/service/efs/access_point_data_source_test.go index 05714bc06ffd..efb0c48dfe36 100644 --- a/internal/service/efs/access_point_data_source_test.go +++ b/internal/service/efs/access_point_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/efs/access_point_test.go b/internal/service/efs/access_point_test.go index 915c54db2405..c8b1eb572553 100644 --- a/internal/service/efs/access_point_test.go +++ b/internal/service/efs/access_point_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/access_points_data_source_test.go b/internal/service/efs/access_points_data_source_test.go index 66a937283b48..1d29e6c9a328 100644 --- a/internal/service/efs/access_points_data_source_test.go +++ b/internal/service/efs/access_points_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/efs/backup_policy_test.go b/internal/service/efs/backup_policy_test.go index 5d6f8c993165..3b1293b3d97b 100644 --- a/internal/service/efs/backup_policy_test.go +++ b/internal/service/efs/backup_policy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/file_system_data_source_test.go b/internal/service/efs/file_system_data_source_test.go index 2d6a5362f1d5..82a2fe8fd6b9 100644 --- a/internal/service/efs/file_system_data_source_test.go +++ b/internal/service/efs/file_system_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/efs/file_system_policy_test.go b/internal/service/efs/file_system_policy_test.go index d0b4c1b1af8c..d079cf5b6de7 100644 --- a/internal/service/efs/file_system_policy_test.go +++ b/internal/service/efs/file_system_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/file_system_test.go b/internal/service/efs/file_system_test.go index 280732b5dcac..c5f773c0181d 100644 --- a/internal/service/efs/file_system_test.go +++ b/internal/service/efs/file_system_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/mount_target_data_source_test.go b/internal/service/efs/mount_target_data_source_test.go index 59d5a71a6795..7c0625d3a110 100644 --- a/internal/service/efs/mount_target_data_source_test.go +++ b/internal/service/efs/mount_target_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/efs/mount_target_test.go b/internal/service/efs/mount_target_test.go index e0f27494b651..05b3b6fc60d9 100644 --- a/internal/service/efs/mount_target_test.go +++ b/internal/service/efs/mount_target_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/replication_configuration_test.go b/internal/service/efs/replication_configuration_test.go index 69792d1fe959..1f2faa22d8e1 100644 --- a/internal/service/efs/replication_configuration_test.go +++ b/internal/service/efs/replication_configuration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/efs" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfefs "github.com/hashicorp/terraform-provider-aws/internal/service/efs" diff --git a/internal/service/efs/sweep.go b/internal/service/efs/sweep.go index 072d9e8ab2d7..89894eaa2ec9 100644 --- a/internal/service/efs/sweep.go +++ b/internal/service/efs/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/efs" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/eks/addon_data_source_test.go b/internal/service/eks/addon_data_source_test.go index b894067b8fb2..33653dd95a09 100644 --- a/internal/service/eks/addon_data_source_test.go +++ b/internal/service/eks/addon_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 1471387d50ec..b7e307a5b53e 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" diff --git a/internal/service/eks/addon_version_data_source_test.go b/internal/service/eks/addon_version_data_source_test.go index bc60c30884ff..4f6e713c3fc9 100644 --- a/internal/service/eks/addon_version_data_source_test.go +++ b/internal/service/eks/addon_version_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/cluster_auth_data_source_test.go b/internal/service/eks/cluster_auth_data_source_test.go index 226497ee4f79..4fc869488dbd 100644 --- a/internal/service/eks/cluster_auth_data_source_test.go +++ b/internal/service/eks/cluster_auth_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" ) diff --git a/internal/service/eks/cluster_data_source_test.go b/internal/service/eks/cluster_data_source_test.go index 66ea5119e73c..54e68c36b049 100644 --- a/internal/service/eks/cluster_data_source_test.go +++ b/internal/service/eks/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/cluster_test.go b/internal/service/eks/cluster_test.go index 3d7bc88bd509..94b7c276965e 100644 --- a/internal/service/eks/cluster_test.go +++ b/internal/service/eks/cluster_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" diff --git a/internal/service/eks/clusters_data_source_test.go b/internal/service/eks/clusters_data_source_test.go index 0360105eadaa..c0a7b5ef0731 100644 --- a/internal/service/eks/clusters_data_source_test.go +++ b/internal/service/eks/clusters_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/fargate_profile_test.go b/internal/service/eks/fargate_profile_test.go index caa79d9a72b6..4001dca356a0 100644 --- a/internal/service/eks/fargate_profile_test.go +++ b/internal/service/eks/fargate_profile_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" diff --git a/internal/service/eks/identity_provider_config_test.go b/internal/service/eks/identity_provider_config_test.go index 951825d47fd3..da479103e0fb 100644 --- a/internal/service/eks/identity_provider_config_test.go +++ b/internal/service/eks/identity_provider_config_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" diff --git a/internal/service/eks/node_group_data_source_test.go b/internal/service/eks/node_group_data_source_test.go index b49b368d0554..a25102e66aea 100644 --- a/internal/service/eks/node_group_data_source_test.go +++ b/internal/service/eks/node_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 391b8309609d..8282bf49a1c7 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfeks "github.com/hashicorp/terraform-provider-aws/internal/service/eks" diff --git a/internal/service/eks/node_groups_data_source_test.go b/internal/service/eks/node_groups_data_source_test.go index bda88c8c31d6..f770915782ff 100644 --- a/internal/service/eks/node_groups_data_source_test.go +++ b/internal/service/eks/node_groups_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/eks/sweep.go b/internal/service/eks/sweep.go index 093267af7b71..580a191b1b06 100644 --- a/internal/service/eks/sweep.go +++ b/internal/service/eks/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/eks/validate_test.go b/internal/service/eks/validate_test.go index 314907ae548c..352a6bb2bcde 100644 --- a/internal/service/eks/validate_test.go +++ b/internal/service/eks/validate_test.go @@ -3,7 +3,7 @@ package eks import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidClusterName(t *testing.T) { diff --git a/internal/service/elasticache/cluster_data_source_test.go b/internal/service/elasticache/cluster_data_source_test.go index 66933858e754..f60d8b5d2c63 100644 --- a/internal/service/elasticache/cluster_data_source_test.go +++ b/internal/service/elasticache/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticache/cluster_test.go b/internal/service/elasticache/cluster_test.go index 4e7dd5d4d6d8..91c4cb3ab1ab 100644 --- a/internal/service/elasticache/cluster_test.go +++ b/internal/service/elasticache/cluster_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/global_replication_group_test.go b/internal/service/elasticache/global_replication_group_test.go index 24a17fe4bad1..57e610d4b8f9 100644 --- a/internal/service/elasticache/global_replication_group_test.go +++ b/internal/service/elasticache/global_replication_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/parameter_group_test.go b/internal/service/elasticache/parameter_group_test.go index 283f7bdd3631..81358689e1dc 100644 --- a/internal/service/elasticache/parameter_group_test.go +++ b/internal/service/elasticache/parameter_group_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index 245c6c1c8536..3aa51a5c5fa0 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index accf5fb02653..25c8eda29901 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/subnet_group_data_source_test.go b/internal/service/elasticache/subnet_group_data_source_test.go index 9353ff6ee00d..a8a056715036 100644 --- a/internal/service/elasticache/subnet_group_data_source_test.go +++ b/internal/service/elasticache/subnet_group_data_source_test.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticache/subnet_group_test.go b/internal/service/elasticache/subnet_group_test.go index b16cb2eb3549..d109cf47506c 100644 --- a/internal/service/elasticache/subnet_group_test.go +++ b/internal/service/elasticache/subnet_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/sweep.go b/internal/service/elasticache/sweep.go index 289eca1a5ef2..33eae5d89a97 100644 --- a/internal/service/elasticache/sweep.go +++ b/internal/service/elasticache/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/elasticache/user_data_source_test.go b/internal/service/elasticache/user_data_source_test.go index df3334371b27..78de2aada810 100644 --- a/internal/service/elasticache/user_data_source_test.go +++ b/internal/service/elasticache/user_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticache/user_group_association_test.go b/internal/service/elasticache/user_group_association_test.go index 8c0d362804e3..db2a1b45ce62 100644 --- a/internal/service/elasticache/user_group_association_test.go +++ b/internal/service/elasticache/user_group_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/user_group_test.go b/internal/service/elasticache/user_group_test.go index 18cc4054b499..a45f70c341ce 100644 --- a/internal/service/elasticache/user_group_test.go +++ b/internal/service/elasticache/user_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/user_test.go b/internal/service/elasticache/user_test.go index acf7f17ba152..eafd9f5d6db7 100644 --- a/internal/service/elasticache/user_test.go +++ b/internal/service/elasticache/user_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticache" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticache "github.com/hashicorp/terraform-provider-aws/internal/service/elasticache" diff --git a/internal/service/elasticache/validate_test.go b/internal/service/elasticache/validate_test.go index 01abe343eece..609b7e9f561d 100644 --- a/internal/service/elasticache/validate_test.go +++ b/internal/service/elasticache/validate_test.go @@ -3,7 +3,7 @@ package elasticache import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidReplicationGroupAuthToken(t *testing.T) { diff --git a/internal/service/elasticbeanstalk/application_data_source_test.go b/internal/service/elasticbeanstalk/application_data_source_test.go index 3b38c9b80182..e311cc689d06 100644 --- a/internal/service/elasticbeanstalk/application_data_source_test.go +++ b/internal/service/elasticbeanstalk/application_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticbeanstalk/application_test.go b/internal/service/elasticbeanstalk/application_test.go index d4173232a478..a45399b9b096 100644 --- a/internal/service/elasticbeanstalk/application_test.go +++ b/internal/service/elasticbeanstalk/application_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" diff --git a/internal/service/elasticbeanstalk/application_version_test.go b/internal/service/elasticbeanstalk/application_version_test.go index 43a6a1008a8c..2cc5d6a742f7 100644 --- a/internal/service/elasticbeanstalk/application_version_test.go +++ b/internal/service/elasticbeanstalk/application_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/elasticbeanstalk/configuration_template_test.go b/internal/service/elasticbeanstalk/configuration_template_test.go index b5a268c689f3..162ff73ac76c 100644 --- a/internal/service/elasticbeanstalk/configuration_template_test.go +++ b/internal/service/elasticbeanstalk/configuration_template_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" diff --git a/internal/service/elasticbeanstalk/environment_test.go b/internal/service/elasticbeanstalk/environment_test.go index b21878235e2a..a36bba5f78bc 100644 --- a/internal/service/elasticbeanstalk/environment_test.go +++ b/internal/service/elasticbeanstalk/environment_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" diff --git a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go index 5155a3ee1949..604c8c1ef7b3 100644 --- a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go +++ b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfelasticbeanstalk "github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk" ) diff --git a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go index 92cd6bc3fedb..c5c2f4a12b11 100644 --- a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go +++ b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticbeanstalk/sweep.go b/internal/service/elasticbeanstalk/sweep.go index 39ca7e5ae05e..e01086c3daeb 100644 --- a/internal/service/elasticbeanstalk/sweep.go +++ b/internal/service/elasticbeanstalk/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/elasticsearch/acc_test.go b/internal/service/elasticsearch/acc_test.go index 8ecaafb70bb0..76009068d763 100644 --- a/internal/service/elasticsearch/acc_test.go +++ b/internal/service/elasticsearch/acc_test.go @@ -4,8 +4,8 @@ import ( "fmt" awspolicy "github.com/hashicorp/awspolicyequivalence" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" ) func testAccCheckPolicyMatch(resource, attr, expectedPolicy string) resource.TestCheckFunc { diff --git a/internal/service/elasticsearch/domain_data_source_test.go b/internal/service/elasticsearch/domain_data_source_test.go index 5c5f791cc582..5008c45482b7 100644 --- a/internal/service/elasticsearch/domain_data_source_test.go +++ b/internal/service/elasticsearch/domain_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elasticsearch/domain_policy_test.go b/internal/service/elasticsearch/domain_policy_test.go index 237a45e56b47..2ff434b3de8f 100644 --- a/internal/service/elasticsearch/domain_policy_test.go +++ b/internal/service/elasticsearch/domain_policy_test.go @@ -5,9 +5,9 @@ import ( "testing" elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/elasticsearch/domain_saml_options_test.go b/internal/service/elasticsearch/domain_saml_options_test.go index 6883fda83797..7a63930b09d9 100644 --- a/internal/service/elasticsearch/domain_saml_options_test.go +++ b/internal/service/elasticsearch/domain_saml_options_test.go @@ -6,9 +6,9 @@ import ( "testing" elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticsearch "github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch" diff --git a/internal/service/elasticsearch/domain_test.go b/internal/service/elasticsearch/domain_test.go index 5c0bdc7ca612..d82d1db5123e 100644 --- a/internal/service/elasticsearch/domain_test.go +++ b/internal/service/elasticsearch/domain_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelasticsearch "github.com/hashicorp/terraform-provider-aws/internal/service/elasticsearch" diff --git a/internal/service/elasticsearch/sweep.go b/internal/service/elasticsearch/sweep.go index 794e5f1ab016..b3b93a5968d3 100644 --- a/internal/service/elasticsearch/sweep.go +++ b/internal/service/elasticsearch/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/elastictranscoder/pipeline_test.go b/internal/service/elastictranscoder/pipeline_test.go index ff54f5daa8cf..bb0b5bc3d324 100644 --- a/internal/service/elastictranscoder/pipeline_test.go +++ b/internal/service/elastictranscoder/pipeline_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elastictranscoder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelastictranscoder "github.com/hashicorp/terraform-provider-aws/internal/service/elastictranscoder" diff --git a/internal/service/elastictranscoder/preset_test.go b/internal/service/elastictranscoder/preset_test.go index 2ff55e6a2db7..d562304d9b7d 100644 --- a/internal/service/elastictranscoder/preset_test.go +++ b/internal/service/elastictranscoder/preset_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elastictranscoder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfet "github.com/hashicorp/terraform-provider-aws/internal/service/elastictranscoder" diff --git a/internal/service/elb/app_cookie_stickiness_policy_test.go b/internal/service/elb/app_cookie_stickiness_policy_test.go index cd818f73b320..46f0181f030c 100644 --- a/internal/service/elb/app_cookie_stickiness_policy_test.go +++ b/internal/service/elb/app_cookie_stickiness_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/attachment_test.go b/internal/service/elb/attachment_test.go index 5d60475e36c9..9e3f0e83fac5 100644 --- a/internal/service/elb/attachment_test.go +++ b/internal/service/elb/attachment_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/elb/backend_server_policy_test.go b/internal/service/elb/backend_server_policy_test.go index 205117428b82..d95b88711a87 100644 --- a/internal/service/elb/backend_server_policy_test.go +++ b/internal/service/elb/backend_server_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/hosted_zone_id_data_source_test.go b/internal/service/elb/hosted_zone_id_data_source_test.go index de4da6d678b0..927ae670be81 100644 --- a/internal/service/elb/hosted_zone_id_data_source_test.go +++ b/internal/service/elb/hosted_zone_id_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" ) diff --git a/internal/service/elb/lb_cookie_stickiness_policy_test.go b/internal/service/elb/lb_cookie_stickiness_policy_test.go index e9116abb883e..f1efe8b3c7df 100644 --- a/internal/service/elb/lb_cookie_stickiness_policy_test.go +++ b/internal/service/elb/lb_cookie_stickiness_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/lb_ssl_negotiation_policy_test.go b/internal/service/elb/lb_ssl_negotiation_policy_test.go index f6a84e718cfb..47b3be613590 100644 --- a/internal/service/elb/lb_ssl_negotiation_policy_test.go +++ b/internal/service/elb/lb_ssl_negotiation_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/listener_policy_test.go b/internal/service/elb/listener_policy_test.go index 32851061182f..9fc11065b508 100644 --- a/internal/service/elb/listener_policy_test.go +++ b/internal/service/elb/listener_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/load_balancer_data_source_test.go b/internal/service/elb/load_balancer_data_source_test.go index ef99e53d349e..d155418ca787 100644 --- a/internal/service/elb/load_balancer_data_source_test.go +++ b/internal/service/elb/load_balancer_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elb/load_balancer_test.go b/internal/service/elb/load_balancer_test.go index 92b8ccfdcfdf..f248acc2ba6e 100644 --- a/internal/service/elb/load_balancer_test.go +++ b/internal/service/elb/load_balancer_test.go @@ -11,9 +11,9 @@ import ( // nosemgrep:ci.aws-sdk-go-multiple-service-imports "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/policy_test.go b/internal/service/elb/policy_test.go index f2a8fb76a117..74cfd95dae0b 100644 --- a/internal/service/elb/policy_test.go +++ b/internal/service/elb/policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" diff --git a/internal/service/elb/proxy_protocol_policy_test.go b/internal/service/elb/proxy_protocol_policy_test.go index e44951644ea5..241e41ce45e2 100644 --- a/internal/service/elb/proxy_protocol_policy_test.go +++ b/internal/service/elb/proxy_protocol_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/elb/service_account_data_source_test.go b/internal/service/elb/service_account_data_source_test.go index 0af6650f88be..464cc9cf3950 100644 --- a/internal/service/elb/service_account_data_source_test.go +++ b/internal/service/elb/service_account_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfelb "github.com/hashicorp/terraform-provider-aws/internal/service/elb" ) diff --git a/internal/service/elb/sweep.go b/internal/service/elb/sweep.go index 137829cc7614..8c5d54132b0a 100644 --- a/internal/service/elb/sweep.go +++ b/internal/service/elb/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/elbv2/hosted_zone_id_data_source_test.go b/internal/service/elbv2/hosted_zone_id_data_source_test.go index 8d0a1e448095..0c2458cc6a6b 100644 --- a/internal/service/elbv2/hosted_zone_id_data_source_test.go +++ b/internal/service/elbv2/hosted_zone_id_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" ) diff --git a/internal/service/elbv2/listener_certificate_test.go b/internal/service/elbv2/listener_certificate_test.go index 905263c3dc7c..8ca27a25ca86 100644 --- a/internal/service/elbv2/listener_certificate_test.go +++ b/internal/service/elbv2/listener_certificate_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" diff --git a/internal/service/elbv2/listener_data_source_test.go b/internal/service/elbv2/listener_data_source_test.go index 8fcb5f25a065..84b5cce9b4f4 100644 --- a/internal/service/elbv2/listener_data_source_test.go +++ b/internal/service/elbv2/listener_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elbv2/listener_rule_test.go b/internal/service/elbv2/listener_rule_test.go index 618f0c0a8e9a..b6223650454c 100644 --- a/internal/service/elbv2/listener_rule_test.go +++ b/internal/service/elbv2/listener_rule_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" diff --git a/internal/service/elbv2/listener_test.go b/internal/service/elbv2/listener_test.go index dd3f95ab1df4..3b2c4ba7a4f5 100644 --- a/internal/service/elbv2/listener_test.go +++ b/internal/service/elbv2/listener_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" diff --git a/internal/service/elbv2/load_balancer_data_source_test.go b/internal/service/elbv2/load_balancer_data_source_test.go index fd2921151a71..c7aadfe5f47e 100644 --- a/internal/service/elbv2/load_balancer_data_source_test.go +++ b/internal/service/elbv2/load_balancer_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elbv2/load_balancer_test.go b/internal/service/elbv2/load_balancer_test.go index d4f66d404179..76de8af7afce 100644 --- a/internal/service/elbv2/load_balancer_test.go +++ b/internal/service/elbv2/load_balancer_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" diff --git a/internal/service/elbv2/load_balancers_data_source_test.go b/internal/service/elbv2/load_balancers_data_source_test.go index 39bce2dd1ac1..8ea3d59dbde0 100644 --- a/internal/service/elbv2/load_balancers_data_source_test.go +++ b/internal/service/elbv2/load_balancers_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elbv2/sweep.go b/internal/service/elbv2/sweep.go index e711ccd0dcce..27003f767985 100644 --- a/internal/service/elbv2/sweep.go +++ b/internal/service/elbv2/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/elbv2/target_group_attachment_test.go b/internal/service/elbv2/target_group_attachment_test.go index 76aa282ff69d..7a256f5d0c95 100644 --- a/internal/service/elbv2/target_group_attachment_test.go +++ b/internal/service/elbv2/target_group_attachment_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/elbv2/target_group_data_source_test.go b/internal/service/elbv2/target_group_data_source_test.go index fa880ceb1836..da322b7b73b3 100644 --- a/internal/service/elbv2/target_group_data_source_test.go +++ b/internal/service/elbv2/target_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/elbv2/target_group_test.go b/internal/service/elbv2/target_group_test.go index bbdb3b47f258..97f5a07c2a64 100644 --- a/internal/service/elbv2/target_group_test.go +++ b/internal/service/elbv2/target_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfelbv2 "github.com/hashicorp/terraform-provider-aws/internal/service/elbv2" diff --git a/internal/service/elbv2/validate_test.go b/internal/service/elbv2/validate_test.go index 494436d12b7e..e7a62b134bb9 100644 --- a/internal/service/elbv2/validate_test.go +++ b/internal/service/elbv2/validate_test.go @@ -3,7 +3,7 @@ package elbv2 import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidName(t *testing.T) { diff --git a/internal/service/emr/block_public_access_configuration_test.go b/internal/service/emr/block_public_access_configuration_test.go index db24233b0226..d823460660b3 100644 --- a/internal/service/emr/block_public_access_configuration_test.go +++ b/internal/service/emr/block_public_access_configuration_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/emr/cluster_test.go b/internal/service/emr/cluster_test.go index 312f8d9a1c70..bae8afe69945 100644 --- a/internal/service/emr/cluster_test.go +++ b/internal/service/emr/cluster_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/emr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/emr/instance_fleet_test.go b/internal/service/emr/instance_fleet_test.go index ace9edebc1cb..f7d0faed338e 100644 --- a/internal/service/emr/instance_fleet_test.go +++ b/internal/service/emr/instance_fleet_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" diff --git a/internal/service/emr/instance_group_test.go b/internal/service/emr/instance_group_test.go index 2ee036c4d905..2355da06621d 100644 --- a/internal/service/emr/instance_group_test.go +++ b/internal/service/emr/instance_group_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" diff --git a/internal/service/emr/managed_scaling_policy_test.go b/internal/service/emr/managed_scaling_policy_test.go index 8865f8590f77..cd862cf40854 100644 --- a/internal/service/emr/managed_scaling_policy_test.go +++ b/internal/service/emr/managed_scaling_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" diff --git a/internal/service/emr/release_labels_data_source_test.go b/internal/service/emr/release_labels_data_source_test.go index 2f09b45eddab..ef3a5c44f344 100644 --- a/internal/service/emr/release_labels_data_source_test.go +++ b/internal/service/emr/release_labels_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/emr/security_configuration_test.go b/internal/service/emr/security_configuration_test.go index 20de0e8b6149..1e3c2e0e840a 100644 --- a/internal/service/emr/security_configuration_test.go +++ b/internal/service/emr/security_configuration_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emr" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/emr/studio_session_mapping_test.go b/internal/service/emr/studio_session_mapping_test.go index 235217afcfe3..999077d9a84d 100644 --- a/internal/service/emr/studio_session_mapping_test.go +++ b/internal/service/emr/studio_session_mapping_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" diff --git a/internal/service/emr/studio_test.go b/internal/service/emr/studio_test.go index 5f083bf0c1cb..46462cd13a6e 100644 --- a/internal/service/emr/studio_test.go +++ b/internal/service/emr/studio_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemr "github.com/hashicorp/terraform-provider-aws/internal/service/emr" diff --git a/internal/service/emr/sweep.go b/internal/service/emr/sweep.go index e09c47533c15..288ac29b81a8 100644 --- a/internal/service/emr/sweep.go +++ b/internal/service/emr/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/emrcontainers/sweep.go b/internal/service/emrcontainers/sweep.go index b5fec7ff7a9a..2b5169971533 100644 --- a/internal/service/emrcontainers/sweep.go +++ b/internal/service/emrcontainers/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emrcontainers" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/emrcontainers/virtual_cluster_data_source_test.go b/internal/service/emrcontainers/virtual_cluster_data_source_test.go index d6f22b5751d6..0f1a38bacb12 100644 --- a/internal/service/emrcontainers/virtual_cluster_data_source_test.go +++ b/internal/service/emrcontainers/virtual_cluster_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/emrcontainers/virtual_cluster_test.go b/internal/service/emrcontainers/virtual_cluster_test.go index 537c5d38fd4d..864f54a53b9f 100644 --- a/internal/service/emrcontainers/virtual_cluster_test.go +++ b/internal/service/emrcontainers/virtual_cluster_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emrcontainers" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemrcontainers "github.com/hashicorp/terraform-provider-aws/internal/service/emrcontainers" diff --git a/internal/service/emrserverless/application_test.go b/internal/service/emrserverless/application_test.go index ddcafcfdb908..50e47d6684be 100644 --- a/internal/service/emrserverless/application_test.go +++ b/internal/service/emrserverless/application_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/emrserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfemrserverless "github.com/hashicorp/terraform-provider-aws/internal/service/emrserverless" diff --git a/internal/service/emrserverless/sweep.go b/internal/service/emrserverless/sweep.go index 8af164f6b448..b08120660c96 100644 --- a/internal/service/emrserverless/sweep.go +++ b/internal/service/emrserverless/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emrserverless" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/events/api_destination_test.go b/internal/service/events/api_destination_test.go index 1e685f821720..98e3ff98cbfa 100644 --- a/internal/service/events/api_destination_test.go +++ b/internal/service/events/api_destination_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/archive_test.go b/internal/service/events/archive_test.go index 5c2f92bd428c..5f14de332216 100644 --- a/internal/service/events/archive_test.go +++ b/internal/service/events/archive_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/bus_data_source_test.go b/internal/service/events/bus_data_source_test.go index 31c7bfc6fad2..da16a9b36385 100644 --- a/internal/service/events/bus_data_source_test.go +++ b/internal/service/events/bus_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/events/bus_policy_test.go b/internal/service/events/bus_policy_test.go index 48d9da4ff488..7af81784b778 100644 --- a/internal/service/events/bus_policy_test.go +++ b/internal/service/events/bus_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/bus_test.go b/internal/service/events/bus_test.go index 88188d90b925..2d52f6ebf593 100644 --- a/internal/service/events/bus_test.go +++ b/internal/service/events/bus_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/connection_data_source_test.go b/internal/service/events/connection_data_source_test.go index d4be2f8027db..313ec9e5138f 100644 --- a/internal/service/events/connection_data_source_test.go +++ b/internal/service/events/connection_data_source_test.go @@ -3,8 +3,8 @@ package events_test import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/events/connection_test.go b/internal/service/events/connection_test.go index 90edca801556..418f0c21060d 100644 --- a/internal/service/events/connection_test.go +++ b/internal/service/events/connection_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/endpoint_test.go b/internal/service/events/endpoint_test.go index 70c9f33f1d25..5d42111b9103 100644 --- a/internal/service/events/endpoint_test.go +++ b/internal/service/events/endpoint_test.go @@ -6,10 +6,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/permission_test.go b/internal/service/events/permission_test.go index fd3acdeb17e4..85a4d39fdacc 100644 --- a/internal/service/events/permission_test.go +++ b/internal/service/events/permission_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/rule_test.go b/internal/service/events/rule_test.go index 23f347b8f72f..37d442a89a87 100644 --- a/internal/service/events/rule_test.go +++ b/internal/service/events/rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/source_data_source_test.go b/internal/service/events/source_data_source_test.go index cc2ffba70e0e..68236a117cd1 100644 --- a/internal/service/events/source_data_source_test.go +++ b/internal/service/events/source_data_source_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/eventbridge" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/events/sweep.go b/internal/service/events/sweep.go index f989cf2a5877..f2d15f5a16c7 100644 --- a/internal/service/events/sweep.go +++ b/internal/service/events/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index b53fb8340ac9..65a902a6247c 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/eventbridge" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfevents "github.com/hashicorp/terraform-provider-aws/internal/service/events" diff --git a/internal/service/events/validate_test.go b/internal/service/events/validate_test.go index 73d7f4b01df2..f82029dcc81e 100644 --- a/internal/service/events/validate_test.go +++ b/internal/service/events/validate_test.go @@ -3,7 +3,7 @@ package events import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidCustomEventBusSourceName(t *testing.T) { diff --git a/internal/service/evidently/feature_test.go b/internal/service/evidently/feature_test.go index 7b7c8571f3ad..c440229b9115 100644 --- a/internal/service/evidently/feature_test.go +++ b/internal/service/evidently/feature_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" diff --git a/internal/service/evidently/launch_test.go b/internal/service/evidently/launch_test.go index a18905ba3f05..598f5227ad6d 100644 --- a/internal/service/evidently/launch_test.go +++ b/internal/service/evidently/launch_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" diff --git a/internal/service/evidently/project_test.go b/internal/service/evidently/project_test.go index a0d1464f3223..247f604af4da 100644 --- a/internal/service/evidently/project_test.go +++ b/internal/service/evidently/project_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" diff --git a/internal/service/evidently/segment_test.go b/internal/service/evidently/segment_test.go index 46d9243ad348..876cc688cbe6 100644 --- a/internal/service/evidently/segment_test.go +++ b/internal/service/evidently/segment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchevidently "github.com/hashicorp/terraform-provider-aws/internal/service/evidently" diff --git a/internal/service/evidently/sweep.go b/internal/service/evidently/sweep.go index df572a6a896a..7e90f5e47100 100644 --- a/internal/service/evidently/sweep.go +++ b/internal/service/evidently/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/firehose/delivery_stream_data_source_test.go b/internal/service/firehose/delivery_stream_data_source_test.go index cd72e19f6f46..9e2fa78329a9 100644 --- a/internal/service/firehose/delivery_stream_data_source_test.go +++ b/internal/service/firehose/delivery_stream_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/firehose" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index c3c364e42c12..471cc03e41d4 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/firehose" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffirehose "github.com/hashicorp/terraform-provider-aws/internal/service/firehose" diff --git a/internal/service/firehose/sweep.go b/internal/service/firehose/sweep.go index a427cf6ce000..0141991a7f4d 100644 --- a/internal/service/firehose/sweep.go +++ b/internal/service/firehose/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/firehose" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/fis/experiment_template_test.go b/internal/service/fis/experiment_template_test.go index 256dc9770120..e7f72e410e03 100644 --- a/internal/service/fis/experiment_template_test.go +++ b/internal/service/fis/experiment_template_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/fis" "github.com/aws/aws-sdk-go-v2/service/fis/types" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffis "github.com/hashicorp/terraform-provider-aws/internal/service/fis" diff --git a/internal/service/fis/sweep.go b/internal/service/fis/sweep.go index f73155efba70..f6a447adc6e1 100644 --- a/internal/service/fis/sweep.go +++ b/internal/service/fis/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/fis" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/fms/admin_account_test.go b/internal/service/fms/admin_account_test.go index 436c82132873..120ed34a4a69 100644 --- a/internal/service/fms/admin_account_test.go +++ b/internal/service/fms/admin_account_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/fms" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 13234f41946b..32292f9da8be 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/fms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffms "github.com/hashicorp/terraform-provider-aws/internal/service/fms" diff --git a/internal/service/fsx/backup_test.go b/internal/service/fsx/backup_test.go index 6370cbc98470..0d49091cb45f 100644 --- a/internal/service/fsx/backup_test.go +++ b/internal/service/fsx/backup_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/data_repository_association_test.go b/internal/service/fsx/data_repository_association_test.go index 3fbe7bf09bf5..1c9c400a4ebd 100644 --- a/internal/service/fsx/data_repository_association_test.go +++ b/internal/service/fsx/data_repository_association_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/file_cache_test.go b/internal/service/fsx/file_cache_test.go index 47929c91d02f..64031beaad28 100644 --- a/internal/service/fsx/file_cache_test.go +++ b/internal/service/fsx/file_cache_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/fsx/lustre_file_system_test.go b/internal/service/fsx/lustre_file_system_test.go index 226a4068ea0f..a6099a30e0c0 100644 --- a/internal/service/fsx/lustre_file_system_test.go +++ b/internal/service/fsx/lustre_file_system_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/ontap_file_system_test.go b/internal/service/fsx/ontap_file_system_test.go index 87b59e11eb78..4a7e1c387438 100644 --- a/internal/service/fsx/ontap_file_system_test.go +++ b/internal/service/fsx/ontap_file_system_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/ontap_storage_virtual_machine_test.go b/internal/service/fsx/ontap_storage_virtual_machine_test.go index 9c930b2b007b..43364afa57c0 100644 --- a/internal/service/fsx/ontap_storage_virtual_machine_test.go +++ b/internal/service/fsx/ontap_storage_virtual_machine_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/ontap_volume_test.go b/internal/service/fsx/ontap_volume_test.go index a7e64dd68a64..78b8a6eda63d 100644 --- a/internal/service/fsx/ontap_volume_test.go +++ b/internal/service/fsx/ontap_volume_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/openzfs_file_system_test.go b/internal/service/fsx/openzfs_file_system_test.go index 2c9bb449ff2c..85a046cb467a 100644 --- a/internal/service/fsx/openzfs_file_system_test.go +++ b/internal/service/fsx/openzfs_file_system_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/openzfs_snapshot_data_source_test.go b/internal/service/fsx/openzfs_snapshot_data_source_test.go index 75c1123b3ca1..d4cdb668e247 100644 --- a/internal/service/fsx/openzfs_snapshot_data_source_test.go +++ b/internal/service/fsx/openzfs_snapshot_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/fsx/openzfs_snapshot_test.go b/internal/service/fsx/openzfs_snapshot_test.go index b73b0b50932b..27f5102da2ad 100644 --- a/internal/service/fsx/openzfs_snapshot_test.go +++ b/internal/service/fsx/openzfs_snapshot_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/openzfs_volume_test.go b/internal/service/fsx/openzfs_volume_test.go index f11cd45051ae..fe33f5f28452 100644 --- a/internal/service/fsx/openzfs_volume_test.go +++ b/internal/service/fsx/openzfs_volume_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/fsx/sweep.go b/internal/service/fsx/sweep.go index 8e3af9f6cde0..bc422b0131aa 100644 --- a/internal/service/fsx/sweep.go +++ b/internal/service/fsx/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/fsx/windows_file_system_data_source_test.go b/internal/service/fsx/windows_file_system_data_source_test.go index fb847646e5ce..cab7eccca8e7 100644 --- a/internal/service/fsx/windows_file_system_data_source_test.go +++ b/internal/service/fsx/windows_file_system_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/fsx/windows_file_system_test.go b/internal/service/fsx/windows_file_system_test.go index fa2d8817bc55..3b4c603ffb08 100644 --- a/internal/service/fsx/windows_file_system_test.go +++ b/internal/service/fsx/windows_file_system_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/gamelift/alias_test.go b/internal/service/gamelift/alias_test.go index 82ad70d2bfcf..374f2b4bd21a 100644 --- a/internal/service/gamelift/alias_test.go +++ b/internal/service/gamelift/alias_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/gamelift/build_test.go b/internal/service/gamelift/build_test.go index 9f984b32532d..a4380bff7e6e 100644 --- a/internal/service/gamelift/build_test.go +++ b/internal/service/gamelift/build_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" diff --git a/internal/service/gamelift/fleet_test.go b/internal/service/gamelift/fleet_test.go index c62281c1a13b..d8a2795ded62 100644 --- a/internal/service/gamelift/fleet_test.go +++ b/internal/service/gamelift/fleet_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" diff --git a/internal/service/gamelift/game_server_group_test.go b/internal/service/gamelift/game_server_group_test.go index 8af9c4ed409c..2e737a945fe1 100644 --- a/internal/service/gamelift/game_server_group_test.go +++ b/internal/service/gamelift/game_server_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/gamelift/game_session_queue_test.go b/internal/service/gamelift/game_session_queue_test.go index c5ac371864aa..d06885667c2e 100644 --- a/internal/service/gamelift/game_session_queue_test.go +++ b/internal/service/gamelift/game_session_queue_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" diff --git a/internal/service/gamelift/script_test.go b/internal/service/gamelift/script_test.go index 176e81edeb5a..7e92fcb07ebe 100644 --- a/internal/service/gamelift/script_test.go +++ b/internal/service/gamelift/script_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgamelift "github.com/hashicorp/terraform-provider-aws/internal/service/gamelift" diff --git a/internal/service/gamelift/sweep.go b/internal/service/gamelift/sweep.go index e03bfe5970e9..5a6a3b45fc9e 100644 --- a/internal/service/gamelift/sweep.go +++ b/internal/service/gamelift/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/glacier/sweep.go b/internal/service/glacier/sweep.go index fb67cff7575e..640d605ec0b3 100644 --- a/internal/service/glacier/sweep.go +++ b/internal/service/glacier/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glacier" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/glacier/vault_lock_test.go b/internal/service/glacier/vault_lock_test.go index c596f45f0d50..91122ed54209 100644 --- a/internal/service/glacier/vault_lock_test.go +++ b/internal/service/glacier/vault_lock_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glacier" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/glacier/vault_test.go b/internal/service/glacier/vault_test.go index 403e7c9b9dde..6b3e517f7d14 100644 --- a/internal/service/glacier/vault_test.go +++ b/internal/service/glacier/vault_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glacier" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglacier "github.com/hashicorp/terraform-provider-aws/internal/service/glacier" diff --git a/internal/service/globalaccelerator/accelerator_data_source_test.go b/internal/service/globalaccelerator/accelerator_data_source_test.go index 3829658d1f02..dbeae83d46bc 100644 --- a/internal/service/globalaccelerator/accelerator_data_source_test.go +++ b/internal/service/globalaccelerator/accelerator_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/globalaccelerator/accelerator_test.go b/internal/service/globalaccelerator/accelerator_test.go index 9d04005ae71c..23cfe23185b4 100644 --- a/internal/service/globalaccelerator/accelerator_test.go +++ b/internal/service/globalaccelerator/accelerator_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" diff --git a/internal/service/globalaccelerator/custom_routing_accelerator_data_source_test.go b/internal/service/globalaccelerator/custom_routing_accelerator_data_source_test.go index 14496af150ed..deaabe9cc41a 100644 --- a/internal/service/globalaccelerator/custom_routing_accelerator_data_source_test.go +++ b/internal/service/globalaccelerator/custom_routing_accelerator_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/globalaccelerator/custom_routing_accelerator_test.go b/internal/service/globalaccelerator/custom_routing_accelerator_test.go index ce7b494a7279..dbcfa6c68d43 100644 --- a/internal/service/globalaccelerator/custom_routing_accelerator_test.go +++ b/internal/service/globalaccelerator/custom_routing_accelerator_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" diff --git a/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go b/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go index ace72e0a3e63..d46ba9636ace 100644 --- a/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go +++ b/internal/service/globalaccelerator/custom_routing_endpoint_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" diff --git a/internal/service/globalaccelerator/custom_routing_listener_test.go b/internal/service/globalaccelerator/custom_routing_listener_test.go index 6efd6e2f1f0b..f6f03a67439e 100644 --- a/internal/service/globalaccelerator/custom_routing_listener_test.go +++ b/internal/service/globalaccelerator/custom_routing_listener_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" diff --git a/internal/service/globalaccelerator/endpoint_group_test.go b/internal/service/globalaccelerator/endpoint_group_test.go index 0d10bf79a665..0491eeeaff03 100644 --- a/internal/service/globalaccelerator/endpoint_group_test.go +++ b/internal/service/globalaccelerator/endpoint_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/globalaccelerator/listener_test.go b/internal/service/globalaccelerator/listener_test.go index 2de4aab2db07..bbf6b4a2e44d 100644 --- a/internal/service/globalaccelerator/listener_test.go +++ b/internal/service/globalaccelerator/listener_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/globalaccelerator" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglobalaccelerator "github.com/hashicorp/terraform-provider-aws/internal/service/globalaccelerator" diff --git a/internal/service/globalaccelerator/sweep.go b/internal/service/globalaccelerator/sweep.go index 1f3935c36237..26a0af44eb7d 100644 --- a/internal/service/globalaccelerator/sweep.go +++ b/internal/service/globalaccelerator/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/globalaccelerator" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/glue/catalog_database_test.go b/internal/service/glue/catalog_database_test.go index 42a84dfda080..85ac56058cd2 100644 --- a/internal/service/glue/catalog_database_test.go +++ b/internal/service/glue/catalog_database_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/catalog_table_data_source_test.go b/internal/service/glue/catalog_table_data_source_test.go index ca2c7fec3e32..681af5eaa946 100644 --- a/internal/service/glue/catalog_table_data_source_test.go +++ b/internal/service/glue/catalog_table_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/glue/catalog_table_test.go b/internal/service/glue/catalog_table_test.go index 98fa61158ad0..ca14ebda89bb 100644 --- a/internal/service/glue/catalog_table_test.go +++ b/internal/service/glue/catalog_table_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/classifier_test.go b/internal/service/glue/classifier_test.go index b06d32396599..07bd3fb61cec 100644 --- a/internal/service/glue/classifier_test.go +++ b/internal/service/glue/classifier_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/connection_data_source_test.go b/internal/service/glue/connection_data_source_test.go index d6bac7c0c3d2..6fd42a025864 100644 --- a/internal/service/glue/connection_data_source_test.go +++ b/internal/service/glue/connection_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/glue/connection_test.go b/internal/service/glue/connection_test.go index 95a7f6996471..dd6a5dd6cf33 100644 --- a/internal/service/glue/connection_test.go +++ b/internal/service/glue/connection_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index eb0897c87b71..0dec1ba0781f 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/data_catalog_encryption_settings_data_source_test.go b/internal/service/glue/data_catalog_encryption_settings_data_source_test.go index 23ef10265d15..0397f923f32f 100644 --- a/internal/service/glue/data_catalog_encryption_settings_data_source_test.go +++ b/internal/service/glue/data_catalog_encryption_settings_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/glue/data_catalog_encryption_settings_test.go b/internal/service/glue/data_catalog_encryption_settings_test.go index 9f4f37f81266..c5a9f082735f 100644 --- a/internal/service/glue/data_catalog_encryption_settings_test.go +++ b/internal/service/glue/data_catalog_encryption_settings_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/glue/dev_endpoint_test.go b/internal/service/glue/dev_endpoint_test.go index b094928f07d0..57b7ffbe2d99 100644 --- a/internal/service/glue/dev_endpoint_test.go +++ b/internal/service/glue/dev_endpoint_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/job_test.go b/internal/service/glue/job_test.go index 535be0a24b27..20b993531741 100644 --- a/internal/service/glue/job_test.go +++ b/internal/service/glue/job_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/ml_transform_test.go b/internal/service/glue/ml_transform_test.go index ce040e120791..249856c74dea 100644 --- a/internal/service/glue/ml_transform_test.go +++ b/internal/service/glue/ml_transform_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/partition_index_test.go b/internal/service/glue/partition_index_test.go index 482ea3bc1943..90a7a663e228 100644 --- a/internal/service/glue/partition_index_test.go +++ b/internal/service/glue/partition_index_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/partition_test.go b/internal/service/glue/partition_test.go index c02e3ba91f24..eeba0c91b235 100644 --- a/internal/service/glue/partition_test.go +++ b/internal/service/glue/partition_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/registry_test.go b/internal/service/glue/registry_test.go index 72a0b42452e2..9e3bfa9368ae 100644 --- a/internal/service/glue/registry_test.go +++ b/internal/service/glue/registry_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/resource_policy_test.go b/internal/service/glue/resource_policy_test.go index 6d9136f8ebd6..89bb8ea1eaa6 100644 --- a/internal/service/glue/resource_policy_test.go +++ b/internal/service/glue/resource_policy_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" awspolicy "github.com/hashicorp/awspolicyequivalence" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/schema_test.go b/internal/service/glue/schema_test.go index 3c55f08e4b43..120b7453ad13 100644 --- a/internal/service/glue/schema_test.go +++ b/internal/service/glue/schema_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/script_data_source_test.go b/internal/service/glue/script_data_source_test.go index 2a5eca15c794..369535c0eb37 100644 --- a/internal/service/glue/script_data_source_test.go +++ b/internal/service/glue/script_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/glue" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/glue/security_configuration_test.go b/internal/service/glue/security_configuration_test.go index 3029cef0fe2d..9ed6726c9e5c 100644 --- a/internal/service/glue/security_configuration_test.go +++ b/internal/service/glue/security_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/glue/sweep.go b/internal/service/glue/sweep.go index f3b5d93c8632..c84d5884cbed 100644 --- a/internal/service/glue/sweep.go +++ b/internal/service/glue/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/glue/trigger_test.go b/internal/service/glue/trigger_test.go index d8fdca1fa6a5..76f4c3d3e5cc 100644 --- a/internal/service/glue/trigger_test.go +++ b/internal/service/glue/trigger_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/user_defined_function_test.go b/internal/service/glue/user_defined_function_test.go index 7e34d0d5c4a5..d13977008629 100644 --- a/internal/service/glue/user_defined_function_test.go +++ b/internal/service/glue/user_defined_function_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/glue/workflow_test.go b/internal/service/glue/workflow_test.go index 662cadb9ff45..78baaf150375 100644 --- a/internal/service/glue/workflow_test.go +++ b/internal/service/glue/workflow_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfglue "github.com/hashicorp/terraform-provider-aws/internal/service/glue" diff --git a/internal/service/grafana/license_association_test.go b/internal/service/grafana/license_association_test.go index b641b7b1c7e2..94a809fea80b 100644 --- a/internal/service/grafana/license_association_test.go +++ b/internal/service/grafana/license_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" diff --git a/internal/service/grafana/role_association_test.go b/internal/service/grafana/role_association_test.go index 25c4a6afa3b7..b882137b1c60 100644 --- a/internal/service/grafana/role_association_test.go +++ b/internal/service/grafana/role_association_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" diff --git a/internal/service/grafana/sweep.go b/internal/service/grafana/sweep.go index 67cb06e8e04d..a05e88584d5e 100644 --- a/internal/service/grafana/sweep.go +++ b/internal/service/grafana/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/managedgrafana" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/grafana/workspace_api_key_test.go b/internal/service/grafana/workspace_api_key_test.go index c1210981cebb..a8eb76a4c504 100644 --- a/internal/service/grafana/workspace_api_key_test.go +++ b/internal/service/grafana/workspace_api_key_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/grafana/workspace_data_source_test.go b/internal/service/grafana/workspace_data_source_test.go index fe126f32d5f0..154778ee8fbc 100644 --- a/internal/service/grafana/workspace_data_source_test.go +++ b/internal/service/grafana/workspace_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/grafana/workspace_saml_configuration_test.go b/internal/service/grafana/workspace_saml_configuration_test.go index 2af51dfd4b26..d2797c9351d0 100644 --- a/internal/service/grafana/workspace_saml_configuration_test.go +++ b/internal/service/grafana/workspace_saml_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" diff --git a/internal/service/grafana/workspace_test.go b/internal/service/grafana/workspace_test.go index 4b4b5100f202..e1da326dc92d 100644 --- a/internal/service/grafana/workspace_test.go +++ b/internal/service/grafana/workspace_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/managedgrafana" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfgrafana "github.com/hashicorp/terraform-provider-aws/internal/service/grafana" diff --git a/internal/service/guardduty/detector_data_source_test.go b/internal/service/guardduty/detector_data_source_test.go index d209515f94ef..1d158ea2e54d 100644 --- a/internal/service/guardduty/detector_data_source_test.go +++ b/internal/service/guardduty/detector_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/guardduty" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/guardduty/detector_test.go b/internal/service/guardduty/detector_test.go index ae112613615a..a769a09d7b6e 100644 --- a/internal/service/guardduty/detector_test.go +++ b/internal/service/guardduty/detector_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/guardduty/filter_test.go b/internal/service/guardduty/filter_test.go index 9748c760e517..35c2e77ffbf4 100644 --- a/internal/service/guardduty/filter_test.go +++ b/internal/service/guardduty/filter_test.go @@ -10,8 +10,8 @@ import ( "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" diff --git a/internal/service/guardduty/invite_accepter_test.go b/internal/service/guardduty/invite_accepter_test.go index b6bbf10432f5..b76f07c569bc 100644 --- a/internal/service/guardduty/invite_accepter_test.go +++ b/internal/service/guardduty/invite_accepter_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/guardduty/ipset_test.go b/internal/service/guardduty/ipset_test.go index 701b80344aca..cbceb0e45173 100644 --- a/internal/service/guardduty/ipset_test.go +++ b/internal/service/guardduty/ipset_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" diff --git a/internal/service/guardduty/member_test.go b/internal/service/guardduty/member_test.go index d8a0170f3c59..8ceacee65c1f 100644 --- a/internal/service/guardduty/member_test.go +++ b/internal/service/guardduty/member_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" diff --git a/internal/service/guardduty/organization_admin_account_test.go b/internal/service/guardduty/organization_admin_account_test.go index 4f3142b7278d..34ca975120af 100644 --- a/internal/service/guardduty/organization_admin_account_test.go +++ b/internal/service/guardduty/organization_admin_account_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" diff --git a/internal/service/guardduty/organization_configuration_test.go b/internal/service/guardduty/organization_configuration_test.go index ba887d1f7b40..ad150269b144 100644 --- a/internal/service/guardduty/organization_configuration_test.go +++ b/internal/service/guardduty/organization_configuration_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/guardduty" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/guardduty/publishing_destination_test.go b/internal/service/guardduty/publishing_destination_test.go index eabd7e87da7a..ad1b506652a9 100644 --- a/internal/service/guardduty/publishing_destination_test.go +++ b/internal/service/guardduty/publishing_destination_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" diff --git a/internal/service/guardduty/sweep.go b/internal/service/guardduty/sweep.go index 0c2d9218fc04..778077bc1bf1 100644 --- a/internal/service/guardduty/sweep.go +++ b/internal/service/guardduty/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/guardduty/threatintelset_test.go b/internal/service/guardduty/threatintelset_test.go index dd8f55d68fa8..a89efcef68e3 100644 --- a/internal/service/guardduty/threatintelset_test.go +++ b/internal/service/guardduty/threatintelset_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" diff --git a/internal/service/iam/acc_test.go b/internal/service/iam/acc_test.go index a728f6739dc2..231a75f67955 100644 --- a/internal/service/iam/acc_test.go +++ b/internal/service/iam/acc_test.go @@ -14,7 +14,7 @@ import ( // RandSSHKeyPair generates a public and private SSH key pair. The public key is // returned in OpenSSH format, and the private key is PEM encoded. -// Copied from github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest, +// Copied from github.com/hashicorp/terraform-plugin-testing/helper/acctest, // with the addition of the key size. func RandSSHKeyPairSize(keySize int, comment string) (string, string, error) { privateKey, privateKeyPEM, err := genPrivateKey(keySize) diff --git a/internal/service/iam/access_key_test.go b/internal/service/iam/access_key_test.go index 118889f57899..214e405e4788 100644 --- a/internal/service/iam/access_key_test.go +++ b/internal/service/iam/access_key_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/access_keys_data_source_test.go b/internal/service/iam/access_keys_data_source_test.go index f79ada3802e0..e3f4a5b1d46a 100644 --- a/internal/service/iam/access_keys_data_source_test.go +++ b/internal/service/iam/access_keys_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/account_alias_data_source_test.go b/internal/service/iam/account_alias_data_source_test.go index abb171626b5c..cb9ef64ee6dc 100644 --- a/internal/service/iam/account_alias_data_source_test.go +++ b/internal/service/iam/account_alias_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/account_alias_test.go b/internal/service/iam/account_alias_test.go index 2777354a34ee..d4efcea5a8f5 100644 --- a/internal/service/iam/account_alias_test.go +++ b/internal/service/iam/account_alias_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/account_password_policy_test.go b/internal/service/iam/account_password_policy_test.go index 76cd8a4673e8..00f5788dab26 100644 --- a/internal/service/iam/account_password_policy_test.go +++ b/internal/service/iam/account_password_policy_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/group_data_source_test.go b/internal/service/iam/group_data_source_test.go index a1929c18ee17..2e51da446a6d 100644 --- a/internal/service/iam/group_data_source_test.go +++ b/internal/service/iam/group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/group_membership_test.go b/internal/service/iam/group_membership_test.go index 6d6985379ba9..714957cb48f5 100644 --- a/internal/service/iam/group_membership_test.go +++ b/internal/service/iam/group_membership_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/group_policy_attachment_test.go b/internal/service/iam/group_policy_attachment_test.go index ad60a6fd2b4f..807f10e0cfcc 100644 --- a/internal/service/iam/group_policy_attachment_test.go +++ b/internal/service/iam/group_policy_attachment_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/arn" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/group_policy_test.go b/internal/service/iam/group_policy_test.go index 06ce5f73c66d..0d37ceec59ac 100644 --- a/internal/service/iam/group_policy_test.go +++ b/internal/service/iam/group_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/group_test.go b/internal/service/iam/group_test.go index cc5c0acd6146..6fdf40efde04 100644 --- a/internal/service/iam/group_test.go +++ b/internal/service/iam/group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/instance_profile_data_source_test.go b/internal/service/iam/instance_profile_data_source_test.go index bd36c4bd2a39..417520f5fbd5 100644 --- a/internal/service/iam/instance_profile_data_source_test.go +++ b/internal/service/iam/instance_profile_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/instance_profile_test.go b/internal/service/iam/instance_profile_test.go index 9b72735efb4f..1f9316cd75c5 100644 --- a/internal/service/iam/instance_profile_test.go +++ b/internal/service/iam/instance_profile_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/instance_profiles_data_source_test.go b/internal/service/iam/instance_profiles_data_source_test.go index 6752ccdcdc5e..46f23f01cd72 100644 --- a/internal/service/iam/instance_profiles_data_source_test.go +++ b/internal/service/iam/instance_profiles_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/openid_connect_provider_data_source_test.go b/internal/service/iam/openid_connect_provider_data_source_test.go index a5af5eace5a4..c73a4a65dce4 100644 --- a/internal/service/iam/openid_connect_provider_data_source_test.go +++ b/internal/service/iam/openid_connect_provider_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/openid_connect_provider_test.go b/internal/service/iam/openid_connect_provider_test.go index 5db29eda833c..95364c89924a 100644 --- a/internal/service/iam/openid_connect_provider_test.go +++ b/internal/service/iam/openid_connect_provider_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/policy_attachment_test.go b/internal/service/iam/policy_attachment_test.go index 4d9d02d8b3f4..882318067b12 100644 --- a/internal/service/iam/policy_attachment_test.go +++ b/internal/service/iam/policy_attachment_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/policy_data_source_test.go b/internal/service/iam/policy_data_source_test.go index c62bc76cb71b..2a53c1932c8c 100644 --- a/internal/service/iam/policy_data_source_test.go +++ b/internal/service/iam/policy_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" ) diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index 4bc1ae3c0de7..c39136cd0b4f 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/iam" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/policy_test.go b/internal/service/iam/policy_test.go index 69ae314a8dae..7b1c40fb501b 100644 --- a/internal/service/iam/policy_test.go +++ b/internal/service/iam/policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/role_data_source_test.go b/internal/service/iam/role_data_source_test.go index f97188557ecd..9e26a86e50c8 100644 --- a/internal/service/iam/role_data_source_test.go +++ b/internal/service/iam/role_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/role_policy_attachment_test.go b/internal/service/iam/role_policy_attachment_test.go index 482681eb9b00..701b62f770a7 100644 --- a/internal/service/iam/role_policy_attachment_test.go +++ b/internal/service/iam/role_policy_attachment_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/role_policy_test.go b/internal/service/iam/role_policy_test.go index 1420d8f3d8d7..e2606ac00ebb 100644 --- a/internal/service/iam/role_policy_test.go +++ b/internal/service/iam/role_policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/role_test.go b/internal/service/iam/role_test.go index cf8d0f465faa..a26c9e135155 100644 --- a/internal/service/iam/role_test.go +++ b/internal/service/iam/role_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/roles_data_source_test.go b/internal/service/iam/roles_data_source_test.go index a3c0e8309e3d..ad0e2a52c6ed 100644 --- a/internal/service/iam/roles_data_source_test.go +++ b/internal/service/iam/roles_data_source_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/saml_provider_data_source_test.go b/internal/service/iam/saml_provider_data_source_test.go index 59ec9e6c7602..49c638ad064c 100644 --- a/internal/service/iam/saml_provider_data_source_test.go +++ b/internal/service/iam/saml_provider_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/saml_provider_test.go b/internal/service/iam/saml_provider_test.go index 7e4f3cc48c63..c16c861611f7 100644 --- a/internal/service/iam/saml_provider_test.go +++ b/internal/service/iam/saml_provider_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/server_certificate_data_source_test.go b/internal/service/iam/server_certificate_data_source_test.go index 2037c1036456..1285e4ae3422 100644 --- a/internal/service/iam/server_certificate_data_source_test.go +++ b/internal/service/iam/server_certificate_data_source_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" ) diff --git a/internal/service/iam/server_certificate_test.go b/internal/service/iam/server_certificate_test.go index 9f8d152d71b2..a4f79d81c501 100644 --- a/internal/service/iam/server_certificate_test.go +++ b/internal/service/iam/server_certificate_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/service_linked_role_test.go b/internal/service/iam/service_linked_role_test.go index ce5b42f37554..5ad44d36ec71 100644 --- a/internal/service/iam/service_linked_role_test.go +++ b/internal/service/iam/service_linked_role_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/service_specific_credential_test.go b/internal/service/iam/service_specific_credential_test.go index 59d1923cdb56..67f4cf1a84b4 100644 --- a/internal/service/iam/service_specific_credential_test.go +++ b/internal/service/iam/service_specific_credential_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/session_context_data_source_test.go b/internal/service/iam/session_context_data_source_test.go index 5f003817acdb..710a92faa202 100644 --- a/internal/service/iam/session_context_data_source_test.go +++ b/internal/service/iam/session_context_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" ) diff --git a/internal/service/iam/signing_certificate_test.go b/internal/service/iam/signing_certificate_test.go index 9c67cf1a4495..a24cd38279b7 100644 --- a/internal/service/iam/signing_certificate_test.go +++ b/internal/service/iam/signing_certificate_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/sweep.go b/internal/service/iam/sweep.go index 96187e844d3e..48b96c9d3d15 100644 --- a/internal/service/iam/sweep.go +++ b/internal/service/iam/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/iam/user_data_source_test.go b/internal/service/iam/user_data_source_test.go index f8c996db4d5f..9fa7500c0bd9 100644 --- a/internal/service/iam/user_data_source_test.go +++ b/internal/service/iam/user_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/user_group_membership_test.go b/internal/service/iam/user_group_membership_test.go index 678f1de54fdd..78dc39c5fab2 100644 --- a/internal/service/iam/user_group_membership_test.go +++ b/internal/service/iam/user_group_membership_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/user_login_profile_test.go b/internal/service/iam/user_login_profile_test.go index 2a3a345df2d7..8d424405f970 100644 --- a/internal/service/iam/user_login_profile_test.go +++ b/internal/service/iam/user_login_profile_test.go @@ -13,10 +13,10 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/user_policy_attachment_test.go b/internal/service/iam/user_policy_attachment_test.go index 59245e61fff6..35c4ceefb89c 100644 --- a/internal/service/iam/user_policy_attachment_test.go +++ b/internal/service/iam/user_policy_attachment_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iam/user_policy_test.go b/internal/service/iam/user_policy_test.go index ade211c90660..5787cc37f9f3 100644 --- a/internal/service/iam/user_policy_test.go +++ b/internal/service/iam/user_policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/user_ssh_key_data_source_test.go b/internal/service/iam/user_ssh_key_data_source_test.go index ece0b06a0ed3..bfac60fcc822 100644 --- a/internal/service/iam/user_ssh_key_data_source_test.go +++ b/internal/service/iam/user_ssh_key_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/user_ssh_key_test.go b/internal/service/iam/user_ssh_key_test.go index 561f504a6f9f..2de98d3731b1 100644 --- a/internal/service/iam/user_ssh_key_test.go +++ b/internal/service/iam/user_ssh_key_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/user_test.go b/internal/service/iam/user_test.go index feb745b27237..ffa927d72813 100644 --- a/internal/service/iam/user_test.go +++ b/internal/service/iam/user_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/iam/users_data_source_test.go b/internal/service/iam/users_data_source_test.go index d6a19e1216a8..85dbe7b12fa6 100644 --- a/internal/service/iam/users_data_source_test.go +++ b/internal/service/iam/users_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iam/virtual_mfa_device_test.go b/internal/service/iam/virtual_mfa_device_test.go index 8cba7d540430..f2c31813c8a2 100644 --- a/internal/service/iam/virtual_mfa_device_test.go +++ b/internal/service/iam/virtual_mfa_device_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/identitystore/group_data_source_test.go b/internal/service/identitystore/group_data_source_test.go index b55ab3e5c900..47d86d840422 100644 --- a/internal/service/identitystore/group_data_source_test.go +++ b/internal/service/identitystore/group_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/service/identitystore" "github.com/aws/aws-sdk-go/service/ssoadmin" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/identitystore/group_membership_test.go b/internal/service/identitystore/group_membership_test.go index 2a4945494c40..6fd93c6e8e67 100644 --- a/internal/service/identitystore/group_membership_test.go +++ b/internal/service/identitystore/group_membership_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/identitystore" "github.com/aws/aws-sdk-go-v2/service/identitystore/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/identitystore/group_test.go b/internal/service/identitystore/group_test.go index c6af216c969d..b3b16b016cac 100644 --- a/internal/service/identitystore/group_test.go +++ b/internal/service/identitystore/group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/identitystore" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/identitystore/user_data_source_test.go b/internal/service/identitystore/user_data_source_test.go index 817a047b25a0..0697c0412ec8 100644 --- a/internal/service/identitystore/user_data_source_test.go +++ b/internal/service/identitystore/user_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/identitystore" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/identitystore/user_test.go b/internal/service/identitystore/user_test.go index 00044a72aff1..10094d2b6e4b 100644 --- a/internal/service/identitystore/user_test.go +++ b/internal/service/identitystore/user_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/identitystore" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/imagebuilder/component_data_source_test.go b/internal/service/imagebuilder/component_data_source_test.go index afa4798b8b66..41bb456d100c 100644 --- a/internal/service/imagebuilder/component_data_source_test.go +++ b/internal/service/imagebuilder/component_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/component_test.go b/internal/service/imagebuilder/component_test.go index f4f31e1b722e..cdfe7f5dafdb 100644 --- a/internal/service/imagebuilder/component_test.go +++ b/internal/service/imagebuilder/component_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/components_data_source_test.go b/internal/service/imagebuilder/components_data_source_test.go index 530465fd013c..88fb013e37b3 100644 --- a/internal/service/imagebuilder/components_data_source_test.go +++ b/internal/service/imagebuilder/components_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/container_recipe_data_source_test.go b/internal/service/imagebuilder/container_recipe_data_source_test.go index 9d001eb04c29..5c4398016d5b 100644 --- a/internal/service/imagebuilder/container_recipe_data_source_test.go +++ b/internal/service/imagebuilder/container_recipe_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/container_recipe_test.go b/internal/service/imagebuilder/container_recipe_test.go index a07d96d6e569..8947616d7c70 100644 --- a/internal/service/imagebuilder/container_recipe_test.go +++ b/internal/service/imagebuilder/container_recipe_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/container_recipes_data_source_test.go b/internal/service/imagebuilder/container_recipes_data_source_test.go index 7ec756de3578..bee526a3e7d8 100644 --- a/internal/service/imagebuilder/container_recipes_data_source_test.go +++ b/internal/service/imagebuilder/container_recipes_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/distribution_configuration_data_source_test.go b/internal/service/imagebuilder/distribution_configuration_data_source_test.go index ccbc3d4d8f9b..c021d831d479 100644 --- a/internal/service/imagebuilder/distribution_configuration_data_source_test.go +++ b/internal/service/imagebuilder/distribution_configuration_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/distribution_configuration_test.go b/internal/service/imagebuilder/distribution_configuration_test.go index 2f015997a3e6..0e4d8c6417b7 100644 --- a/internal/service/imagebuilder/distribution_configuration_test.go +++ b/internal/service/imagebuilder/distribution_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/distribution_configurations_data_source_test.go b/internal/service/imagebuilder/distribution_configurations_data_source_test.go index 04175df0fd19..d9656261cd0e 100644 --- a/internal/service/imagebuilder/distribution_configurations_data_source_test.go +++ b/internal/service/imagebuilder/distribution_configurations_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_data_source_test.go b/internal/service/imagebuilder/image_data_source_test.go index 13c7697550e6..9ec894e444fe 100644 --- a/internal/service/imagebuilder/image_data_source_test.go +++ b/internal/service/imagebuilder/image_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_pipeline_data_source_test.go b/internal/service/imagebuilder/image_pipeline_data_source_test.go index 1b66b6d053f9..203d4cbfe5c1 100644 --- a/internal/service/imagebuilder/image_pipeline_data_source_test.go +++ b/internal/service/imagebuilder/image_pipeline_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_pipeline_test.go b/internal/service/imagebuilder/image_pipeline_test.go index 536511c48cc0..d7a78cfbdbb6 100644 --- a/internal/service/imagebuilder/image_pipeline_test.go +++ b/internal/service/imagebuilder/image_pipeline_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/image_pipelines_data_source_test.go b/internal/service/imagebuilder/image_pipelines_data_source_test.go index 10f311c4a298..1f59dc6b5426 100644 --- a/internal/service/imagebuilder/image_pipelines_data_source_test.go +++ b/internal/service/imagebuilder/image_pipelines_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_recipe_data_source_test.go b/internal/service/imagebuilder/image_recipe_data_source_test.go index b1b68f99dea5..5c855807a254 100644 --- a/internal/service/imagebuilder/image_recipe_data_source_test.go +++ b/internal/service/imagebuilder/image_recipe_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_recipe_test.go b/internal/service/imagebuilder/image_recipe_test.go index b5acd9ddad2e..4382a67e8391 100644 --- a/internal/service/imagebuilder/image_recipe_test.go +++ b/internal/service/imagebuilder/image_recipe_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/image_recipes_data_source_test.go b/internal/service/imagebuilder/image_recipes_data_source_test.go index 59b3b148a150..514977dd2500 100644 --- a/internal/service/imagebuilder/image_recipes_data_source_test.go +++ b/internal/service/imagebuilder/image_recipes_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/image_test.go b/internal/service/imagebuilder/image_test.go index 2b702943f40d..800443c4ecf3 100644 --- a/internal/service/imagebuilder/image_test.go +++ b/internal/service/imagebuilder/image_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go b/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go index 07cbd6ce4787..0d325f7f4adb 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/infrastructure_configuration_test.go b/internal/service/imagebuilder/infrastructure_configuration_test.go index 75bb57b6d5d9..02b909a7d67c 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfimagebuilder "github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder" diff --git a/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go b/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go index f9a8307b8499..a5eb0c6fee9e 100644 --- a/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go +++ b/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/imagebuilder" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/imagebuilder/sweep.go b/internal/service/imagebuilder/sweep.go index 8bc2ee6b4e87..caaab89ad7a8 100644 --- a/internal/service/imagebuilder/sweep.go +++ b/internal/service/imagebuilder/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/inspector/assessment_target_test.go b/internal/service/inspector/assessment_target_test.go index 125504121455..92a946f1da6a 100644 --- a/internal/service/inspector/assessment_target_test.go +++ b/internal/service/inspector/assessment_target_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/inspector" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfinspector "github.com/hashicorp/terraform-provider-aws/internal/service/inspector" diff --git a/internal/service/inspector/assessment_template_test.go b/internal/service/inspector/assessment_template_test.go index dbbdb909bac0..fae39c2f4af9 100644 --- a/internal/service/inspector/assessment_template_test.go +++ b/internal/service/inspector/assessment_template_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/inspector" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/inspector/resource_group_test.go b/internal/service/inspector/resource_group_test.go index 58e77f30868e..9c9e33dfb46b 100644 --- a/internal/service/inspector/resource_group_test.go +++ b/internal/service/inspector/resource_group_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/inspector" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/inspector/rules_packages_data_source_test.go b/internal/service/inspector/rules_packages_data_source_test.go index 5b3e4a7d11c0..a5cf95e9f7d5 100644 --- a/internal/service/inspector/rules_packages_data_source_test.go +++ b/internal/service/inspector/rules_packages_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/inspector" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/inspector2/delegated_admin_account_test.go b/internal/service/inspector2/delegated_admin_account_test.go index 01f2ec57f803..3d4e5a02103b 100644 --- a/internal/service/inspector2/delegated_admin_account_test.go +++ b/internal/service/inspector2/delegated_admin_account_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/inspector2/types" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/inspector2/enabler_test.go b/internal/service/inspector2/enabler_test.go index 6c5546b722e4..8392ca452c9e 100644 --- a/internal/service/inspector2/enabler_test.go +++ b/internal/service/inspector2/enabler_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/inspector2/types" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/inspector2/member_association_test.go b/internal/service/inspector2/member_association_test.go index 4c3b40e3332d..3f26245fbfca 100644 --- a/internal/service/inspector2/member_association_test.go +++ b/internal/service/inspector2/member_association_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/inspector2/types" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfinspector2 "github.com/hashicorp/terraform-provider-aws/internal/service/inspector2" diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index 275e139f83dc..1beb6e4d967f 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/inspector2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/internetmonitor/monitor_test.go b/internal/service/internetmonitor/monitor_test.go index 0b812fb9d557..06ebcdc5a9d1 100644 --- a/internal/service/internetmonitor/monitor_test.go +++ b/internal/service/internetmonitor/monitor_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/internetmonitor" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfinternetmonitor "github.com/hashicorp/terraform-provider-aws/internal/service/internetmonitor" diff --git a/internal/service/internetmonitor/sweep.go b/internal/service/internetmonitor/sweep.go index 81b8fb71fce5..c1f3afae88aa 100644 --- a/internal/service/internetmonitor/sweep.go +++ b/internal/service/internetmonitor/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/internetmonitor" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/iot/authorizer_test.go b/internal/service/iot/authorizer_test.go index 0b5818551d4d..aa95e824c548 100644 --- a/internal/service/iot/authorizer_test.go +++ b/internal/service/iot/authorizer_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/certificate_test.go b/internal/service/iot/certificate_test.go index 189fddcfcb55..22f916f42cdb 100644 --- a/internal/service/iot/certificate_test.go +++ b/internal/service/iot/certificate_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/iot/endpoint_data_source_test.go b/internal/service/iot/endpoint_data_source_test.go index 477d6126615a..e2872269bde5 100644 --- a/internal/service/iot/endpoint_data_source_test.go +++ b/internal/service/iot/endpoint_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iot/indexing_configuration_test.go b/internal/service/iot/indexing_configuration_test.go index 123572e4bf75..3c24d79e8232 100644 --- a/internal/service/iot/indexing_configuration_test.go +++ b/internal/service/iot/indexing_configuration_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iot/logging_options_test.go b/internal/service/iot/logging_options_test.go index aa24768cffd2..fd87b2f5ee65 100644 --- a/internal/service/iot/logging_options_test.go +++ b/internal/service/iot/logging_options_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/iot/policy_attachment_test.go b/internal/service/iot/policy_attachment_test.go index da7db859e6b0..cdb57fa41089 100644 --- a/internal/service/iot/policy_attachment_test.go +++ b/internal/service/iot/policy_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/policy_test.go b/internal/service/iot/policy_test.go index 6677d5a59095..8b4d89ddb6b1 100644 --- a/internal/service/iot/policy_test.go +++ b/internal/service/iot/policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/provisioning_template_test.go b/internal/service/iot/provisioning_template_test.go index 6a80da9c04f0..1c1d206e2015 100644 --- a/internal/service/iot/provisioning_template_test.go +++ b/internal/service/iot/provisioning_template_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/role_alias_test.go b/internal/service/iot/role_alias_test.go index d1b85f5a0a0f..f05034063ce6 100644 --- a/internal/service/iot/role_alias_test.go +++ b/internal/service/iot/role_alias_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/sweep.go b/internal/service/iot/sweep.go index 93b21df5c5f8..c51e5253cd91 100644 --- a/internal/service/iot/sweep.go +++ b/internal/service/iot/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/iot/thing_group_membership_test.go b/internal/service/iot/thing_group_membership_test.go index 62feaa242e04..9f489e805ba2 100644 --- a/internal/service/iot/thing_group_membership_test.go +++ b/internal/service/iot/thing_group_membership_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/thing_group_test.go b/internal/service/iot/thing_group_test.go index f2438da328a4..093210d4f6fd 100644 --- a/internal/service/iot/thing_group_test.go +++ b/internal/service/iot/thing_group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/thing_principal_attachment_test.go b/internal/service/iot/thing_principal_attachment_test.go index 1d21e7754654..b14bdb9ebf3f 100644 --- a/internal/service/iot/thing_principal_attachment_test.go +++ b/internal/service/iot/thing_principal_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/thing_test.go b/internal/service/iot/thing_test.go index 113e731020c1..1db6eacfe3b1 100644 --- a/internal/service/iot/thing_test.go +++ b/internal/service/iot/thing_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/thing_type_test.go b/internal/service/iot/thing_type_test.go index 16fe0100f6c3..c9ee587adc21 100644 --- a/internal/service/iot/thing_type_test.go +++ b/internal/service/iot/thing_type_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/iot/topic_rule_destination_test.go b/internal/service/iot/topic_rule_destination_test.go index 05f5164ece1f..1de13d5706ae 100644 --- a/internal/service/iot/topic_rule_destination_test.go +++ b/internal/service/iot/topic_rule_destination_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/iot/topic_rule_test.go b/internal/service/iot/topic_rule_test.go index f9c16a4722b0..c0e5b3182aea 100644 --- a/internal/service/iot/topic_rule_test.go +++ b/internal/service/iot/topic_rule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfiot "github.com/hashicorp/terraform-provider-aws/internal/service/iot" diff --git a/internal/service/ivs/channel_test.go b/internal/service/ivs/channel_test.go index 1b87306e31fe..462b82f87f4f 100644 --- a/internal/service/ivs/channel_test.go +++ b/internal/service/ivs/channel_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ivs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ivs/playback_key_pair_test.go b/internal/service/ivs/playback_key_pair_test.go index 13482c1e41c5..12ab8773960f 100644 --- a/internal/service/ivs/playback_key_pair_test.go +++ b/internal/service/ivs/playback_key_pair_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ivs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ivs/recording_configuration_test.go b/internal/service/ivs/recording_configuration_test.go index 776862931d16..b6c2ff9311b2 100644 --- a/internal/service/ivs/recording_configuration_test.go +++ b/internal/service/ivs/recording_configuration_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ivs" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ivs/stream_key_data_source_test.go b/internal/service/ivs/stream_key_data_source_test.go index b0096c3b623f..6b1b1aa16b79 100644 --- a/internal/service/ivs/stream_key_data_source_test.go +++ b/internal/service/ivs/stream_key_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ivs" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ivschat/logging_configuration_test.go b/internal/service/ivschat/logging_configuration_test.go index 4f02578432a0..e0ecac2c539b 100644 --- a/internal/service/ivschat/logging_configuration_test.go +++ b/internal/service/ivschat/logging_configuration_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ivschat" "github.com/aws/aws-sdk-go-v2/service/ivschat/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ivschat/room_test.go b/internal/service/ivschat/room_test.go index 5a59b470fc51..02eee85a664f 100644 --- a/internal/service/ivschat/room_test.go +++ b/internal/service/ivschat/room_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ivschat" "github.com/aws/aws-sdk-go-v2/service/ivschat/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/kafka/broker_nodes_data_source_test.go b/internal/service/kafka/broker_nodes_data_source_test.go index a789841be385..72b0461d7e36 100644 --- a/internal/service/kafka/broker_nodes_data_source_test.go +++ b/internal/service/kafka/broker_nodes_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafka" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafka/cluster_data_source_test.go b/internal/service/kafka/cluster_data_source_test.go index 951f89d08100..360d38987a93 100644 --- a/internal/service/kafka/cluster_data_source_test.go +++ b/internal/service/kafka/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafka" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index 58d1b5bddf12..86ad6047d01a 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/kafka" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" diff --git a/internal/service/kafka/configuration_data_source_test.go b/internal/service/kafka/configuration_data_source_test.go index 0e3be334d355..3c26d69114f5 100644 --- a/internal/service/kafka/configuration_data_source_test.go +++ b/internal/service/kafka/configuration_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafka" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafka/configuration_test.go b/internal/service/kafka/configuration_test.go index d28fe3a117c5..0c5e374ef585 100644 --- a/internal/service/kafka/configuration_test.go +++ b/internal/service/kafka/configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kafka" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" diff --git a/internal/service/kafka/kafka_version_data_source_test.go b/internal/service/kafka/kafka_version_data_source_test.go index 94d870d069ac..a8f314d5d420 100644 --- a/internal/service/kafka/kafka_version_data_source_test.go +++ b/internal/service/kafka/kafka_version_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafka" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/kafka/scram_secret_association_test.go b/internal/service/kafka/scram_secret_association_test.go index ede182508c8d..8a27986e7e60 100644 --- a/internal/service/kafka/scram_secret_association_test.go +++ b/internal/service/kafka/scram_secret_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kafka" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" diff --git a/internal/service/kafka/serverless_cluster_test.go b/internal/service/kafka/serverless_cluster_test.go index e5b357f3549d..23aaba7dc97e 100644 --- a/internal/service/kafka/serverless_cluster_test.go +++ b/internal/service/kafka/serverless_cluster_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafka" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafka "github.com/hashicorp/terraform-provider-aws/internal/service/kafka" diff --git a/internal/service/kafka/sweep.go b/internal/service/kafka/sweep.go index a47f2ae7b1ce..f18ae2d9397b 100644 --- a/internal/service/kafka/sweep.go +++ b/internal/service/kafka/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kafka" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kafkaconnect/connector_data_source_test.go b/internal/service/kafkaconnect/connector_data_source_test.go index 62b73c56dbab..27b71c45d620 100644 --- a/internal/service/kafkaconnect/connector_data_source_test.go +++ b/internal/service/kafkaconnect/connector_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafkaconnect/connector_test.go b/internal/service/kafkaconnect/connector_test.go index fedc165a3595..9501b57ffbfa 100644 --- a/internal/service/kafkaconnect/connector_test.go +++ b/internal/service/kafkaconnect/connector_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" diff --git a/internal/service/kafkaconnect/custom_plugin_data_source_test.go b/internal/service/kafkaconnect/custom_plugin_data_source_test.go index d471269b1faa..04bf587ef074 100644 --- a/internal/service/kafkaconnect/custom_plugin_data_source_test.go +++ b/internal/service/kafkaconnect/custom_plugin_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafkaconnect/custom_plugin_test.go b/internal/service/kafkaconnect/custom_plugin_test.go index 214d14dec4d7..e3907100cfc2 100644 --- a/internal/service/kafkaconnect/custom_plugin_test.go +++ b/internal/service/kafkaconnect/custom_plugin_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" diff --git a/internal/service/kafkaconnect/sweep.go b/internal/service/kafkaconnect/sweep.go index 480e992eacd0..e94d50251193 100644 --- a/internal/service/kafkaconnect/sweep.go +++ b/internal/service/kafkaconnect/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kafkaconnect" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kafkaconnect/worker_configuration_data_source_test.go b/internal/service/kafkaconnect/worker_configuration_data_source_test.go index c8e4802d1caf..d40dc97c4593 100644 --- a/internal/service/kafkaconnect/worker_configuration_data_source_test.go +++ b/internal/service/kafkaconnect/worker_configuration_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kafkaconnect/worker_configuration_test.go b/internal/service/kafkaconnect/worker_configuration_test.go index 309c3cc354f0..933f49014d30 100644 --- a/internal/service/kafkaconnect/worker_configuration_test.go +++ b/internal/service/kafkaconnect/worker_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kafkaconnect" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkafkaconnect "github.com/hashicorp/terraform-provider-aws/internal/service/kafkaconnect" diff --git a/internal/service/kendra/data_source_test.go b/internal/service/kendra/data_source_test.go index 1beb69e9b393..105929fc50e3 100644 --- a/internal/service/kendra/data_source_test.go +++ b/internal/service/kendra/data_source_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/kendra/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/kendra/experience_data_source_test.go b/internal/service/kendra/experience_data_source_test.go index 6116f07ef1ec..dca2779fe885 100644 --- a/internal/service/kendra/experience_data_source_test.go +++ b/internal/service/kendra/experience_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kendra/experience_test.go b/internal/service/kendra/experience_test.go index c35ab37ba08a..964072eca296 100644 --- a/internal/service/kendra/experience_test.go +++ b/internal/service/kendra/experience_test.go @@ -7,9 +7,9 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/kendra/faq_data_source_test.go b/internal/service/kendra/faq_data_source_test.go index 9af8adf828cf..5767378ff90a 100644 --- a/internal/service/kendra/faq_data_source_test.go +++ b/internal/service/kendra/faq_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kendra/faq_test.go b/internal/service/kendra/faq_test.go index cc192adb4ee4..608dab6b34f4 100644 --- a/internal/service/kendra/faq_test.go +++ b/internal/service/kendra/faq_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/kendra/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/kendra/index_data_source_test.go b/internal/service/kendra/index_data_source_test.go index 50cccbeb67cc..f7ee576024ad 100644 --- a/internal/service/kendra/index_data_source_test.go +++ b/internal/service/kendra/index_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kendra/index_test.go b/internal/service/kendra/index_test.go index 7e40d425dd00..3c14c3b2378a 100644 --- a/internal/service/kendra/index_test.go +++ b/internal/service/kendra/index_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kendra" "github.com/aws/aws-sdk-go-v2/service/kendra/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/kendra/query_suggestions_block_list_data_source_test.go b/internal/service/kendra/query_suggestions_block_list_data_source_test.go index 74fc316872a0..d1e920e24681 100644 --- a/internal/service/kendra/query_suggestions_block_list_data_source_test.go +++ b/internal/service/kendra/query_suggestions_block_list_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kendra/query_suggestions_block_list_test.go b/internal/service/kendra/query_suggestions_block_list_test.go index 3696c67bdcd7..a28d68b25992 100644 --- a/internal/service/kendra/query_suggestions_block_list_test.go +++ b/internal/service/kendra/query_suggestions_block_list_test.go @@ -6,9 +6,9 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/kendra/sweep.go b/internal/service/kendra/sweep.go index 304e2f9e58ef..b92720f72826 100644 --- a/internal/service/kendra/sweep.go +++ b/internal/service/kendra/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/kendra" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kendra/thesaurus_data_source_test.go b/internal/service/kendra/thesaurus_data_source_test.go index b17afde71bef..6e22abd2386e 100644 --- a/internal/service/kendra/thesaurus_data_source_test.go +++ b/internal/service/kendra/thesaurus_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/backup" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kendra/thesaurus_test.go b/internal/service/kendra/thesaurus_test.go index 1870dbd692b9..f20cf1a45e0c 100644 --- a/internal/service/kendra/thesaurus_test.go +++ b/internal/service/kendra/thesaurus_test.go @@ -6,9 +6,9 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkendra "github.com/hashicorp/terraform-provider-aws/internal/service/kendra" diff --git a/internal/service/keyspaces/keyspace_test.go b/internal/service/keyspaces/keyspace_test.go index 934294f242c2..f2367d40f840 100644 --- a/internal/service/keyspaces/keyspace_test.go +++ b/internal/service/keyspaces/keyspace_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/keyspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkeyspaces "github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces" diff --git a/internal/service/keyspaces/sweep.go b/internal/service/keyspaces/sweep.go index 0297b4254d8a..10e9cf3b8d0c 100644 --- a/internal/service/keyspaces/sweep.go +++ b/internal/service/keyspaces/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/keyspaces" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/keyspaces/table_test.go b/internal/service/keyspaces/table_test.go index bf555d41fcd5..06acbc2ba94a 100644 --- a/internal/service/keyspaces/table_test.go +++ b/internal/service/keyspaces/table_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/keyspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkeyspaces "github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces" diff --git a/internal/service/kinesis/stream_consumer_data_source_test.go b/internal/service/kinesis/stream_consumer_data_source_test.go index 5fa3b9a49440..9f3f3e58b03c 100644 --- a/internal/service/kinesis/stream_consumer_data_source_test.go +++ b/internal/service/kinesis/stream_consumer_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesis" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kinesis/stream_consumer_test.go b/internal/service/kinesis/stream_consumer_test.go index 84891bd8a5dc..adfb7d2cac4c 100644 --- a/internal/service/kinesis/stream_consumer_test.go +++ b/internal/service/kinesis/stream_consumer_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesis" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesis "github.com/hashicorp/terraform-provider-aws/internal/service/kinesis" diff --git a/internal/service/kinesis/stream_data_source_test.go b/internal/service/kinesis/stream_data_source_test.go index 7cea8e8285b6..a9a48c86a7f2 100644 --- a/internal/service/kinesis/stream_data_source_test.go +++ b/internal/service/kinesis/stream_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesis" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kinesis/stream_test.go b/internal/service/kinesis/stream_test.go index 778b518076a6..d3b32b501060 100644 --- a/internal/service/kinesis/stream_test.go +++ b/internal/service/kinesis/stream_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesis" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesis "github.com/hashicorp/terraform-provider-aws/internal/service/kinesis" diff --git a/internal/service/kinesis/sweep.go b/internal/service/kinesis/sweep.go index 8957c6b11683..42617bc4e41e 100644 --- a/internal/service/kinesis/sweep.go +++ b/internal/service/kinesis/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kinesisanalytics/application_test.go b/internal/service/kinesisanalytics/application_test.go index 7a905de1102a..596764333f1f 100644 --- a/internal/service/kinesisanalytics/application_test.go +++ b/internal/service/kinesisanalytics/application_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesisanalytics" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesisanalytics "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalytics" diff --git a/internal/service/kinesisanalytics/sweep.go b/internal/service/kinesisanalytics/sweep.go index eff1ced13dc0..25462c77f267 100644 --- a/internal/service/kinesisanalytics/sweep.go +++ b/internal/service/kinesisanalytics/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/kinesisanalytics" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kinesisanalyticsv2/application_snapshot_test.go b/internal/service/kinesisanalyticsv2/application_snapshot_test.go index 3d2215370a70..d6cf880f1e62 100644 --- a/internal/service/kinesisanalyticsv2/application_snapshot_test.go +++ b/internal/service/kinesisanalyticsv2/application_snapshot_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesisanalyticsv2 "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalyticsv2" diff --git a/internal/service/kinesisanalyticsv2/application_test.go b/internal/service/kinesisanalyticsv2/application_test.go index 6d967cc6ca8d..16ea1bcd38b1 100644 --- a/internal/service/kinesisanalyticsv2/application_test.go +++ b/internal/service/kinesisanalyticsv2/application_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesisanalyticsv2 "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisanalyticsv2" diff --git a/internal/service/kinesisanalyticsv2/sweep.go b/internal/service/kinesisanalyticsv2/sweep.go index 49414426349f..ef05cd829054 100644 --- a/internal/service/kinesisanalyticsv2/sweep.go +++ b/internal/service/kinesisanalyticsv2/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/kinesisvideo/stream_test.go b/internal/service/kinesisvideo/stream_test.go index cb680e5073c1..9c4d1f013710 100644 --- a/internal/service/kinesisvideo/stream_test.go +++ b/internal/service/kinesisvideo/stream_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesisvideo" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkinesisvideo "github.com/hashicorp/terraform-provider-aws/internal/service/kinesisvideo" diff --git a/internal/service/kms/alias_data_source_test.go b/internal/service/kms/alias_data_source_test.go index 53a7cd262015..baaf62aa7ca0 100644 --- a/internal/service/kms/alias_data_source_test.go +++ b/internal/service/kms/alias_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/alias_test.go b/internal/service/kms/alias_test.go index 07e0d26cbf21..d87bfe5066fe 100644 --- a/internal/service/kms/alias_test.go +++ b/internal/service/kms/alias_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" diff --git a/internal/service/kms/ciphertext_data_source_test.go b/internal/service/kms/ciphertext_data_source_test.go index 642c8944cd92..0fb83f542eaf 100644 --- a/internal/service/kms/ciphertext_data_source_test.go +++ b/internal/service/kms/ciphertext_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/ciphertext_test.go b/internal/service/kms/ciphertext_test.go index ab72899770ad..3cc8b2dfd37c 100644 --- a/internal/service/kms/ciphertext_test.go +++ b/internal/service/kms/ciphertext_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/custom_key_store_data_source_test.go b/internal/service/kms/custom_key_store_data_source_test.go index 99d2b793ecc7..e6edd975ebd5 100644 --- a/internal/service/kms/custom_key_store_data_source_test.go +++ b/internal/service/kms/custom_key_store_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/custom_key_store_test.go b/internal/service/kms/custom_key_store_test.go index 2f1884668837..a67d2187f4ea 100644 --- a/internal/service/kms/custom_key_store_test.go +++ b/internal/service/kms/custom_key_store_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/kms/external_key_test.go b/internal/service/kms/external_key_test.go index 5eb3f5a9f2b4..829fc6b3cbff 100644 --- a/internal/service/kms/external_key_test.go +++ b/internal/service/kms/external_key_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" diff --git a/internal/service/kms/grant_test.go b/internal/service/kms/grant_test.go index df26be7fabbf..65672793baf7 100644 --- a/internal/service/kms/grant_test.go +++ b/internal/service/kms/grant_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" diff --git a/internal/service/kms/key_data_source_test.go b/internal/service/kms/key_data_source_test.go index c0a70d2a469a..020667f4ec73 100644 --- a/internal/service/kms/key_data_source_test.go +++ b/internal/service/kms/key_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/key_policy_test.go b/internal/service/kms/key_policy_test.go index 42450f294334..53d8d3f61f6e 100644 --- a/internal/service/kms/key_policy_test.go +++ b/internal/service/kms/key_policy_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" ) diff --git a/internal/service/kms/key_test.go b/internal/service/kms/key_test.go index 8887a43422db..4f10b79ddfb1 100644 --- a/internal/service/kms/key_test.go +++ b/internal/service/kms/key_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" diff --git a/internal/service/kms/public_key_data_source_test.go b/internal/service/kms/public_key_data_source_test.go index 695244183782..4921c5ac8cef 100644 --- a/internal/service/kms/public_key_data_source_test.go +++ b/internal/service/kms/public_key_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/replica_external_key_test.go b/internal/service/kms/replica_external_key_test.go index 6cca542715ec..cc2676081ad7 100644 --- a/internal/service/kms/replica_external_key_test.go +++ b/internal/service/kms/replica_external_key_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/kms/replica_key_test.go b/internal/service/kms/replica_key_test.go index 7ce129c7d982..05810e5f6fc1 100644 --- a/internal/service/kms/replica_key_test.go +++ b/internal/service/kms/replica_key_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" ) diff --git a/internal/service/kms/secret_data_source_test.go b/internal/service/kms/secret_data_source_test.go index 044a460c0cc0..4aea546e1d23 100644 --- a/internal/service/kms/secret_data_source_test.go +++ b/internal/service/kms/secret_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfkms "github.com/hashicorp/terraform-provider-aws/internal/service/kms" ) diff --git a/internal/service/kms/secrets_data_source_test.go b/internal/service/kms/secrets_data_source_test.go index e30c1d618d6f..159d0c05d1d0 100644 --- a/internal/service/kms/secrets_data_source_test.go +++ b/internal/service/kms/secrets_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/kms/sweep.go b/internal/service/kms/sweep.go index e77393ba6c07..3d3f204c3922 100644 --- a/internal/service/kms/sweep.go +++ b/internal/service/kms/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/lakeformation/data_lake_settings_data_source_test.go b/internal/service/lakeformation/data_lake_settings_data_source_test.go index 6d674fe933ab..acd4fdde13ed 100644 --- a/internal/service/lakeformation/data_lake_settings_data_source_test.go +++ b/internal/service/lakeformation/data_lake_settings_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lakeformation" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lakeformation/data_lake_settings_test.go b/internal/service/lakeformation/data_lake_settings_test.go index e93d9dbd20fc..7202ecec78ee 100644 --- a/internal/service/lakeformation/data_lake_settings_test.go +++ b/internal/service/lakeformation/data_lake_settings_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lakeformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tflakeformation "github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation" diff --git a/internal/service/lakeformation/lf_tag_test.go b/internal/service/lakeformation/lf_tag_test.go index 26ab857f7f2f..495926a9a1aa 100644 --- a/internal/service/lakeformation/lf_tag_test.go +++ b/internal/service/lakeformation/lf_tag_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lakeformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflakeformation "github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation" diff --git a/internal/service/lakeformation/permissions_data_source_test.go b/internal/service/lakeformation/permissions_data_source_test.go index 2de2af3a6dd7..98e5db872814 100644 --- a/internal/service/lakeformation/permissions_data_source_test.go +++ b/internal/service/lakeformation/permissions_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lakeformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lakeformation/permissions_test.go b/internal/service/lakeformation/permissions_test.go index 5efea2ced0bb..b848e3f3b0cc 100644 --- a/internal/service/lakeformation/permissions_test.go +++ b/internal/service/lakeformation/permissions_test.go @@ -10,11 +10,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lakeformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/flex" diff --git a/internal/service/lakeformation/resource_data_source_test.go b/internal/service/lakeformation/resource_data_source_test.go index 1049941e4acc..dc9f233721f3 100644 --- a/internal/service/lakeformation/resource_data_source_test.go +++ b/internal/service/lakeformation/resource_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lakeformation" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lakeformation/resource_lf_tags_test.go b/internal/service/lakeformation/resource_lf_tags_test.go index 7b11d23268c7..20608a545bdd 100644 --- a/internal/service/lakeformation/resource_lf_tags_test.go +++ b/internal/service/lakeformation/resource_lf_tags_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go/service/lakeformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/lakeformation/resource_test.go b/internal/service/lakeformation/resource_test.go index 5df61fba4793..9486c675115a 100644 --- a/internal/service/lakeformation/resource_test.go +++ b/internal/service/lakeformation/resource_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lakeformation" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflakeformation "github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation" diff --git a/internal/service/lambda/alias_data_source_test.go b/internal/service/lambda/alias_data_source_test.go index b259f88aa279..cb7985402d85 100644 --- a/internal/service/lambda/alias_data_source_test.go +++ b/internal/service/lambda/alias_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/alias_test.go b/internal/service/lambda/alias_test.go index 7d72b92a2858..f836f12ac8de 100644 --- a/internal/service/lambda/alias_test.go +++ b/internal/service/lambda/alias_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/lambda/code_signing_config_data_source_test.go b/internal/service/lambda/code_signing_config_data_source_test.go index 1591104eb8e4..f15c47d11b81 100644 --- a/internal/service/lambda/code_signing_config_data_source_test.go +++ b/internal/service/lambda/code_signing_config_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/code_signing_config_test.go b/internal/service/lambda/code_signing_config_test.go index 9ea2f54a28cb..917abd281d91 100644 --- a/internal/service/lambda/code_signing_config_test.go +++ b/internal/service/lambda/code_signing_config_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/lambda/event_source_mapping_test.go b/internal/service/lambda/event_source_mapping_test.go index 3fcb65d68b33..f0c32bcff7db 100644 --- a/internal/service/lambda/event_source_mapping_test.go +++ b/internal/service/lambda/event_source_mapping_test.go @@ -13,10 +13,10 @@ import ( "github.com/aws/aws-sdk-go/service/mq" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/function_data_source_test.go b/internal/service/lambda/function_data_source_test.go index 01f59d886205..354042fa4622 100644 --- a/internal/service/lambda/function_data_source_test.go +++ b/internal/service/lambda/function_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/function_event_invoke_config_test.go b/internal/service/lambda/function_event_invoke_config_test.go index 8f64488713c7..cf2b4031e611 100644 --- a/internal/service/lambda/function_event_invoke_config_test.go +++ b/internal/service/lambda/function_event_invoke_config_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" "github.com/aws/aws-sdk-go-v2/service/lambda/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 2a773a623420..22bfbac0be8f 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -15,9 +15,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/lambda/types" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/function_url_data_source_test.go b/internal/service/lambda/function_url_data_source_test.go index cadbe4a0302f..033cce3b085c 100644 --- a/internal/service/lambda/function_url_data_source_test.go +++ b/internal/service/lambda/function_url_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/function_url_test.go b/internal/service/lambda/function_url_test.go index a7a2f1d13510..7b08bddc68ea 100644 --- a/internal/service/lambda/function_url_test.go +++ b/internal/service/lambda/function_url_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/functions_data_source_test.go b/internal/service/lambda/functions_data_source_test.go index 85162c0a8423..3798d99f8025 100644 --- a/internal/service/lambda/functions_data_source_test.go +++ b/internal/service/lambda/functions_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/invocation_data_source_test.go b/internal/service/lambda/invocation_data_source_test.go index da4b56ecb391..783500bab7c6 100644 --- a/internal/service/lambda/invocation_data_source_test.go +++ b/internal/service/lambda/invocation_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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/verify" ) diff --git a/internal/service/lambda/invocation_test.go b/internal/service/lambda/invocation_test.go index 683b3d9e2dba..5f63d5c5fecd 100644 --- a/internal/service/lambda/invocation_test.go +++ b/internal/service/lambda/invocation_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/layer_version_data_source_test.go b/internal/service/lambda/layer_version_data_source_test.go index 11082c78b463..c8730c2a5bdb 100644 --- a/internal/service/lambda/layer_version_data_source_test.go +++ b/internal/service/lambda/layer_version_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lambda/layer_version_permission_test.go b/internal/service/lambda/layer_version_permission_test.go index 9d618356aa0d..c7d4f1242d61 100644 --- a/internal/service/lambda/layer_version_permission_test.go +++ b/internal/service/lambda/layer_version_permission_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/layer_version_test.go b/internal/service/lambda/layer_version_test.go index 4565ac0e0fbc..644d04ba264a 100644 --- a/internal/service/lambda/layer_version_test.go +++ b/internal/service/lambda/layer_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/permission_test.go b/internal/service/lambda/permission_test.go index ac9da011716f..ae1246131d35 100644 --- a/internal/service/lambda/permission_test.go +++ b/internal/service/lambda/permission_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lambda" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/provisioned_concurrency_config_test.go b/internal/service/lambda/provisioned_concurrency_config_test.go index 518a888774ef..75986eac8503 100644 --- a/internal/service/lambda/provisioned_concurrency_config_test.go +++ b/internal/service/lambda/provisioned_concurrency_config_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" "github.com/aws/aws-sdk-go-v2/service/lambda/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflambda "github.com/hashicorp/terraform-provider-aws/internal/service/lambda" diff --git a/internal/service/lambda/sweep.go b/internal/service/lambda/sweep.go index 5ee64dfad1ea..ed584f69e14b 100644 --- a/internal/service/lambda/sweep.go +++ b/internal/service/lambda/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/lexmodels/bot_alias_data_source_test.go b/internal/service/lexmodels/bot_alias_data_source_test.go index 5b402013b7d7..08a9e18ab0da 100644 --- a/internal/service/lexmodels/bot_alias_data_source_test.go +++ b/internal/service/lexmodels/bot_alias_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lexmodels/bot_alias_test.go b/internal/service/lexmodels/bot_alias_test.go index ba0274f81411..0e26a01afa28 100644 --- a/internal/service/lexmodels/bot_alias_test.go +++ b/internal/service/lexmodels/bot_alias_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" diff --git a/internal/service/lexmodels/bot_data_source_test.go b/internal/service/lexmodels/bot_data_source_test.go index c879319bc345..90e5161f45a4 100644 --- a/internal/service/lexmodels/bot_data_source_test.go +++ b/internal/service/lexmodels/bot_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lexmodels/bot_test.go b/internal/service/lexmodels/bot_test.go index 603166251615..43ab75b06aa8 100644 --- a/internal/service/lexmodels/bot_test.go +++ b/internal/service/lexmodels/bot_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" diff --git a/internal/service/lexmodels/intent_data_source_test.go b/internal/service/lexmodels/intent_data_source_test.go index 76949213695c..085e779811f8 100644 --- a/internal/service/lexmodels/intent_data_source_test.go +++ b/internal/service/lexmodels/intent_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lexmodels/intent_test.go b/internal/service/lexmodels/intent_test.go index 849213042c15..4b87505ec3e8 100644 --- a/internal/service/lexmodels/intent_test.go +++ b/internal/service/lexmodels/intent_test.go @@ -9,11 +9,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" diff --git a/internal/service/lexmodels/slot_type_data_source_test.go b/internal/service/lexmodels/slot_type_data_source_test.go index 88b9846e13c1..ee3ca7bb3e3e 100644 --- a/internal/service/lexmodels/slot_type_data_source_test.go +++ b/internal/service/lexmodels/slot_type_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lexmodels/slot_type_test.go b/internal/service/lexmodels/slot_type_test.go index 67f64aeaa6ee..ec66b94c3405 100644 --- a/internal/service/lexmodels/slot_type_test.go +++ b/internal/service/lexmodels/slot_type_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflexmodels "github.com/hashicorp/terraform-provider-aws/internal/service/lexmodels" diff --git a/internal/service/lexmodels/sweep.go b/internal/service/lexmodels/sweep.go index d837f62dd4d2..ab0732b67a2c 100644 --- a/internal/service/lexmodels/sweep.go +++ b/internal/service/lexmodels/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/licensemanager/association_test.go b/internal/service/licensemanager/association_test.go index 3be9e907f09c..38beead952ac 100644 --- a/internal/service/licensemanager/association_test.go +++ b/internal/service/licensemanager/association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/licensemanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index 0a9c9e000945..5d1537cadd79 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -7,10 +7,10 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/licensemanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 25d8396e942e..29a90d43a827 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/licensemanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/licensemanager/license_configuration_test.go b/internal/service/licensemanager/license_configuration_test.go index c970567ccee3..cd32e3a82190 100644 --- a/internal/service/licensemanager/license_configuration_test.go +++ b/internal/service/licensemanager/license_configuration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/licensemanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index b8b372a185be..43db37a98602 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) diff --git a/internal/service/licensemanager/received_license_data_source_test.go b/internal/service/licensemanager/received_license_data_source_test.go index 40ca0596f235..8de3a2faa967 100644 --- a/internal/service/licensemanager/received_license_data_source_test.go +++ b/internal/service/licensemanager/received_license_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 220a5af08951..2b52c2c709cb 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) diff --git a/internal/service/licensemanager/sweep.go b/internal/service/licensemanager/sweep.go index 8f99b0ca3eaf..c134cc5e8f60 100644 --- a/internal/service/licensemanager/sweep.go +++ b/internal/service/licensemanager/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/licensemanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/lightsail/bucket_access_key_test.go b/internal/service/lightsail/bucket_access_key_test.go index 2e06ec4465ee..2792d33c9468 100644 --- a/internal/service/lightsail/bucket_access_key_test.go +++ b/internal/service/lightsail/bucket_access_key_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/bucket_resource_access_test.go b/internal/service/lightsail/bucket_resource_access_test.go index 52cbb3217b19..5553077cb06e 100644 --- a/internal/service/lightsail/bucket_resource_access_test.go +++ b/internal/service/lightsail/bucket_resource_access_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/bucket_test.go b/internal/service/lightsail/bucket_test.go index dd4ce312dc3f..e270380ca20c 100644 --- a/internal/service/lightsail/bucket_test.go +++ b/internal/service/lightsail/bucket_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/certificate_test.go b/internal/service/lightsail/certificate_test.go index e025d312451a..38a46ec1417b 100644 --- a/internal/service/lightsail/certificate_test.go +++ b/internal/service/lightsail/certificate_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/container_service_deployment_version_test.go b/internal/service/lightsail/container_service_deployment_version_test.go index 019c56a68076..2566e24eaabe 100644 --- a/internal/service/lightsail/container_service_deployment_version_test.go +++ b/internal/service/lightsail/container_service_deployment_version_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" diff --git a/internal/service/lightsail/container_service_test.go b/internal/service/lightsail/container_service_test.go index 868871d13a08..af697cda5983 100644 --- a/internal/service/lightsail/container_service_test.go +++ b/internal/service/lightsail/container_service_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" diff --git a/internal/service/lightsail/database_test.go b/internal/service/lightsail/database_test.go index f50e59909e06..95ba94906b84 100644 --- a/internal/service/lightsail/database_test.go +++ b/internal/service/lightsail/database_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/disk_attachment_test.go b/internal/service/lightsail/disk_attachment_test.go index cf7ac13b611f..295771330a78 100644 --- a/internal/service/lightsail/disk_attachment_test.go +++ b/internal/service/lightsail/disk_attachment_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/disk_test.go b/internal/service/lightsail/disk_test.go index a5ee49946975..6541abac9b3c 100644 --- a/internal/service/lightsail/disk_test.go +++ b/internal/service/lightsail/disk_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/distribution_test.go b/internal/service/lightsail/distribution_test.go index 349c083033f7..f8a56de28a7c 100644 --- a/internal/service/lightsail/distribution_test.go +++ b/internal/service/lightsail/distribution_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/domain_entry_test.go b/internal/service/lightsail/domain_entry_test.go index c420d7901dc0..123d87c1166d 100644 --- a/internal/service/lightsail/domain_entry_test.go +++ b/internal/service/lightsail/domain_entry_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/domain_test.go b/internal/service/lightsail/domain_test.go index db3f8e835c71..d5fc7f14f1b8 100644 --- a/internal/service/lightsail/domain_test.go +++ b/internal/service/lightsail/domain_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" diff --git a/internal/service/lightsail/instance_public_ports_test.go b/internal/service/lightsail/instance_public_ports_test.go index 8d7164465bb1..337f13837f54 100644 --- a/internal/service/lightsail/instance_public_ports_test.go +++ b/internal/service/lightsail/instance_public_ports_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" diff --git a/internal/service/lightsail/instance_test.go b/internal/service/lightsail/instance_test.go index ec8c5ffb64d5..1297ac4cb754 100644 --- a/internal/service/lightsail/instance_test.go +++ b/internal/service/lightsail/instance_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/key_pair_test.go b/internal/service/lightsail/key_pair_test.go index b4c5a1538202..216e57f51773 100644 --- a/internal/service/lightsail/key_pair_test.go +++ b/internal/service/lightsail/key_pair_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/lightsail/lb_attachment_test.go b/internal/service/lightsail/lb_attachment_test.go index 204c9714ef40..7daa1845f8a3 100644 --- a/internal/service/lightsail/lb_attachment_test.go +++ b/internal/service/lightsail/lb_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/lb_certificate_attachment_test.go b/internal/service/lightsail/lb_certificate_attachment_test.go index 7dabff36cfae..88e69a7e3742 100644 --- a/internal/service/lightsail/lb_certificate_attachment_test.go +++ b/internal/service/lightsail/lb_certificate_attachment_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lightsail/lb_certificate_test.go b/internal/service/lightsail/lb_certificate_test.go index 5b618749226e..093a2771fa57 100644 --- a/internal/service/lightsail/lb_certificate_test.go +++ b/internal/service/lightsail/lb_certificate_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/lb_https_redirection_policy_test.go b/internal/service/lightsail/lb_https_redirection_policy_test.go index ed781d4b6462..d4078bec5786 100644 --- a/internal/service/lightsail/lb_https_redirection_policy_test.go +++ b/internal/service/lightsail/lb_https_redirection_policy_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/lightsail/lb_stickiness_policy_test.go b/internal/service/lightsail/lb_stickiness_policy_test.go index 5daa850a467b..61fc215a111d 100644 --- a/internal/service/lightsail/lb_stickiness_policy_test.go +++ b/internal/service/lightsail/lb_stickiness_policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflightsail "github.com/hashicorp/terraform-provider-aws/internal/service/lightsail" diff --git a/internal/service/lightsail/lb_test.go b/internal/service/lightsail/lb_test.go index 0b08a2578129..6aa299484ebe 100644 --- a/internal/service/lightsail/lb_test.go +++ b/internal/service/lightsail/lb_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/lightsail/static_ip_attachment_test.go b/internal/service/lightsail/static_ip_attachment_test.go index 475e61fdbdf4..98ed0418ffab 100644 --- a/internal/service/lightsail/static_ip_attachment_test.go +++ b/internal/service/lightsail/static_ip_attachment_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/lightsail/static_ip_test.go b/internal/service/lightsail/static_ip_test.go index 8a7eea091d19..2b41c04473a8 100644 --- a/internal/service/lightsail/static_ip_test.go +++ b/internal/service/lightsail/static_ip_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/lightsail/sweep.go b/internal/service/lightsail/sweep.go index 291769e40f96..c59671f39d06 100644 --- a/internal/service/lightsail/sweep.go +++ b/internal/service/lightsail/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/location/geofence_collection_data_source_test.go b/internal/service/location/geofence_collection_data_source_test.go index 3fc7a701b3bb..4c1607c59b23 100644 --- a/internal/service/location/geofence_collection_data_source_test.go +++ b/internal/service/location/geofence_collection_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/geofence_collection_test.go b/internal/service/location/geofence_collection_test.go index 13344716d972..7f505ae7b40e 100644 --- a/internal/service/location/geofence_collection_test.go +++ b/internal/service/location/geofence_collection_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/location/map_data_source_test.go b/internal/service/location/map_data_source_test.go index e717f8402182..b4e4f263bc38 100644 --- a/internal/service/location/map_data_source_test.go +++ b/internal/service/location/map_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/map_test.go b/internal/service/location/map_test.go index 8d3755bb4355..002fa05749ce 100644 --- a/internal/service/location/map_test.go +++ b/internal/service/location/map_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflocation "github.com/hashicorp/terraform-provider-aws/internal/service/location" diff --git a/internal/service/location/place_index_data_source_test.go b/internal/service/location/place_index_data_source_test.go index 8090e4a7c50b..2fb371440b01 100644 --- a/internal/service/location/place_index_data_source_test.go +++ b/internal/service/location/place_index_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/place_index_test.go b/internal/service/location/place_index_test.go index 80578a170504..88bbabb0692b 100644 --- a/internal/service/location/place_index_test.go +++ b/internal/service/location/place_index_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflocation "github.com/hashicorp/terraform-provider-aws/internal/service/location" diff --git a/internal/service/location/route_calculator_data_source_test.go b/internal/service/location/route_calculator_data_source_test.go index 76b8dec5e9b3..cb25a219a4df 100644 --- a/internal/service/location/route_calculator_data_source_test.go +++ b/internal/service/location/route_calculator_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/route_calculator_test.go b/internal/service/location/route_calculator_test.go index 0e823e06a306..77883223415f 100644 --- a/internal/service/location/route_calculator_test.go +++ b/internal/service/location/route_calculator_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflocation "github.com/hashicorp/terraform-provider-aws/internal/service/location" diff --git a/internal/service/location/sweep.go b/internal/service/location/sweep.go index 5d92bdaeef9d..f302b380f63a 100644 --- a/internal/service/location/sweep.go +++ b/internal/service/location/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/location/tracker_association_data_source_test.go b/internal/service/location/tracker_association_data_source_test.go index 1a579e69dd5d..47f0770a188a 100644 --- a/internal/service/location/tracker_association_data_source_test.go +++ b/internal/service/location/tracker_association_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/tracker_association_test.go b/internal/service/location/tracker_association_test.go index 18eec5a8c5de..4d156fd5d077 100644 --- a/internal/service/location/tracker_association_test.go +++ b/internal/service/location/tracker_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/location/tracker_associations_data_source_test.go b/internal/service/location/tracker_associations_data_source_test.go index 9aeaf3a514fa..969ba8e16bff 100644 --- a/internal/service/location/tracker_associations_data_source_test.go +++ b/internal/service/location/tracker_associations_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/tracker_data_source_test.go b/internal/service/location/tracker_data_source_test.go index 89fa6697d358..6bfe19bdfa78 100644 --- a/internal/service/location/tracker_data_source_test.go +++ b/internal/service/location/tracker_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/locationservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/location/tracker_test.go b/internal/service/location/tracker_test.go index 74b29be1e6f4..02589f53f67b 100644 --- a/internal/service/location/tracker_test.go +++ b/internal/service/location/tracker_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflocation "github.com/hashicorp/terraform-provider-aws/internal/service/location" diff --git a/internal/service/logs/data_protection_policy_document_data_source_test.go b/internal/service/logs/data_protection_policy_document_data_source_test.go index 68555cbb10c5..50f8d2b6ec95 100644 --- a/internal/service/logs/data_protection_policy_document_data_source_test.go +++ b/internal/service/logs/data_protection_policy_document_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/logs/data_protection_policy_test.go b/internal/service/logs/data_protection_policy_test.go index 7a8781177342..7e30ef68a42b 100644 --- a/internal/service/logs/data_protection_policy_test.go +++ b/internal/service/logs/data_protection_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/destination_policy_test.go b/internal/service/logs/destination_policy_test.go index 69090296124b..8803e526a9e7 100644 --- a/internal/service/logs/destination_policy_test.go +++ b/internal/service/logs/destination_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/destination_test.go b/internal/service/logs/destination_test.go index 2fce327517fb..2d110c3e6004 100644 --- a/internal/service/logs/destination_test.go +++ b/internal/service/logs/destination_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/group_data_source_test.go b/internal/service/logs/group_data_source_test.go index 7189d32eb70b..9f0d5ec346fb 100644 --- a/internal/service/logs/group_data_source_test.go +++ b/internal/service/logs/group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/logs/group_test.go b/internal/service/logs/group_test.go index 0226aec28ad2..649772c0ae8f 100644 --- a/internal/service/logs/group_test.go +++ b/internal/service/logs/group_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/logs/groups_data_source_test.go b/internal/service/logs/groups_data_source_test.go index e29ff81c4023..1b6ea9484cef 100644 --- a/internal/service/logs/groups_data_source_test.go +++ b/internal/service/logs/groups_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/logs/metric_filter_test.go b/internal/service/logs/metric_filter_test.go index b1087c6715c9..72fcfad4b098 100644 --- a/internal/service/logs/metric_filter_test.go +++ b/internal/service/logs/metric_filter_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/query_definition_test.go b/internal/service/logs/query_definition_test.go index 4bed340f9fe9..2a6f9fba1126 100644 --- a/internal/service/logs/query_definition_test.go +++ b/internal/service/logs/query_definition_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/resource_policy_test.go b/internal/service/logs/resource_policy_test.go index e60d0b57308a..ecf6f35863dd 100644 --- a/internal/service/logs/resource_policy_test.go +++ b/internal/service/logs/resource_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/stream_test.go b/internal/service/logs/stream_test.go index 5b23a5cae77e..27d79bfb93b1 100644 --- a/internal/service/logs/stream_test.go +++ b/internal/service/logs/stream_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/subscription_filter_test.go b/internal/service/logs/subscription_filter_test.go index 4edceadd5515..1fc6c9cf37e5 100644 --- a/internal/service/logs/subscription_filter_test.go +++ b/internal/service/logs/subscription_filter_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tflogs "github.com/hashicorp/terraform-provider-aws/internal/service/logs" diff --git a/internal/service/logs/sweep.go b/internal/service/logs/sweep.go index 4a78ab5ba3a8..305b3bb427f5 100644 --- a/internal/service/logs/sweep.go +++ b/internal/service/logs/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/logs/validate_test.go b/internal/service/logs/validate_test.go index 6f2649917b43..273baa1b5438 100644 --- a/internal/service/logs/validate_test.go +++ b/internal/service/logs/validate_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidLogGroupName(t *testing.T) { diff --git a/internal/service/macie2/account_test.go b/internal/service/macie2/account_test.go index 7b219664a1c9..e6791757f4c6 100644 --- a/internal/service/macie2/account_test.go +++ b/internal/service/macie2/account_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" diff --git a/internal/service/macie2/classification_export_configuration_test.go b/internal/service/macie2/classification_export_configuration_test.go index 5eada8384a8e..974bcdaf404f 100644 --- a/internal/service/macie2/classification_export_configuration_test.go +++ b/internal/service/macie2/classification_export_configuration_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/macie2/classification_job_test.go b/internal/service/macie2/classification_job_test.go index 0a31ac7e867b..3030c6e37ab6 100644 --- a/internal/service/macie2/classification_job_test.go +++ b/internal/service/macie2/classification_job_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" diff --git a/internal/service/macie2/custom_data_identifier_test.go b/internal/service/macie2/custom_data_identifier_test.go index 111aa8384791..789db7f9bdee 100644 --- a/internal/service/macie2/custom_data_identifier_test.go +++ b/internal/service/macie2/custom_data_identifier_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" diff --git a/internal/service/macie2/findings_filter_test.go b/internal/service/macie2/findings_filter_test.go index fe46fec8bc3e..879a7c47209c 100644 --- a/internal/service/macie2/findings_filter_test.go +++ b/internal/service/macie2/findings_filter_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" diff --git a/internal/service/macie2/invitation_accepter_test.go b/internal/service/macie2/invitation_accepter_test.go index faf0ed0e4891..22983f00cf27 100644 --- a/internal/service/macie2/invitation_accepter_test.go +++ b/internal/service/macie2/invitation_accepter_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/macie2/member_test.go b/internal/service/macie2/member_test.go index f3cbb448c0ec..ba33255ce5e9 100644 --- a/internal/service/macie2/member_test.go +++ b/internal/service/macie2/member_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/macie2/organization_admin_account_test.go b/internal/service/macie2/organization_admin_account_test.go index feba1397d191..340eb61f7806 100644 --- a/internal/service/macie2/organization_admin_account_test.go +++ b/internal/service/macie2/organization_admin_account_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/macie2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfmacie2 "github.com/hashicorp/terraform-provider-aws/internal/service/macie2" diff --git a/internal/service/mediaconvert/queue_test.go b/internal/service/mediaconvert/queue_test.go index 64b535752564..a41b7a681b09 100644 --- a/internal/service/mediaconvert/queue_test.go +++ b/internal/service/mediaconvert/queue_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediaconvert" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmediaconvert "github.com/hashicorp/terraform-provider-aws/internal/service/mediaconvert" diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index 64245e19a355..83d48655cdaf 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/medialive" "github.com/aws/aws-sdk-go-v2/service/medialive/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/medialive/input_security_group_test.go b/internal/service/medialive/input_security_group_test.go index 0da1462a6c57..84e7c313886a 100644 --- a/internal/service/medialive/input_security_group_test.go +++ b/internal/service/medialive/input_security_group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/medialive" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/medialive/input_test.go b/internal/service/medialive/input_test.go index 58abc0996942..f1531150d8f5 100644 --- a/internal/service/medialive/input_test.go +++ b/internal/service/medialive/input_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/medialive" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/medialive/multiplex_program_test.go b/internal/service/medialive/multiplex_program_test.go index 3f1b14a04374..d772bcecbce0 100644 --- a/internal/service/medialive/multiplex_program_test.go +++ b/internal/service/medialive/multiplex_program_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/medialive" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/medialive/multiplex_test.go b/internal/service/medialive/multiplex_test.go index 8ad25ad12f5d..bd4e4993b29f 100644 --- a/internal/service/medialive/multiplex_test.go +++ b/internal/service/medialive/multiplex_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/medialive" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/medialive/sweep.go b/internal/service/medialive/sweep.go index 913d4d908a58..81af8a08aa13 100644 --- a/internal/service/medialive/sweep.go +++ b/internal/service/medialive/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/medialive" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/mediapackage/channel_test.go b/internal/service/mediapackage/channel_test.go index 29460fa0ef61..a7521b035780 100644 --- a/internal/service/mediapackage/channel_test.go +++ b/internal/service/mediapackage/channel_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediapackage" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/mediastore/container_policy_test.go b/internal/service/mediastore/container_policy_test.go index 813d2f2f2056..ece9f1021f40 100644 --- a/internal/service/mediastore/container_policy_test.go +++ b/internal/service/mediastore/container_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediastore" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/mediastore/container_test.go b/internal/service/mediastore/container_test.go index d41a75062bb7..f203b8c5a0fe 100644 --- a/internal/service/mediastore/container_test.go +++ b/internal/service/mediastore/container_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediastore" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/memorydb/acl_data_source_test.go b/internal/service/memorydb/acl_data_source_test.go index 52ce881d232e..c9358affadaa 100644 --- a/internal/service/memorydb/acl_data_source_test.go +++ b/internal/service/memorydb/acl_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/acl_test.go b/internal/service/memorydb/acl_test.go index 47ebf984c0d6..b43c8485e463 100644 --- a/internal/service/memorydb/acl_test.go +++ b/internal/service/memorydb/acl_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/memorydb/cluster_data_source_test.go b/internal/service/memorydb/cluster_data_source_test.go index 0266306dee61..d84dbe050c58 100644 --- a/internal/service/memorydb/cluster_data_source_test.go +++ b/internal/service/memorydb/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/cluster_test.go b/internal/service/memorydb/cluster_test.go index 3ad9739033f5..c6878b70279e 100644 --- a/internal/service/memorydb/cluster_test.go +++ b/internal/service/memorydb/cluster_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/memorydb/parameter_group_data_source_test.go b/internal/service/memorydb/parameter_group_data_source_test.go index ce01914b3970..806397c6a8dc 100644 --- a/internal/service/memorydb/parameter_group_data_source_test.go +++ b/internal/service/memorydb/parameter_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/parameter_group_test.go b/internal/service/memorydb/parameter_group_test.go index 84a7a1708cc4..e1179cc655b1 100644 --- a/internal/service/memorydb/parameter_group_test.go +++ b/internal/service/memorydb/parameter_group_test.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/memorydb/snapshot_data_source_test.go b/internal/service/memorydb/snapshot_data_source_test.go index 02ef3486a05f..3223b1c940c0 100644 --- a/internal/service/memorydb/snapshot_data_source_test.go +++ b/internal/service/memorydb/snapshot_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/snapshot_test.go b/internal/service/memorydb/snapshot_test.go index bf6d6bd95cbb..71f1d5bf710d 100644 --- a/internal/service/memorydb/snapshot_test.go +++ b/internal/service/memorydb/snapshot_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/memorydb/subnet_group_data_source_test.go b/internal/service/memorydb/subnet_group_data_source_test.go index 907fb3429831..0a77d95d4411 100644 --- a/internal/service/memorydb/subnet_group_data_source_test.go +++ b/internal/service/memorydb/subnet_group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/subnet_group_test.go b/internal/service/memorydb/subnet_group_test.go index daba13059000..4850930b6a2d 100644 --- a/internal/service/memorydb/subnet_group_test.go +++ b/internal/service/memorydb/subnet_group_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/memorydb/sweep.go b/internal/service/memorydb/sweep.go index 38a1ccba3b89..0615ddd01293 100644 --- a/internal/service/memorydb/sweep.go +++ b/internal/service/memorydb/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/memorydb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/memorydb/user_data_source_test.go b/internal/service/memorydb/user_data_source_test.go index f8a3878a0c7c..d0fca9c8cab3 100644 --- a/internal/service/memorydb/user_data_source_test.go +++ b/internal/service/memorydb/user_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/memorydb/user_test.go b/internal/service/memorydb/user_test.go index 8a9a40eed439..40fdb1883293 100644 --- a/internal/service/memorydb/user_test.go +++ b/internal/service/memorydb/user_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/memorydb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmemorydb "github.com/hashicorp/terraform-provider-aws/internal/service/memorydb" diff --git a/internal/service/meta/arn_data_source_test.go b/internal/service/meta/arn_data_source_test.go index 635f757e0203..8626b531fd8b 100644 --- a/internal/service/meta/arn_data_source_test.go +++ b/internal/service/meta/arn_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/billing_service_account_data_source_test.go b/internal/service/meta/billing_service_account_data_source_test.go index d18f8f5e80e3..fbb170f78043 100644 --- a/internal/service/meta/billing_service_account_data_source_test.go +++ b/internal/service/meta/billing_service_account_data_source_test.go @@ -3,7 +3,7 @@ package meta_test import ( "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/default_tags_data_source_test.go b/internal/service/meta/default_tags_data_source_test.go index ebec08919234..c9ce8b62517d 100644 --- a/internal/service/meta/default_tags_data_source_test.go +++ b/internal/service/meta/default_tags_data_source_test.go @@ -3,7 +3,7 @@ package meta_test import ( "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/ip_ranges_data_source_test.go b/internal/service/meta/ip_ranges_data_source_test.go index 4e2aa439ff2a..f411ccdf4ad1 100644 --- a/internal/service/meta/ip_ranges_data_source_test.go +++ b/internal/service/meta/ip_ranges_data_source_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/partition_data_source_test.go b/internal/service/meta/partition_data_source_test.go index 5429d9c50f7c..c5ed08caf037 100644 --- a/internal/service/meta/partition_data_source_test.go +++ b/internal/service/meta/partition_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" diff --git a/internal/service/meta/region_data_source_test.go b/internal/service/meta/region_data_source_test.go index 60c3fdd64c8c..b3b81b8034c8 100644 --- a/internal/service/meta/region_data_source_test.go +++ b/internal/service/meta/region_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/regions_data_source_test.go b/internal/service/meta/regions_data_source_test.go index 75d792301e23..8e2a0e0b0edc 100644 --- a/internal/service/meta/regions_data_source_test.go +++ b/internal/service/meta/regions_data_source_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/meta/service_data_source_test.go b/internal/service/meta/service_data_source_test.go index edec899ac3ed..dc8a8fc9c20a 100644 --- a/internal/service/meta/service_data_source_test.go +++ b/internal/service/meta/service_data_source_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfmeta "github.com/hashicorp/terraform-provider-aws/internal/service/meta" ) diff --git a/internal/service/mq/broker_data_source_test.go b/internal/service/mq/broker_data_source_test.go index f2f33f77ab63..aba8245d4c37 100644 --- a/internal/service/mq/broker_data_source_test.go +++ b/internal/service/mq/broker_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/mq" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/mq/broker_instance_type_offerings_data_source_test.go b/internal/service/mq/broker_instance_type_offerings_data_source_test.go index 91d1683012f6..876422d8c7a1 100644 --- a/internal/service/mq/broker_instance_type_offerings_data_source_test.go +++ b/internal/service/mq/broker_instance_type_offerings_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/mq" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/mq/broker_test.go b/internal/service/mq/broker_test.go index 9dfd3dd82789..0fffe0b71e1a 100644 --- a/internal/service/mq/broker_test.go +++ b/internal/service/mq/broker_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mq" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmq "github.com/hashicorp/terraform-provider-aws/internal/service/mq" diff --git a/internal/service/mq/configuration_test.go b/internal/service/mq/configuration_test.go index 3dfd5355d96a..2cda45b73b0b 100644 --- a/internal/service/mq/configuration_test.go +++ b/internal/service/mq/configuration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/mq" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmq "github.com/hashicorp/terraform-provider-aws/internal/service/mq" diff --git a/internal/service/mq/sweep.go b/internal/service/mq/sweep.go index 170380cdebb7..a55e2aa56d46 100644 --- a/internal/service/mq/sweep.go +++ b/internal/service/mq/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mq" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/mwaa/environment_test.go b/internal/service/mwaa/environment_test.go index 55c56cec34ed..9e06025846bf 100644 --- a/internal/service/mwaa/environment_test.go +++ b/internal/service/mwaa/environment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/mwaa" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfmwaa "github.com/hashicorp/terraform-provider-aws/internal/service/mwaa" diff --git a/internal/service/mwaa/sweep.go b/internal/service/mwaa/sweep.go index dc7a7e5d2aa0..611578103597 100644 --- a/internal/service/mwaa/sweep.go +++ b/internal/service/mwaa/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/mwaa" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/neptune/cluster_endpoint_test.go b/internal/service/neptune/cluster_endpoint_test.go index 98e53ebe78d6..36b7cff8c250 100644 --- a/internal/service/neptune/cluster_endpoint_test.go +++ b/internal/service/neptune/cluster_endpoint_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/cluster_instance_test.go b/internal/service/neptune/cluster_instance_test.go index df9745b070b6..e5133c1d052f 100644 --- a/internal/service/neptune/cluster_instance_test.go +++ b/internal/service/neptune/cluster_instance_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/neptune" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/cluster_parameter_group_test.go b/internal/service/neptune/cluster_parameter_group_test.go index 49f68d580ec5..8d3515101b92 100644 --- a/internal/service/neptune/cluster_parameter_group_test.go +++ b/internal/service/neptune/cluster_parameter_group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/neptune/cluster_snapshot_test.go b/internal/service/neptune/cluster_snapshot_test.go index f149626eba69..ef905b05b3ec 100644 --- a/internal/service/neptune/cluster_snapshot_test.go +++ b/internal/service/neptune/cluster_snapshot_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/neptune" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/cluster_test.go b/internal/service/neptune/cluster_test.go index acb9e3fbc34e..b41935f3fc14 100644 --- a/internal/service/neptune/cluster_test.go +++ b/internal/service/neptune/cluster_test.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/engine_version_data_source_test.go b/internal/service/neptune/engine_version_data_source_test.go index 0ecc24a17ec8..fc2a1f52b399 100644 --- a/internal/service/neptune/engine_version_data_source_test.go +++ b/internal/service/neptune/engine_version_data_source_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/neptune/event_subscription_test.go b/internal/service/neptune/event_subscription_test.go index 7e46059f6996..73b20f069059 100644 --- a/internal/service/neptune/event_subscription_test.go +++ b/internal/service/neptune/event_subscription_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/neptune/global_cluster_test.go b/internal/service/neptune/global_cluster_test.go index 1dc6cffd1c5d..6593a18126d2 100644 --- a/internal/service/neptune/global_cluster_test.go +++ b/internal/service/neptune/global_cluster_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/orderable_db_instance_data_source_test.go b/internal/service/neptune/orderable_db_instance_data_source_test.go index f5971bfc0dec..9db320b9b11b 100644 --- a/internal/service/neptune/orderable_db_instance_data_source_test.go +++ b/internal/service/neptune/orderable_db_instance_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/neptune/parameter_group_test.go b/internal/service/neptune/parameter_group_test.go index d8b320b705a5..6c1ef0edcfd0 100644 --- a/internal/service/neptune/parameter_group_test.go +++ b/internal/service/neptune/parameter_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/neptune/subnet_group_test.go b/internal/service/neptune/subnet_group_test.go index 70a5bc3d94ea..1a66920d4355 100644 --- a/internal/service/neptune/subnet_group_test.go +++ b/internal/service/neptune/subnet_group_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/neptune" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfneptune "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" diff --git a/internal/service/neptune/sweep.go b/internal/service/neptune/sweep.go index 7ce0c88359a2..8470019afb4f 100644 --- a/internal/service/neptune/sweep.go +++ b/internal/service/neptune/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/neptune/validate_test.go b/internal/service/neptune/validate_test.go index 68682cf7cbf7..04af47f41ca4 100644 --- a/internal/service/neptune/validate_test.go +++ b/internal/service/neptune/validate_test.go @@ -3,7 +3,7 @@ package neptune import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidEventSubscriptionName(t *testing.T) { diff --git a/internal/service/networkfirewall/firewall_data_source_test.go b/internal/service/networkfirewall/firewall_data_source_test.go index 558f01c8d02c..90443df75cd2 100644 --- a/internal/service/networkfirewall/firewall_data_source_test.go +++ b/internal/service/networkfirewall/firewall_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkfirewall/firewall_policy_data_source_test.go b/internal/service/networkfirewall/firewall_policy_data_source_test.go index bc56d4749cf2..4a5d10c7c444 100644 --- a/internal/service/networkfirewall/firewall_policy_data_source_test.go +++ b/internal/service/networkfirewall/firewall_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkfirewall/firewall_policy_test.go b/internal/service/networkfirewall/firewall_policy_test.go index 36b74087d0ca..0542bb26f31c 100644 --- a/internal/service/networkfirewall/firewall_policy_test.go +++ b/internal/service/networkfirewall/firewall_policy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" diff --git a/internal/service/networkfirewall/firewall_resource_policy_data_source_test.go b/internal/service/networkfirewall/firewall_resource_policy_data_source_test.go index 20c7f6682b16..dcaa06f5da9c 100644 --- a/internal/service/networkfirewall/firewall_resource_policy_data_source_test.go +++ b/internal/service/networkfirewall/firewall_resource_policy_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkfirewall/firewall_test.go b/internal/service/networkfirewall/firewall_test.go index ed7e0acdc517..96d9ca12bbc6 100644 --- a/internal/service/networkfirewall/firewall_test.go +++ b/internal/service/networkfirewall/firewall_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" diff --git a/internal/service/networkfirewall/logging_configuration_test.go b/internal/service/networkfirewall/logging_configuration_test.go index 9ce5b48a6701..6c4ee2dfb8ee 100644 --- a/internal/service/networkfirewall/logging_configuration_test.go +++ b/internal/service/networkfirewall/logging_configuration_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/networkfirewall" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" diff --git a/internal/service/networkfirewall/resource_policy_test.go b/internal/service/networkfirewall/resource_policy_test.go index a364cf7b57b7..557b7635f710 100644 --- a/internal/service/networkfirewall/resource_policy_test.go +++ b/internal/service/networkfirewall/resource_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/networkfirewall" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" diff --git a/internal/service/networkfirewall/rule_group_test.go b/internal/service/networkfirewall/rule_group_test.go index 5f2079f738de..d8c2641afd1f 100644 --- a/internal/service/networkfirewall/rule_group_test.go +++ b/internal/service/networkfirewall/rule_group_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkfirewall" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkfirewall "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" diff --git a/internal/service/networkfirewall/sweep.go b/internal/service/networkfirewall/sweep.go index 9ed2db169926..21b6f0bc46e8 100644 --- a/internal/service/networkfirewall/sweep.go +++ b/internal/service/networkfirewall/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkfirewall" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/networkmanager/connect_attachment_test.go b/internal/service/networkmanager/connect_attachment_test.go index 934874e7d6be..ea8a4ab71aea 100644 --- a/internal/service/networkmanager/connect_attachment_test.go +++ b/internal/service/networkmanager/connect_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/connect_peer_test.go b/internal/service/networkmanager/connect_peer_test.go index 0ee813dd1821..323d2e9ac893 100644 --- a/internal/service/networkmanager/connect_peer_test.go +++ b/internal/service/networkmanager/connect_peer_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/connection_data_source_test.go b/internal/service/networkmanager/connection_data_source_test.go index 82ee38f55fe6..b6a60f43f45b 100644 --- a/internal/service/networkmanager/connection_data_source_test.go +++ b/internal/service/networkmanager/connection_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/connection_test.go b/internal/service/networkmanager/connection_test.go index ce03c93f3d55..e8e7cdc9bae5 100644 --- a/internal/service/networkmanager/connection_test.go +++ b/internal/service/networkmanager/connection_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/connections_data_source_test.go b/internal/service/networkmanager/connections_data_source_test.go index 9100c16f8ddb..1bfd22e6d21f 100644 --- a/internal/service/networkmanager/connections_data_source_test.go +++ b/internal/service/networkmanager/connections_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/core_network_policy_attachment_test.go b/internal/service/networkmanager/core_network_policy_attachment_test.go index e6ed0a73eb43..adf3c0d053c0 100644 --- a/internal/service/networkmanager/core_network_policy_attachment_test.go +++ b/internal/service/networkmanager/core_network_policy_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/core_network_policy_document_data_source_test.go b/internal/service/networkmanager/core_network_policy_document_data_source_test.go index 3787d99f65e9..16737d306522 100644 --- a/internal/service/networkmanager/core_network_policy_document_data_source_test.go +++ b/internal/service/networkmanager/core_network_policy_document_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/core_network_test.go b/internal/service/networkmanager/core_network_test.go index a6bc1387d12f..d1c82e86ea91 100644 --- a/internal/service/networkmanager/core_network_test.go +++ b/internal/service/networkmanager/core_network_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/customer_gateway_association_test.go b/internal/service/networkmanager/customer_gateway_association_test.go index 1cb04fbfc3aa..374b967c014c 100644 --- a/internal/service/networkmanager/customer_gateway_association_test.go +++ b/internal/service/networkmanager/customer_gateway_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/networkmanager/device_data_source_test.go b/internal/service/networkmanager/device_data_source_test.go index face6528abde..0074c1a8e4b9 100644 --- a/internal/service/networkmanager/device_data_source_test.go +++ b/internal/service/networkmanager/device_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/device_test.go b/internal/service/networkmanager/device_test.go index 8d9aa908184d..692d8d9a2d8d 100644 --- a/internal/service/networkmanager/device_test.go +++ b/internal/service/networkmanager/device_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/devices_data_source_test.go b/internal/service/networkmanager/devices_data_source_test.go index 79e28a7cb533..81364d494b3e 100644 --- a/internal/service/networkmanager/devices_data_source_test.go +++ b/internal/service/networkmanager/devices_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/global_network_data_source_test.go b/internal/service/networkmanager/global_network_data_source_test.go index 784f1764962a..d4f2208edcce 100644 --- a/internal/service/networkmanager/global_network_data_source_test.go +++ b/internal/service/networkmanager/global_network_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/global_network_test.go b/internal/service/networkmanager/global_network_test.go index 570f27133c2f..441fa577e1e9 100644 --- a/internal/service/networkmanager/global_network_test.go +++ b/internal/service/networkmanager/global_network_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/global_networks_data_source_test.go b/internal/service/networkmanager/global_networks_data_source_test.go index 6ee7a0cd49f6..b82d2bfad805 100644 --- a/internal/service/networkmanager/global_networks_data_source_test.go +++ b/internal/service/networkmanager/global_networks_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/link_association_test.go b/internal/service/networkmanager/link_association_test.go index 39228b94e521..26941f21aa3c 100644 --- a/internal/service/networkmanager/link_association_test.go +++ b/internal/service/networkmanager/link_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/link_data_source_test.go b/internal/service/networkmanager/link_data_source_test.go index 085064cc75b2..b7a54678a05c 100644 --- a/internal/service/networkmanager/link_data_source_test.go +++ b/internal/service/networkmanager/link_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/link_test.go b/internal/service/networkmanager/link_test.go index c0517f3a2aec..c8fd694bf6d0 100644 --- a/internal/service/networkmanager/link_test.go +++ b/internal/service/networkmanager/link_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/links_data_source_test.go b/internal/service/networkmanager/links_data_source_test.go index af11919261b5..b23560bfefa3 100644 --- a/internal/service/networkmanager/links_data_source_test.go +++ b/internal/service/networkmanager/links_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/site_data_source_test.go b/internal/service/networkmanager/site_data_source_test.go index 019507ec52d8..007c4cc0f071 100644 --- a/internal/service/networkmanager/site_data_source_test.go +++ b/internal/service/networkmanager/site_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/site_test.go b/internal/service/networkmanager/site_test.go index d80d43c5fa8c..226345e8ec13 100644 --- a/internal/service/networkmanager/site_test.go +++ b/internal/service/networkmanager/site_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/site_to_site_vpn_attachment_test.go b/internal/service/networkmanager/site_to_site_vpn_attachment_test.go index d9c14ecb54aa..5be3ade143f2 100644 --- a/internal/service/networkmanager/site_to_site_vpn_attachment_test.go +++ b/internal/service/networkmanager/site_to_site_vpn_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/sites_data_source_test.go b/internal/service/networkmanager/sites_data_source_test.go index fa4b2f192aec..9ea35f56471f 100644 --- a/internal/service/networkmanager/sites_data_source_test.go +++ b/internal/service/networkmanager/sites_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/networkmanager/sweep.go b/internal/service/networkmanager/sweep.go index 5a3da9c908c3..fe12d56a09bb 100644 --- a/internal/service/networkmanager/sweep.go +++ b/internal/service/networkmanager/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkmanager" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go b/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go index 2c957cc26f72..da4376e8e904 100644 --- a/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go +++ b/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/networkmanager/transit_gateway_peering_test.go b/internal/service/networkmanager/transit_gateway_peering_test.go index 081c7d161906..66af67533e27 100644 --- a/internal/service/networkmanager/transit_gateway_peering_test.go +++ b/internal/service/networkmanager/transit_gateway_peering_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/transit_gateway_registration_test.go b/internal/service/networkmanager/transit_gateway_registration_test.go index f8755fd68c35..730f8620a1a7 100644 --- a/internal/service/networkmanager/transit_gateway_registration_test.go +++ b/internal/service/networkmanager/transit_gateway_registration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go b/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go index 4459aa1ae7f3..0b939ddbca89 100644 --- a/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go +++ b/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/networkmanager/vpc_attachment_test.go b/internal/service/networkmanager/vpc_attachment_test.go index d48adcfd50a7..39e2c932650f 100644 --- a/internal/service/networkmanager/vpc_attachment_test.go +++ b/internal/service/networkmanager/vpc_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/networkmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfnetworkmanager "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" diff --git a/internal/service/oam/link_data_source_test.go b/internal/service/oam/link_data_source_test.go index d600fd325d57..58b2731749ea 100644 --- a/internal/service/oam/link_data_source_test.go +++ b/internal/service/oam/link_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/oam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/oam/link_test.go b/internal/service/oam/link_test.go index 5316fea446d6..c69ab7887e4b 100644 --- a/internal/service/oam/link_test.go +++ b/internal/service/oam/link_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/oam" "github.com/aws/aws-sdk-go-v2/service/oam/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/oam/links_data_source_test.go b/internal/service/oam/links_data_source_test.go index be764b0332e7..34d31c96b528 100644 --- a/internal/service/oam/links_data_source_test.go +++ b/internal/service/oam/links_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/oam/sink_data_source_test.go b/internal/service/oam/sink_data_source_test.go index 4d23ff88e675..2a782b38f696 100644 --- a/internal/service/oam/sink_data_source_test.go +++ b/internal/service/oam/sink_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/oam" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/oam/sink_policy_test.go b/internal/service/oam/sink_policy_test.go index 4f7aa67675d2..14ee64ea1c47 100644 --- a/internal/service/oam/sink_policy_test.go +++ b/internal/service/oam/sink_policy_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/oam" "github.com/aws/aws-sdk-go-v2/service/oam/types" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go index 5ffdb21a4350..36bad4cb3f29 100644 --- a/internal/service/oam/sink_test.go +++ b/internal/service/oam/sink_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/oam" "github.com/aws/aws-sdk-go-v2/service/oam/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/oam/sinks_data_source_test.go b/internal/service/oam/sinks_data_source_test.go index 8fba6707a096..ef693d7e5baa 100644 --- a/internal/service/oam/sinks_data_source_test.go +++ b/internal/service/oam/sinks_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/opensearch/domain_data_source_test.go b/internal/service/opensearch/domain_data_source_test.go index 4476b39117f7..5292c0375c0a 100644 --- a/internal/service/opensearch/domain_data_source_test.go +++ b/internal/service/opensearch/domain_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opensearchservice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opensearch/domain_policy_test.go b/internal/service/opensearch/domain_policy_test.go index ba13123acbd9..be98d77722b7 100644 --- a/internal/service/opensearch/domain_policy_test.go +++ b/internal/service/opensearch/domain_policy_test.go @@ -6,9 +6,9 @@ import ( "github.com/aws/aws-sdk-go/service/opensearchservice" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/opensearch/domain_saml_options_test.go b/internal/service/opensearch/domain_saml_options_test.go index e9534e12b39c..dfbcefb3205b 100644 --- a/internal/service/opensearch/domain_saml_options_test.go +++ b/internal/service/opensearch/domain_saml_options_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opensearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index 96da359da50f..77b15b59668a 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/opensearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" diff --git a/internal/service/opensearch/inbound_connection_accepter_test.go b/internal/service/opensearch/inbound_connection_accepter_test.go index 99278771bbab..7cc681aa10e8 100644 --- a/internal/service/opensearch/inbound_connection_accepter_test.go +++ b/internal/service/opensearch/inbound_connection_accepter_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opensearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" ) diff --git a/internal/service/opensearch/outbound_connection_test.go b/internal/service/opensearch/outbound_connection_test.go index 01dcbcbaafbc..bcef6d1cdd75 100644 --- a/internal/service/opensearch/outbound_connection_test.go +++ b/internal/service/opensearch/outbound_connection_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opensearchservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfopensearch "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" ) diff --git a/internal/service/opensearch/sweep.go b/internal/service/opensearch/sweep.go index 16655c8923cb..62ac33fc3505 100644 --- a/internal/service/opensearch/sweep.go +++ b/internal/service/opensearch/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/opensearchservice" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/opsworks/application_test.go b/internal/service/opsworks/application_test.go index ce966f4c0dab..ee1539702131 100644 --- a/internal/service/opsworks/application_test.go +++ b/internal/service/opsworks/application_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/opsworks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/opsworks/custom_layer_test.go b/internal/service/opsworks/custom_layer_test.go index 28bd4fcf49df..dfa37a6b3b81 100644 --- a/internal/service/opsworks/custom_layer_test.go +++ b/internal/service/opsworks/custom_layer_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/ecs_cluster_layer_test.go b/internal/service/opsworks/ecs_cluster_layer_test.go index a6b4b7e6e28a..373050faaf0a 100644 --- a/internal/service/opsworks/ecs_cluster_layer_test.go +++ b/internal/service/opsworks/ecs_cluster_layer_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/ganglia_layer_test.go b/internal/service/opsworks/ganglia_layer_test.go index 852c1581334c..027402946728 100644 --- a/internal/service/opsworks/ganglia_layer_test.go +++ b/internal/service/opsworks/ganglia_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/haproxy_layer_test.go b/internal/service/opsworks/haproxy_layer_test.go index 4069062dbe38..f303545f2903 100644 --- a/internal/service/opsworks/haproxy_layer_test.go +++ b/internal/service/opsworks/haproxy_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/instance_test.go b/internal/service/opsworks/instance_test.go index a3a95218b891..fdc056466481 100644 --- a/internal/service/opsworks/instance_test.go +++ b/internal/service/opsworks/instance_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/opsworks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/opsworks/java_app_layer_test.go b/internal/service/opsworks/java_app_layer_test.go index 3e23a481eda1..2736bebe6cf5 100644 --- a/internal/service/opsworks/java_app_layer_test.go +++ b/internal/service/opsworks/java_app_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/layers_test.go b/internal/service/opsworks/layers_test.go index 6dc5bd207261..4e022f7090c1 100644 --- a/internal/service/opsworks/layers_test.go +++ b/internal/service/opsworks/layers_test.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" diff --git a/internal/service/opsworks/memcached_layer_test.go b/internal/service/opsworks/memcached_layer_test.go index 4a5db4cd3b1b..ccf44878ee11 100644 --- a/internal/service/opsworks/memcached_layer_test.go +++ b/internal/service/opsworks/memcached_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/mysql_layer_test.go b/internal/service/opsworks/mysql_layer_test.go index c893d94363c3..d682e83a719b 100644 --- a/internal/service/opsworks/mysql_layer_test.go +++ b/internal/service/opsworks/mysql_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/nodejs_app_layer_test.go b/internal/service/opsworks/nodejs_app_layer_test.go index 115d0fa81409..1fbeb874dfd0 100644 --- a/internal/service/opsworks/nodejs_app_layer_test.go +++ b/internal/service/opsworks/nodejs_app_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/permission_test.go b/internal/service/opsworks/permission_test.go index 16af1a8b905c..d8718fa7688d 100644 --- a/internal/service/opsworks/permission_test.go +++ b/internal/service/opsworks/permission_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" diff --git a/internal/service/opsworks/php_app_layer_test.go b/internal/service/opsworks/php_app_layer_test.go index 65f61bf18b8c..13bca5f03ba9 100644 --- a/internal/service/opsworks/php_app_layer_test.go +++ b/internal/service/opsworks/php_app_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/rails_app_layer_test.go b/internal/service/opsworks/rails_app_layer_test.go index d948b563fa10..0e1205c7ebc1 100644 --- a/internal/service/opsworks/rails_app_layer_test.go +++ b/internal/service/opsworks/rails_app_layer_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" ) diff --git a/internal/service/opsworks/rds_db_instance_test.go b/internal/service/opsworks/rds_db_instance_test.go index bf4bc8506c71..2974269ecbe2 100644 --- a/internal/service/opsworks/rds_db_instance_test.go +++ b/internal/service/opsworks/rds_db_instance_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" diff --git a/internal/service/opsworks/stack_test.go b/internal/service/opsworks/stack_test.go index 668ccb0ed460..2de8a0c53c53 100644 --- a/internal/service/opsworks/stack_test.go +++ b/internal/service/opsworks/stack_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" diff --git a/internal/service/opsworks/static_web_layer_test.go b/internal/service/opsworks/static_web_layer_test.go index 345dee8f5654..e8218a5829fa 100644 --- a/internal/service/opsworks/static_web_layer_test.go +++ b/internal/service/opsworks/static_web_layer_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/opsworks/sweep.go b/internal/service/opsworks/sweep.go index db3421ea3b78..2e1bbb48392b 100644 --- a/internal/service/opsworks/sweep.go +++ b/internal/service/opsworks/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/opsworks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/opsworks/user_profile_test.go b/internal/service/opsworks/user_profile_test.go index 2cb89f28b640..ea20cfd32cbe 100644 --- a/internal/service/opsworks/user_profile_test.go +++ b/internal/service/opsworks/user_profile_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/opsworks" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfopsworks "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" diff --git a/internal/service/organizations/account_test.go b/internal/service/organizations/account_test.go index f30c93233586..23242f8cd1e8 100644 --- a/internal/service/organizations/account_test.go +++ b/internal/service/organizations/account_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/delegated_administrator_test.go b/internal/service/organizations/delegated_administrator_test.go index e8c99e0a9d09..fb64792a3984 100644 --- a/internal/service/organizations/delegated_administrator_test.go +++ b/internal/service/organizations/delegated_administrator_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/delegated_administrators_data_source_test.go b/internal/service/organizations/delegated_administrators_data_source_test.go index d91c4b68a2cc..fa578545e680 100644 --- a/internal/service/organizations/delegated_administrators_data_source_test.go +++ b/internal/service/organizations/delegated_administrators_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/delegated_services_data_source_test.go b/internal/service/organizations/delegated_services_data_source_test.go index dc51a47c3cc7..723e397b746b 100644 --- a/internal/service/organizations/delegated_services_data_source_test.go +++ b/internal/service/organizations/delegated_services_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/organization_data_source_test.go b/internal/service/organizations/organization_data_source_test.go index de21be26bf2c..c0935dce7092 100644 --- a/internal/service/organizations/organization_data_source_test.go +++ b/internal/service/organizations/organization_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/organization_test.go b/internal/service/organizations/organization_test.go index f94535ccd520..301910642966 100644 --- a/internal/service/organizations/organization_test.go +++ b/internal/service/organizations/organization_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/organizational_unit_child_accounts_data_source_test.go b/internal/service/organizations/organizational_unit_child_accounts_data_source_test.go index f406ce388665..f5e88638595f 100644 --- a/internal/service/organizations/organizational_unit_child_accounts_data_source_test.go +++ b/internal/service/organizations/organizational_unit_child_accounts_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/organizational_unit_descendant_accounts_data_source_test.go b/internal/service/organizations/organizational_unit_descendant_accounts_data_source_test.go index ca388782d0ac..de8a98b4d81f 100644 --- a/internal/service/organizations/organizational_unit_descendant_accounts_data_source_test.go +++ b/internal/service/organizations/organizational_unit_descendant_accounts_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/organizational_unit_test.go b/internal/service/organizations/organizational_unit_test.go index 936cb8d255d4..fa882026f11f 100644 --- a/internal/service/organizations/organizational_unit_test.go +++ b/internal/service/organizations/organizational_unit_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/organizational_units_data_source_test.go b/internal/service/organizations/organizational_units_data_source_test.go index cdb100797a2c..68189c996012 100644 --- a/internal/service/organizations/organizational_units_data_source_test.go +++ b/internal/service/organizations/organizational_units_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/organizations_test.go b/internal/service/organizations/organizations_test.go index 714c8e0b05d2..31860140bf2f 100644 --- a/internal/service/organizations/organizations_test.go +++ b/internal/service/organizations/organizations_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/policy_attachment_test.go b/internal/service/organizations/policy_attachment_test.go index fcf4abee3fe2..0853a7c83362 100644 --- a/internal/service/organizations/policy_attachment_test.go +++ b/internal/service/organizations/policy_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/policy_test.go b/internal/service/organizations/policy_test.go index b751448b0cb3..3223024fd536 100644 --- a/internal/service/organizations/policy_test.go +++ b/internal/service/organizations/policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tforganizations "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" diff --git a/internal/service/organizations/resource_tags_data_source_test.go b/internal/service/organizations/resource_tags_data_source_test.go index dbe1173fa10b..c1d77ba4427d 100644 --- a/internal/service/organizations/resource_tags_data_source_test.go +++ b/internal/service/organizations/resource_tags_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/organizations" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outpost_asset_data_source_test.go b/internal/service/outposts/outpost_asset_data_source_test.go index bb4437e42cab..c4de90c6558d 100644 --- a/internal/service/outposts/outpost_asset_data_source_test.go +++ b/internal/service/outposts/outpost_asset_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outpost_assets_data_source_test.go b/internal/service/outposts/outpost_assets_data_source_test.go index 3f0b822d85c0..4d0174168da6 100644 --- a/internal/service/outposts/outpost_assets_data_source_test.go +++ b/internal/service/outposts/outpost_assets_data_source_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outpost_data_source_test.go b/internal/service/outposts/outpost_data_source_test.go index df54cc65dc69..1389cd9d11b9 100644 --- a/internal/service/outposts/outpost_data_source_test.go +++ b/internal/service/outposts/outpost_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outpost_instance_type_data_source_test.go b/internal/service/outposts/outpost_instance_type_data_source_test.go index 88b7b58ec75a..8ea5ddb0153d 100644 --- a/internal/service/outposts/outpost_instance_type_data_source_test.go +++ b/internal/service/outposts/outpost_instance_type_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outpost_instance_types_data_source_test.go b/internal/service/outposts/outpost_instance_types_data_source_test.go index 15885e6097a3..c2034ff7cec1 100644 --- a/internal/service/outposts/outpost_instance_types_data_source_test.go +++ b/internal/service/outposts/outpost_instance_types_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/outposts_data_source_test.go b/internal/service/outposts/outposts_data_source_test.go index f29d812a0162..4fb7897f745e 100644 --- a/internal/service/outposts/outposts_data_source_test.go +++ b/internal/service/outposts/outposts_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/site_data_source_test.go b/internal/service/outposts/site_data_source_test.go index b7507384f709..e430825bee89 100644 --- a/internal/service/outposts/site_data_source_test.go +++ b/internal/service/outposts/site_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/outposts/sites_data_source_test.go b/internal/service/outposts/sites_data_source_test.go index 6cd145995c8d..feec5d8ff0d9 100644 --- a/internal/service/outposts/sites_data_source_test.go +++ b/internal/service/outposts/sites_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/outposts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/adm_channel_test.go b/internal/service/pinpoint/adm_channel_test.go index e4c7f7c2bb5b..575d34f9d0cf 100644 --- a/internal/service/pinpoint/adm_channel_test.go +++ b/internal/service/pinpoint/adm_channel_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/apns_channel_test.go b/internal/service/pinpoint/apns_channel_test.go index 4c4127415d9c..1c74d069c716 100644 --- a/internal/service/pinpoint/apns_channel_test.go +++ b/internal/service/pinpoint/apns_channel_test.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/apns_sandbox_channel_test.go b/internal/service/pinpoint/apns_sandbox_channel_test.go index 8a21e92163b7..0b2e0037db50 100644 --- a/internal/service/pinpoint/apns_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_sandbox_channel_test.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/apns_voip_channel_test.go b/internal/service/pinpoint/apns_voip_channel_test.go index 291899a19e92..00ca8fa940e1 100644 --- a/internal/service/pinpoint/apns_voip_channel_test.go +++ b/internal/service/pinpoint/apns_voip_channel_test.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go index 1352a8edcc2c..a3651e4e26ac 100644 --- a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/app_test.go b/internal/service/pinpoint/app_test.go index fdae28461cf6..e039705c6c9e 100644 --- a/internal/service/pinpoint/app_test.go +++ b/internal/service/pinpoint/app_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/aws/aws-sdk-go/service/ram" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/pinpoint/baidu_channel_test.go b/internal/service/pinpoint/baidu_channel_test.go index 9e6b3fdc7520..f3d0d7fb0373 100644 --- a/internal/service/pinpoint/baidu_channel_test.go +++ b/internal/service/pinpoint/baidu_channel_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/email_channel_test.go b/internal/service/pinpoint/email_channel_test.go index 486e7986d627..4f272b217564 100644 --- a/internal/service/pinpoint/email_channel_test.go +++ b/internal/service/pinpoint/email_channel_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" diff --git a/internal/service/pinpoint/event_stream_test.go b/internal/service/pinpoint/event_stream_test.go index d5efcbdf4cae..f6b77ff05220 100644 --- a/internal/service/pinpoint/event_stream_test.go +++ b/internal/service/pinpoint/event_stream_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" diff --git a/internal/service/pinpoint/gcm_channel_test.go b/internal/service/pinpoint/gcm_channel_test.go index 6c546c240478..e6620cc2e30d 100644 --- a/internal/service/pinpoint/gcm_channel_test.go +++ b/internal/service/pinpoint/gcm_channel_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/pinpoint/sms_channel_test.go b/internal/service/pinpoint/sms_channel_test.go index f89264900bc2..88b811d4c485 100644 --- a/internal/service/pinpoint/sms_channel_test.go +++ b/internal/service/pinpoint/sms_channel_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfpinpoint "github.com/hashicorp/terraform-provider-aws/internal/service/pinpoint" diff --git a/internal/service/pinpoint/sweep.go b/internal/service/pinpoint/sweep.go index 2b791ecdb70c..cb7d54fe5a3b 100644 --- a/internal/service/pinpoint/sweep.go +++ b/internal/service/pinpoint/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/pipes/pipe_test.go b/internal/service/pipes/pipe_test.go index f85b8050724e..d8ac9625fd39 100644 --- a/internal/service/pipes/pipe_test.go +++ b/internal/service/pipes/pipe_test.go @@ -8,10 +8,10 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/pipes" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/pipes/sweep.go b/internal/service/pipes/sweep.go index e21ec0c1f530..852f34f04bb7 100644 --- a/internal/service/pipes/sweep.go +++ b/internal/service/pipes/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/pipes" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/pricing/product_data_source_test.go b/internal/service/pricing/product_data_source_test.go index a3e204b0a933..10ba8a5e5b82 100644 --- a/internal/service/pricing/product_data_source_test.go +++ b/internal/service/pricing/product_data_source_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/pricing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/qldb/ledger_data_source_test.go b/internal/service/qldb/ledger_data_source_test.go index fa9bce09c56c..7fbe88cce9f1 100644 --- a/internal/service/qldb/ledger_data_source_test.go +++ b/internal/service/qldb/ledger_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/qldb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/qldb/ledger_test.go b/internal/service/qldb/ledger_test.go index 9f00047b38b9..0b21e8ae4345 100644 --- a/internal/service/qldb/ledger_test.go +++ b/internal/service/qldb/ledger_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/qldb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfqldb "github.com/hashicorp/terraform-provider-aws/internal/service/qldb" diff --git a/internal/service/qldb/stream_test.go b/internal/service/qldb/stream_test.go index d089837fc089..bef510fe9cb5 100644 --- a/internal/service/qldb/stream_test.go +++ b/internal/service/qldb/stream_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/qldb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfqldb "github.com/hashicorp/terraform-provider-aws/internal/service/qldb" diff --git a/internal/service/qldb/sweep.go b/internal/service/qldb/sweep.go index 8cee9e98fc48..59da795c78c7 100644 --- a/internal/service/qldb/sweep.go +++ b/internal/service/qldb/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/qldb" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/quicksight/account_subscription_test.go b/internal/service/quicksight/account_subscription_test.go index 1497847dfc78..47488aa66f1a 100644 --- a/internal/service/quicksight/account_subscription_test.go +++ b/internal/service/quicksight/account_subscription_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/data_set_data_source_test.go b/internal/service/quicksight/data_set_data_source_test.go index 907e5a8f85c2..5ef3514a404a 100644 --- a/internal/service/quicksight/data_set_data_source_test.go +++ b/internal/service/quicksight/data_set_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/quicksight" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/quicksight/data_set_test.go b/internal/service/quicksight/data_set_test.go index 244d9c8272fa..682349f047c8 100644 --- a/internal/service/quicksight/data_set_test.go +++ b/internal/service/quicksight/data_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" diff --git a/internal/service/quicksight/data_source_test.go b/internal/service/quicksight/data_source_test.go index 642cd0ca0662..be4d290af54e 100644 --- a/internal/service/quicksight/data_source_test.go +++ b/internal/service/quicksight/data_source_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" diff --git a/internal/service/quicksight/folder_membership_test.go b/internal/service/quicksight/folder_membership_test.go index 3f18726b115c..932d4d3b93f5 100644 --- a/internal/service/quicksight/folder_membership_test.go +++ b/internal/service/quicksight/folder_membership_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/folder_test.go b/internal/service/quicksight/folder_test.go index 9c98bef1bd9a..a3774f43abe6 100644 --- a/internal/service/quicksight/folder_test.go +++ b/internal/service/quicksight/folder_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/group_data_source_test.go b/internal/service/quicksight/group_data_source_test.go index 7d430e40b375..b4a9b612ba44 100644 --- a/internal/service/quicksight/group_data_source_test.go +++ b/internal/service/quicksight/group_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/quicksight" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" ) diff --git a/internal/service/quicksight/group_membership_test.go b/internal/service/quicksight/group_membership_test.go index 929e52cd5102..e9fc5ef7da5c 100644 --- a/internal/service/quicksight/group_membership_test.go +++ b/internal/service/quicksight/group_membership_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" diff --git a/internal/service/quicksight/group_test.go b/internal/service/quicksight/group_test.go index bc73a4b4ea12..aeabfad85400 100644 --- a/internal/service/quicksight/group_test.go +++ b/internal/service/quicksight/group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" diff --git a/internal/service/quicksight/iam_policy_assignment_test.go b/internal/service/quicksight/iam_policy_assignment_test.go index 015c67bfffaf..487fc70652b4 100644 --- a/internal/service/quicksight/iam_policy_assignment_test.go +++ b/internal/service/quicksight/iam_policy_assignment_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/ingestion_test.go b/internal/service/quicksight/ingestion_test.go index c922722bd47e..e370a9ea291b 100644 --- a/internal/service/quicksight/ingestion_test.go +++ b/internal/service/quicksight/ingestion_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/namespace_test.go b/internal/service/quicksight/namespace_test.go index 509ccae9b2ac..dbf277bc523e 100644 --- a/internal/service/quicksight/namespace_test.go +++ b/internal/service/quicksight/namespace_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/refresh_schedule_test.go b/internal/service/quicksight/refresh_schedule_test.go index 08ced80d8974..f5e3e75e20b0 100644 --- a/internal/service/quicksight/refresh_schedule_test.go +++ b/internal/service/quicksight/refresh_schedule_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/sweep.go b/internal/service/quicksight/sweep.go index 5a7c6c0e9954..393c6a5ca298 100644 --- a/internal/service/quicksight/sweep.go +++ b/internal/service/quicksight/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/quicksight/user_data_source_test.go b/internal/service/quicksight/user_data_source_test.go index 546103507e65..322b929d7c31 100644 --- a/internal/service/quicksight/user_data_source_test.go +++ b/internal/service/quicksight/user_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/quicksight" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" ) diff --git a/internal/service/quicksight/user_test.go b/internal/service/quicksight/user_test.go index 59f9e4eedc3a..57a2e52375e1 100644 --- a/internal/service/quicksight/user_test.go +++ b/internal/service/quicksight/user_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfquicksight "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight" diff --git a/internal/service/ram/principal_association_test.go b/internal/service/ram/principal_association_test.go index c25b8eb1706d..a0d77578df12 100644 --- a/internal/service/ram/principal_association_test.go +++ b/internal/service/ram/principal_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" diff --git a/internal/service/ram/resource_association_test.go b/internal/service/ram/resource_association_test.go index c78b7342d063..bf1ae656bf7c 100644 --- a/internal/service/ram/resource_association_test.go +++ b/internal/service/ram/resource_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" diff --git a/internal/service/ram/resource_share_accepter_test.go b/internal/service/ram/resource_share_accepter_test.go index 0ef98a0a4975..342d660ab8b3 100644 --- a/internal/service/ram/resource_share_accepter_test.go +++ b/internal/service/ram/resource_share_accepter_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" diff --git a/internal/service/ram/resource_share_data_source_test.go b/internal/service/ram/resource_share_data_source_test.go index 92fe1d8e344b..bba63d9469d1 100644 --- a/internal/service/ram/resource_share_data_source_test.go +++ b/internal/service/ram/resource_share_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ram" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ram/resource_share_test.go b/internal/service/ram/resource_share_test.go index 6754c5c58631..97f33e3a1367 100644 --- a/internal/service/ram/resource_share_test.go +++ b/internal/service/ram/resource_share_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfram "github.com/hashicorp/terraform-provider-aws/internal/service/ram" diff --git a/internal/service/ram/sweep.go b/internal/service/ram/sweep.go index 57b48d1bdad1..ecb44cc1c8cf 100644 --- a/internal/service/ram/sweep.go +++ b/internal/service/ram/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/rbin/rule_test.go b/internal/service/rbin/rule_test.go index e31cf2d5a749..290e5a6229f8 100644 --- a/internal/service/rbin/rule_test.go +++ b/internal/service/rbin/rule_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rbin" "github.com/aws/aws-sdk-go-v2/service/rbin/types" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/rds/certificate_data_source_test.go b/internal/service/rds/certificate_data_source_test.go index d811b5e24fa8..ef4d11f26a87 100644 --- a/internal/service/rds/certificate_data_source_test.go +++ b/internal/service/rds/certificate_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/rds/cluster_activity_stream_test.go b/internal/service/rds/cluster_activity_stream_test.go index 111acf23b975..273ae1344f66 100644 --- a/internal/service/rds/cluster_activity_stream_test.go +++ b/internal/service/rds/cluster_activity_stream_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/cluster_data_source_test.go b/internal/service/rds/cluster_data_source_test.go index 357a5dc72000..c696e3b84ead 100644 --- a/internal/service/rds/cluster_data_source_test.go +++ b/internal/service/rds/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/cluster_endpoint_test.go b/internal/service/rds/cluster_endpoint_test.go index 5bac22afe53f..0c31675a7693 100644 --- a/internal/service/rds/cluster_endpoint_test.go +++ b/internal/service/rds/cluster_endpoint_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/cluster_instance_test.go b/internal/service/rds/cluster_instance_test.go index f3548329e927..107097dbb096 100644 --- a/internal/service/rds/cluster_instance_test.go +++ b/internal/service/rds/cluster_instance_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/cluster_parameter_group_test.go b/internal/service/rds/cluster_parameter_group_test.go index 108cdc29e386..19af909020fe 100644 --- a/internal/service/rds/cluster_parameter_group_test.go +++ b/internal/service/rds/cluster_parameter_group_test.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/cluster_role_association_test.go b/internal/service/rds/cluster_role_association_test.go index c28023848220..14b45561916d 100644 --- a/internal/service/rds/cluster_role_association_test.go +++ b/internal/service/rds/cluster_role_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/service/iam" diff --git a/internal/service/rds/cluster_snapshot_data_source_test.go b/internal/service/rds/cluster_snapshot_data_source_test.go index 07f245165cbc..4f40cec78778 100644 --- a/internal/service/rds/cluster_snapshot_data_source_test.go +++ b/internal/service/rds/cluster_snapshot_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/cluster_snapshot_test.go b/internal/service/rds/cluster_snapshot_test.go index 0763fe3e8aaa..be5abd539554 100644 --- a/internal/service/rds/cluster_snapshot_test.go +++ b/internal/service/rds/cluster_snapshot_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/cluster_test.go b/internal/service/rds/cluster_test.go index d314f02d251e..d0e4d5e7f5bb 100644 --- a/internal/service/rds/cluster_test.go +++ b/internal/service/rds/cluster_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/clusters_data_source_test.go b/internal/service/rds/clusters_data_source_test.go index fd831cc4eab7..cdbb1a62730e 100644 --- a/internal/service/rds/clusters_data_source_test.go +++ b/internal/service/rds/clusters_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/engine_version_data_source_test.go b/internal/service/rds/engine_version_data_source_test.go index a91c842dae3f..d6fd8a4b9aa3 100644 --- a/internal/service/rds/engine_version_data_source_test.go +++ b/internal/service/rds/engine_version_data_source_test.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/rds/event_categories_data_source_test.go b/internal/service/rds/event_categories_data_source_test.go index 9795e7ac2d20..04b56db5cda4 100644 --- a/internal/service/rds/event_categories_data_source_test.go +++ b/internal/service/rds/event_categories_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/event_subscription_test.go b/internal/service/rds/event_subscription_test.go index 5d79b854b4e7..e6d8b7f35ce8 100644 --- a/internal/service/rds/event_subscription_test.go +++ b/internal/service/rds/event_subscription_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/export_task_test.go b/internal/service/rds/export_task_test.go index f23a1b0b609e..8c8563c25760 100644 --- a/internal/service/rds/export_task_test.go +++ b/internal/service/rds/export_task_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rds/types" rdsv1 "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/rds/global_cluster_test.go b/internal/service/rds/global_cluster_test.go index f4b5c8ddb360..b906750dc217 100644 --- a/internal/service/rds/global_cluster_test.go +++ b/internal/service/rds/global_cluster_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/instance_automated_backups_replication_test.go b/internal/service/rds/instance_automated_backups_replication_test.go index d3165a54324e..41c94aee9aed 100644 --- a/internal/service/rds/instance_automated_backups_replication_test.go +++ b/internal/service/rds/instance_automated_backups_replication_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/instance_data_source_test.go b/internal/service/rds/instance_data_source_test.go index f3ec5cc46e72..3460a8de4788 100644 --- a/internal/service/rds/instance_data_source_test.go +++ b/internal/service/rds/instance_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/instance_role_association_test.go b/internal/service/rds/instance_role_association_test.go index ff68d5f86247..e7f14506df47 100644 --- a/internal/service/rds/instance_role_association_test.go +++ b/internal/service/rds/instance_role_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index 3cd78a91aa7f..70332e770c86 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/envvar" diff --git a/internal/service/rds/instances_data_source_test.go b/internal/service/rds/instances_data_source_test.go index 5ee8c53340fb..456b73e94d96 100644 --- a/internal/service/rds/instances_data_source_test.go +++ b/internal/service/rds/instances_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/option_group_test.go b/internal/service/rds/option_group_test.go index bb1960807c35..ad2d02ee5a52 100644 --- a/internal/service/rds/option_group_test.go +++ b/internal/service/rds/option_group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/rds/orderable_instance_data_source_test.go b/internal/service/rds/orderable_instance_data_source_test.go index badc63a8ac37..787438857bd9 100644 --- a/internal/service/rds/orderable_instance_data_source_test.go +++ b/internal/service/rds/orderable_instance_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/rds/parameter_group_test.go b/internal/service/rds/parameter_group_test.go index 77b96cdc52bc..892d552d9c0c 100644 --- a/internal/service/rds/parameter_group_test.go +++ b/internal/service/rds/parameter_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/proxy_data_source_test.go b/internal/service/rds/proxy_data_source_test.go index e1671b15c614..01fa90f2db86 100644 --- a/internal/service/rds/proxy_data_source_test.go +++ b/internal/service/rds/proxy_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/proxy_default_target_group_test.go b/internal/service/rds/proxy_default_target_group_test.go index a7196a1c78f2..3df5bd5f007b 100644 --- a/internal/service/rds/proxy_default_target_group_test.go +++ b/internal/service/rds/proxy_default_target_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/proxy_endpoint_test.go b/internal/service/rds/proxy_endpoint_test.go index 9db7d544e040..fcaa82cdf48e 100644 --- a/internal/service/rds/proxy_endpoint_test.go +++ b/internal/service/rds/proxy_endpoint_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/proxy_target_test.go b/internal/service/rds/proxy_target_test.go index 63f3953ea805..30b504899930 100644 --- a/internal/service/rds/proxy_target_test.go +++ b/internal/service/rds/proxy_target_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/proxy_test.go b/internal/service/rds/proxy_test.go index 04fcfae78af7..fed5cb7575e9 100644 --- a/internal/service/rds/proxy_test.go +++ b/internal/service/rds/proxy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/reserved_instance_offering_data_source_test.go b/internal/service/rds/reserved_instance_offering_data_source_test.go index 6513e3fefe76..e37f156450b9 100644 --- a/internal/service/rds/reserved_instance_offering_data_source_test.go +++ b/internal/service/rds/reserved_instance_offering_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/reserved_instance_test.go b/internal/service/rds/reserved_instance_test.go index 65e07403b0d9..ced21dba2413 100644 --- a/internal/service/rds/reserved_instance_test.go +++ b/internal/service/rds/reserved_instance_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/snapshot_copy_test.go b/internal/service/rds/snapshot_copy_test.go index 8b7f138b4e9d..0e382a05445e 100644 --- a/internal/service/rds/snapshot_copy_test.go +++ b/internal/service/rds/snapshot_copy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/snapshot_data_source_test.go b/internal/service/rds/snapshot_data_source_test.go index d906396e38ae..f20da960bb55 100644 --- a/internal/service/rds/snapshot_data_source_test.go +++ b/internal/service/rds/snapshot_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 3f4300da2e7d..36aa99898c83 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/subnet_group_data_source_test.go b/internal/service/rds/subnet_group_data_source_test.go index 7308c4b46dcf..556d120f5523 100644 --- a/internal/service/rds/subnet_group_data_source_test.go +++ b/internal/service/rds/subnet_group_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rds/subnet_group_test.go b/internal/service/rds/subnet_group_test.go index fc15555f2c34..d15157785596 100644 --- a/internal/service/rds/subnet_group_test.go +++ b/internal/service/rds/subnet_group_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/rds" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrds "github.com/hashicorp/terraform-provider-aws/internal/service/rds" diff --git a/internal/service/rds/sweep.go b/internal/service/rds/sweep.go index 65cb9501b1c4..469da99b07a0 100644 --- a/internal/service/rds/sweep.go +++ b/internal/service/rds/sweep.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/rds/validate_test.go b/internal/service/rds/validate_test.go index 46105280e473..5ad3638842a8 100644 --- a/internal/service/rds/validate_test.go +++ b/internal/service/rds/validate_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidEventSubscriptionName(t *testing.T) { diff --git a/internal/service/redshift/authentication_profile_test.go b/internal/service/redshift/authentication_profile_test.go index e72c67b8354d..0c3145c89d04 100644 --- a/internal/service/redshift/authentication_profile_test.go +++ b/internal/service/redshift/authentication_profile_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/cluster_credentials_data_source_test.go b/internal/service/redshift/cluster_credentials_data_source_test.go index 3b9c5762ce63..03ab6ace148d 100644 --- a/internal/service/redshift/cluster_credentials_data_source_test.go +++ b/internal/service/redshift/cluster_credentials_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/redshift/cluster_data_source_test.go b/internal/service/redshift/cluster_data_source_test.go index bb0cacb9e592..cc75e9d7e4a2 100644 --- a/internal/service/redshift/cluster_data_source_test.go +++ b/internal/service/redshift/cluster_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/redshift/cluster_iam_roles_test.go b/internal/service/redshift/cluster_iam_roles_test.go index 6ee860482105..f61e1a849376 100644 --- a/internal/service/redshift/cluster_iam_roles_test.go +++ b/internal/service/redshift/cluster_iam_roles_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" ) diff --git a/internal/service/redshift/cluster_snapshot_test.go b/internal/service/redshift/cluster_snapshot_test.go index 2625078087d0..3b8c88a64786 100644 --- a/internal/service/redshift/cluster_snapshot_test.go +++ b/internal/service/redshift/cluster_snapshot_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/cluster_test.go b/internal/service/redshift/cluster_test.go index 4064c406e38b..466c2f932062 100644 --- a/internal/service/redshift/cluster_test.go +++ b/internal/service/redshift/cluster_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/endpoint_access_test.go b/internal/service/redshift/endpoint_access_test.go index d8f4d95ff8fa..dbd73a777d78 100644 --- a/internal/service/redshift/endpoint_access_test.go +++ b/internal/service/redshift/endpoint_access_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/endpoint_authorization_test.go b/internal/service/redshift/endpoint_authorization_test.go index 35939dcf40a3..aa7ac8a9b088 100644 --- a/internal/service/redshift/endpoint_authorization_test.go +++ b/internal/service/redshift/endpoint_authorization_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/event_subscription_test.go b/internal/service/redshift/event_subscription_test.go index fe4e87ae6509..e7cfbc07a58d 100644 --- a/internal/service/redshift/event_subscription_test.go +++ b/internal/service/redshift/event_subscription_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/hsm_client_certificate_test.go b/internal/service/redshift/hsm_client_certificate_test.go index 43387fb803e9..95dcc886196f 100644 --- a/internal/service/redshift/hsm_client_certificate_test.go +++ b/internal/service/redshift/hsm_client_certificate_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/hsm_configuration_test.go b/internal/service/redshift/hsm_configuration_test.go index 71a42204a821..db36711dce11 100644 --- a/internal/service/redshift/hsm_configuration_test.go +++ b/internal/service/redshift/hsm_configuration_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/orderable_cluster_data_source_test.go b/internal/service/redshift/orderable_cluster_data_source_test.go index ad9e976ade41..c188aaa0b755 100644 --- a/internal/service/redshift/orderable_cluster_data_source_test.go +++ b/internal/service/redshift/orderable_cluster_data_source_test.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/redshift/parameter_group_test.go b/internal/service/redshift/parameter_group_test.go index 3267eb637b0a..8fe3bc8ea70d 100644 --- a/internal/service/redshift/parameter_group_test.go +++ b/internal/service/redshift/parameter_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/partner_test.go b/internal/service/redshift/partner_test.go index 82325463442f..2cffde0a191d 100644 --- a/internal/service/redshift/partner_test.go +++ b/internal/service/redshift/partner_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/scheduled_action_test.go b/internal/service/redshift/scheduled_action_test.go index b11f48040acb..e60b74a3eef3 100644 --- a/internal/service/redshift/scheduled_action_test.go +++ b/internal/service/redshift/scheduled_action_test.go @@ -8,10 +8,10 @@ import ( "time" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/snapshot_copy_grant_test.go b/internal/service/redshift/snapshot_copy_grant_test.go index 6cc1ae48f2bd..b7d4b88fbb7a 100644 --- a/internal/service/redshift/snapshot_copy_grant_test.go +++ b/internal/service/redshift/snapshot_copy_grant_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/snapshot_schedule_association_test.go b/internal/service/redshift/snapshot_schedule_association_test.go index 638a0784e65c..d49148d989d4 100644 --- a/internal/service/redshift/snapshot_schedule_association_test.go +++ b/internal/service/redshift/snapshot_schedule_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/snapshot_schedule_test.go b/internal/service/redshift/snapshot_schedule_test.go index 03b70eee3c22..793043d0aa83 100644 --- a/internal/service/redshift/snapshot_schedule_test.go +++ b/internal/service/redshift/snapshot_schedule_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/subnet_group_data_source_test.go b/internal/service/redshift/subnet_group_data_source_test.go index 1f74cacea787..6207f1fbd08a 100644 --- a/internal/service/redshift/subnet_group_data_source_test.go +++ b/internal/service/redshift/subnet_group_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/redshift/subnet_group_test.go b/internal/service/redshift/subnet_group_test.go index 1fc7e2ab8e3c..41eef8c70e54 100644 --- a/internal/service/redshift/subnet_group_test.go +++ b/internal/service/redshift/subnet_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshift/sweep.go b/internal/service/redshift/sweep.go index c81b365c9260..daa0bdce7bb2 100644 --- a/internal/service/redshift/sweep.go +++ b/internal/service/redshift/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/redshift/usage_limit_test.go b/internal/service/redshift/usage_limit_test.go index f54a315b942b..383124627822 100644 --- a/internal/service/redshift/usage_limit_test.go +++ b/internal/service/redshift/usage_limit_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshift" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshift "github.com/hashicorp/terraform-provider-aws/internal/service/redshift" diff --git a/internal/service/redshiftdata/statement_test.go b/internal/service/redshiftdata/statement_test.go index bf01fae24d87..9b0e3449634e 100644 --- a/internal/service/redshiftdata/statement_test.go +++ b/internal/service/redshiftdata/statement_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftdataapiservice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftdata "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftdata" diff --git a/internal/service/redshiftserverless/credentials_data_source_test.go b/internal/service/redshiftserverless/credentials_data_source_test.go index 48b1514acf86..f68d266b697b 100644 --- a/internal/service/redshiftserverless/credentials_data_source_test.go +++ b/internal/service/redshiftserverless/credentials_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/redshiftserverless/endpoint_access_test.go b/internal/service/redshiftserverless/endpoint_access_test.go index 5daca3c08743..1dbcf1599f49 100644 --- a/internal/service/redshiftserverless/endpoint_access_test.go +++ b/internal/service/redshiftserverless/endpoint_access_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index b76fbd074a9c..1dac82f85d5a 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/redshiftserverless/resource_policy_test.go b/internal/service/redshiftserverless/resource_policy_test.go index ff81296858e2..9cec03201081 100644 --- a/internal/service/redshiftserverless/resource_policy_test.go +++ b/internal/service/redshiftserverless/resource_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/redshiftserverless/snapshot_test.go b/internal/service/redshiftserverless/snapshot_test.go index 0a4004fb576f..5aa3286a4de8 100644 --- a/internal/service/redshiftserverless/snapshot_test.go +++ b/internal/service/redshiftserverless/snapshot_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/redshiftserverless/sweep.go b/internal/service/redshiftserverless/sweep.go index c89933d56859..7a74fb859410 100644 --- a/internal/service/redshiftserverless/sweep.go +++ b/internal/service/redshiftserverless/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshiftserverless" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/redshiftserverless/usage_limit_test.go b/internal/service/redshiftserverless/usage_limit_test.go index 9daa6159db6e..e07a9cfdd3fa 100644 --- a/internal/service/redshiftserverless/usage_limit_test.go +++ b/internal/service/redshiftserverless/usage_limit_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/redshiftserverless/workgroup_data_source_test.go b/internal/service/redshiftserverless/workgroup_data_source_test.go index 566c07709e81..2ff94257fff6 100644 --- a/internal/service/redshiftserverless/workgroup_data_source_test.go +++ b/internal/service/redshiftserverless/workgroup_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/redshiftserverless/workgroup_test.go b/internal/service/redshiftserverless/workgroup_test.go index 0d3c47d05d14..51e12233c715 100644 --- a/internal/service/redshiftserverless/workgroup_test.go +++ b/internal/service/redshiftserverless/workgroup_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/redshiftserverless" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfredshiftserverless "github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless" diff --git a/internal/service/resourceexplorer2/index_test.go b/internal/service/resourceexplorer2/index_test.go index 46e6f86b88d6..a5878bb72675 100644 --- a/internal/service/resourceexplorer2/index_test.go +++ b/internal/service/resourceexplorer2/index_test.go @@ -6,8 +6,8 @@ import ( "regexp" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfresourceexplorer2 "github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2" diff --git a/internal/service/resourceexplorer2/sweep.go b/internal/service/resourceexplorer2/sweep.go index 7999fe582be2..b5f8e957b229 100644 --- a/internal/service/resourceexplorer2/sweep.go +++ b/internal/service/resourceexplorer2/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/resourceexplorer2/view_test.go b/internal/service/resourceexplorer2/view_test.go index 42d0eaee22a4..7b1ee93f8c33 100644 --- a/internal/service/resourceexplorer2/view_test.go +++ b/internal/service/resourceexplorer2/view_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfresourceexplorer2 "github.com/hashicorp/terraform-provider-aws/internal/service/resourceexplorer2" diff --git a/internal/service/resourcegroups/group_test.go b/internal/service/resourcegroups/group_test.go index 5132c9bd8b12..3510f88d7214 100644 --- a/internal/service/resourcegroups/group_test.go +++ b/internal/service/resourcegroups/group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/resourcegroups" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfresourcegroups "github.com/hashicorp/terraform-provider-aws/internal/service/resourcegroups" diff --git a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go index 3afff5078c9a..e42325659d57 100644 --- a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go +++ b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/rolesanywhere/profile_test.go b/internal/service/rolesanywhere/profile_test.go index 89b2dbc8a6d6..7c0a27094a8e 100644 --- a/internal/service/rolesanywhere/profile_test.go +++ b/internal/service/rolesanywhere/profile_test.go @@ -5,9 +5,9 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrolesanywhere "github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere" diff --git a/internal/service/rolesanywhere/trust_anchor_test.go b/internal/service/rolesanywhere/trust_anchor_test.go index 577d70d87614..426df61e6f4f 100644 --- a/internal/service/rolesanywhere/trust_anchor_test.go +++ b/internal/service/rolesanywhere/trust_anchor_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfrolesanywhere "github.com/hashicorp/terraform-provider-aws/internal/service/rolesanywhere" diff --git a/internal/service/route53/cidr_collection_test.go b/internal/service/route53/cidr_collection_test.go index 5115e48bd4ff..e24df77002d6 100644 --- a/internal/service/route53/cidr_collection_test.go +++ b/internal/service/route53/cidr_collection_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/cidr_location_test.go b/internal/service/route53/cidr_location_test.go index fb275ba5fd5c..0fd40e51b008 100644 --- a/internal/service/route53/cidr_location_test.go +++ b/internal/service/route53/cidr_location_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/delegation_set_data_source_test.go b/internal/service/route53/delegation_set_data_source_test.go index 830b19088c1e..092eb7b5f7c1 100644 --- a/internal/service/route53/delegation_set_data_source_test.go +++ b/internal/service/route53/delegation_set_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53/delegation_set_test.go b/internal/service/route53/delegation_set_test.go index 35c8bff4503d..63f7a15bc320 100644 --- a/internal/service/route53/delegation_set_test.go +++ b/internal/service/route53/delegation_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/health_check_test.go b/internal/service/route53/health_check_test.go index 38dbf539c58e..620a45242772 100644 --- a/internal/service/route53/health_check_test.go +++ b/internal/service/route53/health_check_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/hosted_zone_dnssec_test.go b/internal/service/route53/hosted_zone_dnssec_test.go index 2ae6ec288383..3b9ad37b2ddb 100644 --- a/internal/service/route53/hosted_zone_dnssec_test.go +++ b/internal/service/route53/hosted_zone_dnssec_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/key_signing_key_test.go b/internal/service/route53/key_signing_key_test.go index 22d26ad8b827..444299be0689 100644 --- a/internal/service/route53/key_signing_key_test.go +++ b/internal/service/route53/key_signing_key_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/query_log_test.go b/internal/service/route53/query_log_test.go index 97be995d2fe5..a5efd003a482 100644 --- a/internal/service/route53/query_log_test.go +++ b/internal/service/route53/query_log_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/record_test.go b/internal/service/route53/record_test.go index dd278f890fc8..46368a7123ed 100644 --- a/internal/service/route53/record_test.go +++ b/internal/service/route53/record_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/sweep.go b/internal/service/route53/sweep.go index 24347dd17ad4..0a9403edfcc9 100644 --- a/internal/service/route53/sweep.go +++ b/internal/service/route53/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/route53/traffic_policy_document_data_source_test.go b/internal/service/route53/traffic_policy_document_data_source_test.go index 2381e3303507..c3080f4e75c3 100644 --- a/internal/service/route53/traffic_policy_document_data_source_test.go +++ b/internal/service/route53/traffic_policy_document_data_source_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfrouter53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" ) diff --git a/internal/service/route53/traffic_policy_instance_test.go b/internal/service/route53/traffic_policy_instance_test.go index 036502b0193f..23fde5120503 100644 --- a/internal/service/route53/traffic_policy_instance_test.go +++ b/internal/service/route53/traffic_policy_instance_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/traffic_policy_test.go b/internal/service/route53/traffic_policy_test.go index 0bdcd0d718b0..e4bd0d4dcad9 100644 --- a/internal/service/route53/traffic_policy_test.go +++ b/internal/service/route53/traffic_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/vpc_association_authorization_test.go b/internal/service/route53/vpc_association_authorization_test.go index 6a113b3dc5d1..1a872a75968e 100644 --- a/internal/service/route53/vpc_association_authorization_test.go +++ b/internal/service/route53/vpc_association_authorization_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53/zone_association_test.go b/internal/service/route53/zone_association_test.go index 11b247c26aa6..bb3d0159356a 100644 --- a/internal/service/route53/zone_association_test.go +++ b/internal/service/route53/zone_association_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/route53/zone_data_source_test.go b/internal/service/route53/zone_data_source_test.go index ec072660abef..2c0a4590cadb 100644 --- a/internal/service/route53/zone_data_source_test.go +++ b/internal/service/route53/zone_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53/zone_test.go b/internal/service/route53/zone_test.go index b9d4232e9e36..1946bb406df1 100644 --- a/internal/service/route53/zone_test.go +++ b/internal/service/route53/zone_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" diff --git a/internal/service/route53domains/registered_domain_test.go b/internal/service/route53domains/registered_domain_test.go index 61b069d65e26..74ee7341d9cc 100644 --- a/internal/service/route53domains/registered_domain_test.go +++ b/internal/service/route53domains/registered_domain_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/route53domains" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/names" diff --git a/internal/service/route53recoverycontrolconfig/cluster_test.go b/internal/service/route53recoverycontrolconfig/cluster_test.go index 57ceaa52f285..03d497e8cfc3 100644 --- a/internal/service/route53recoverycontrolconfig/cluster_test.go +++ b/internal/service/route53recoverycontrolconfig/cluster_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" diff --git a/internal/service/route53recoverycontrolconfig/control_panel_test.go b/internal/service/route53recoverycontrolconfig/control_panel_test.go index 9cf596f60bf3..f28f551e74b8 100644 --- a/internal/service/route53recoverycontrolconfig/control_panel_test.go +++ b/internal/service/route53recoverycontrolconfig/control_panel_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" diff --git a/internal/service/route53recoverycontrolconfig/routing_control_test.go b/internal/service/route53recoverycontrolconfig/routing_control_test.go index b9c2e38a1a28..d61274c58ec4 100644 --- a/internal/service/route53recoverycontrolconfig/routing_control_test.go +++ b/internal/service/route53recoverycontrolconfig/routing_control_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" diff --git a/internal/service/route53recoverycontrolconfig/safety_rule_test.go b/internal/service/route53recoverycontrolconfig/safety_rule_test.go index e5edcc0c4103..511caf2f18fb 100644 --- a/internal/service/route53recoverycontrolconfig/safety_rule_test.go +++ b/internal/service/route53recoverycontrolconfig/safety_rule_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoverycontrolconfig "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoverycontrolconfig" diff --git a/internal/service/route53recoverycontrolconfig/sweep.go b/internal/service/route53recoverycontrolconfig/sweep.go index 16fc8a986735..83037c87d496 100644 --- a/internal/service/route53recoverycontrolconfig/sweep.go +++ b/internal/service/route53recoverycontrolconfig/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" r53rcc "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/route53recoveryreadiness/cell_test.go b/internal/service/route53recoveryreadiness/cell_test.go index b4a40ad4e22a..5f780c138a86 100644 --- a/internal/service/route53recoveryreadiness/cell_test.go +++ b/internal/service/route53recoveryreadiness/cell_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" diff --git a/internal/service/route53recoveryreadiness/readiness_check_test.go b/internal/service/route53recoveryreadiness/readiness_check_test.go index 8bcd2190599f..87d6be5215fc 100644 --- a/internal/service/route53recoveryreadiness/readiness_check_test.go +++ b/internal/service/route53recoveryreadiness/readiness_check_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" diff --git a/internal/service/route53recoveryreadiness/recovery_group_test.go b/internal/service/route53recoveryreadiness/recovery_group_test.go index 943ac94d4631..9a66acc677e9 100644 --- a/internal/service/route53recoveryreadiness/recovery_group_test.go +++ b/internal/service/route53recoveryreadiness/recovery_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" diff --git a/internal/service/route53recoveryreadiness/resource_set_test.go b/internal/service/route53recoveryreadiness/resource_set_test.go index 3ae2c192f4ff..f61b6c594f78 100644 --- a/internal/service/route53recoveryreadiness/resource_set_test.go +++ b/internal/service/route53recoveryreadiness/resource_set_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53recoveryreadiness "github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness" diff --git a/internal/service/route53resolver/config_test.go b/internal/service/route53resolver/config_test.go index ddba17938f02..9f188f367491 100644 --- a/internal/service/route53resolver/config_test.go +++ b/internal/service/route53resolver/config_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/route53resolver/dnssec_config_test.go b/internal/service/route53resolver/dnssec_config_test.go index a78c07343865..965a3624cbac 100644 --- a/internal/service/route53resolver/dnssec_config_test.go +++ b/internal/service/route53resolver/dnssec_config_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/endpoint_data_source_test.go b/internal/service/route53resolver/endpoint_data_source_test.go index 66de6112c3db..5d499c466977 100644 --- a/internal/service/route53resolver/endpoint_data_source_test.go +++ b/internal/service/route53resolver/endpoint_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/endpoint_test.go b/internal/service/route53resolver/endpoint_test.go index 17d650adfcdf..363c0247f3f6 100644 --- a/internal/service/route53resolver/endpoint_test.go +++ b/internal/service/route53resolver/endpoint_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_config_data_source_test.go b/internal/service/route53resolver/firewall_config_data_source_test.go index 59ed5b1d1b3f..ed1f109093f1 100644 --- a/internal/service/route53resolver/firewall_config_data_source_test.go +++ b/internal/service/route53resolver/firewall_config_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/firewall_config_test.go b/internal/service/route53resolver/firewall_config_test.go index 3d6c3f6c03ac..fb3fee2fdb57 100644 --- a/internal/service/route53resolver/firewall_config_test.go +++ b/internal/service/route53resolver/firewall_config_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_domain_list_data_source_test.go b/internal/service/route53resolver/firewall_domain_list_data_source_test.go index 7c9371366fb6..036134be7da0 100644 --- a/internal/service/route53resolver/firewall_domain_list_data_source_test.go +++ b/internal/service/route53resolver/firewall_domain_list_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/firewall_domain_list_test.go b/internal/service/route53resolver/firewall_domain_list_test.go index 22178b9e8be9..74fad716ff9a 100644 --- a/internal/service/route53resolver/firewall_domain_list_test.go +++ b/internal/service/route53resolver/firewall_domain_list_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_rule_group_association_data_source_test.go b/internal/service/route53resolver/firewall_rule_group_association_data_source_test.go index 985bfbfc4083..05eaf04b0430 100644 --- a/internal/service/route53resolver/firewall_rule_group_association_data_source_test.go +++ b/internal/service/route53resolver/firewall_rule_group_association_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/firewall_rule_group_association_test.go b/internal/service/route53resolver/firewall_rule_group_association_test.go index e609774ca086..531535f73bc4 100644 --- a/internal/service/route53resolver/firewall_rule_group_association_test.go +++ b/internal/service/route53resolver/firewall_rule_group_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_rule_group_data_source_test.go b/internal/service/route53resolver/firewall_rule_group_data_source_test.go index 3a901c49362a..6fced1334f43 100644 --- a/internal/service/route53resolver/firewall_rule_group_data_source_test.go +++ b/internal/service/route53resolver/firewall_rule_group_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/firewall_rule_group_test.go b/internal/service/route53resolver/firewall_rule_group_test.go index 7be8f64bd062..70caccb5303b 100644 --- a/internal/service/route53resolver/firewall_rule_group_test.go +++ b/internal/service/route53resolver/firewall_rule_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_rule_test.go b/internal/service/route53resolver/firewall_rule_test.go index 89af3559a09b..03826d77d359 100644 --- a/internal/service/route53resolver/firewall_rule_test.go +++ b/internal/service/route53resolver/firewall_rule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/firewall_rules_data_source_test.go b/internal/service/route53resolver/firewall_rules_data_source_test.go index 83a90ad00db4..04592518aafe 100644 --- a/internal/service/route53resolver/firewall_rules_data_source_test.go +++ b/internal/service/route53resolver/firewall_rules_data_source_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/query_log_config_association_test.go b/internal/service/route53resolver/query_log_config_association_test.go index f6d9595481ad..4f960ca6b4e6 100644 --- a/internal/service/route53resolver/query_log_config_association_test.go +++ b/internal/service/route53resolver/query_log_config_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/query_log_config_data_source_test.go b/internal/service/route53resolver/query_log_config_data_source_test.go index 6268548678c0..34727c0647a1 100644 --- a/internal/service/route53resolver/query_log_config_data_source_test.go +++ b/internal/service/route53resolver/query_log_config_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/query_log_config_test.go b/internal/service/route53resolver/query_log_config_test.go index 8e8f2e3798bd..e527e9d8b719 100644 --- a/internal/service/route53resolver/query_log_config_test.go +++ b/internal/service/route53resolver/query_log_config_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/rule_association_test.go b/internal/service/route53resolver/rule_association_test.go index 8ab792a77fee..567994a947ec 100644 --- a/internal/service/route53resolver/rule_association_test.go +++ b/internal/service/route53resolver/rule_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" diff --git a/internal/service/route53resolver/rule_data_source_test.go b/internal/service/route53resolver/rule_data_source_test.go index 0e87d0074923..bbd1954e41be 100644 --- a/internal/service/route53resolver/rule_data_source_test.go +++ b/internal/service/route53resolver/rule_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/rule_test.go b/internal/service/route53resolver/rule_test.go index 0102ed892bd1..78cb425ead90 100644 --- a/internal/service/route53resolver/rule_test.go +++ b/internal/service/route53resolver/rule_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfroute53resolver "github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver" diff --git a/internal/service/route53resolver/rules_data_source_test.go b/internal/service/route53resolver/rules_data_source_test.go index 083e12b244d5..8907f813f3f0 100644 --- a/internal/service/route53resolver/rules_data_source_test.go +++ b/internal/service/route53resolver/rules_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/route53resolver" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/route53resolver/sweep.go b/internal/service/route53resolver/sweep.go index d911e166d82a..f7495b610c1d 100644 --- a/internal/service/route53resolver/sweep.go +++ b/internal/service/route53resolver/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/route53resolver/validate_test.go b/internal/service/route53resolver/validate_test.go index edb8fdeb750a..5cd83bebe3b7 100644 --- a/internal/service/route53resolver/validate_test.go +++ b/internal/service/route53resolver/validate_test.go @@ -3,7 +3,7 @@ package route53resolver import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidResolverName(t *testing.T) { diff --git a/internal/service/rum/app_monitor_test.go b/internal/service/rum/app_monitor_test.go index 5a4dd1d6878f..9a3044ef1d18 100644 --- a/internal/service/rum/app_monitor_test.go +++ b/internal/service/rum/app_monitor_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchrum" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchrum "github.com/hashicorp/terraform-provider-aws/internal/service/rum" diff --git a/internal/service/rum/metrics_destination_test.go b/internal/service/rum/metrics_destination_test.go index d6c4628dfc15..e7b570add378 100644 --- a/internal/service/rum/metrics_destination_test.go +++ b/internal/service/rum/metrics_destination_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/cloudwatchrum" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudwatchrum "github.com/hashicorp/terraform-provider-aws/internal/service/rum" diff --git a/internal/service/rum/sweep.go b/internal/service/rum/sweep.go index bf8d890e934d..e1bf1635a906 100644 --- a/internal/service/rum/sweep.go +++ b/internal/service/rum/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchrum" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/s3/bucket_accelerate_configuration_test.go b/internal/service/s3/bucket_accelerate_configuration_test.go index 128ff6c0184e..e093f5ba290c 100644 --- a/internal/service/s3/bucket_accelerate_configuration_test.go +++ b/internal/service/s3/bucket_accelerate_configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_acl_test.go b/internal/service/s3/bucket_acl_test.go index 939a53fe3035..2d5e7137e1d1 100644 --- a/internal/service/s3/bucket_acl_test.go +++ b/internal/service/s3/bucket_acl_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_analytics_configuration_test.go b/internal/service/s3/bucket_analytics_configuration_test.go index 69e585810e8f..cfcc1757e190 100644 --- a/internal/service/s3/bucket_analytics_configuration_test.go +++ b/internal/service/s3/bucket_analytics_configuration_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_cors_configuration_test.go b/internal/service/s3/bucket_cors_configuration_test.go index 6c79177d7ce1..2d00e9f88610 100644 --- a/internal/service/s3/bucket_cors_configuration_test.go +++ b/internal/service/s3/bucket_cors_configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_data_source_test.go b/internal/service/s3/bucket_data_source_test.go index c830e7dd3ae0..7d17843412d2 100644 --- a/internal/service/s3/bucket_data_source_test.go +++ b/internal/service/s3/bucket_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" ) diff --git a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go index e873a11044fb..87460ea5d85a 100644 --- a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go +++ b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_inventory_test.go b/internal/service/s3/bucket_inventory_test.go index ba7697bd855f..506f6c84c985 100644 --- a/internal/service/s3/bucket_inventory_test.go +++ b/internal/service/s3/bucket_inventory_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_lifecycle_configuration_test.go b/internal/service/s3/bucket_lifecycle_configuration_test.go index f99952c30323..6527b5f3bc55 100644 --- a/internal/service/s3/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3/bucket_lifecycle_configuration_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_logging_test.go b/internal/service/s3/bucket_logging_test.go index d7275c11850f..e878344bacf0 100644 --- a/internal/service/s3/bucket_logging_test.go +++ b/internal/service/s3/bucket_logging_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_metric_test.go b/internal/service/s3/bucket_metric_test.go index 92d71610cef4..91ff5b5404a1 100644 --- a/internal/service/s3/bucket_metric_test.go +++ b/internal/service/s3/bucket_metric_test.go @@ -13,10 +13,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_notification_test.go b/internal/service/s3/bucket_notification_test.go index 461d2eda272f..6958d25c900c 100644 --- a/internal/service/s3/bucket_notification_test.go +++ b/internal/service/s3/bucket_notification_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/s3/bucket_object_data_source_test.go b/internal/service/s3/bucket_object_data_source_test.go index c814f0dafad6..1d3f3221a690 100644 --- a/internal/service/s3/bucket_object_data_source_test.go +++ b/internal/service/s3/bucket_object_data_source_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3/bucket_object_lock_configuration_test.go b/internal/service/s3/bucket_object_lock_configuration_test.go index 8d5ab003c4cd..ef0166762cff 100644 --- a/internal/service/s3/bucket_object_lock_configuration_test.go +++ b/internal/service/s3/bucket_object_lock_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_object_test.go b/internal/service/s3/bucket_object_test.go index 999f06e903e1..0d0b0fbca9fc 100644 --- a/internal/service/s3/bucket_object_test.go +++ b/internal/service/s3/bucket_object_test.go @@ -19,10 +19,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_objects_data_source_test.go b/internal/service/s3/bucket_objects_data_source_test.go index 430fe3e88926..f815abc2e3cf 100644 --- a/internal/service/s3/bucket_objects_data_source_test.go +++ b/internal/service/s3/bucket_objects_data_source_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3/bucket_ownership_controls_test.go b/internal/service/s3/bucket_ownership_controls_test.go index 5537ef66e9c7..a848e3bd17fc 100644 --- a/internal/service/s3/bucket_ownership_controls_test.go +++ b/internal/service/s3/bucket_ownership_controls_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_policy_data_source_test.go b/internal/service/s3/bucket_policy_data_source_test.go index 2f30da0634ac..5e21095d7c20 100644 --- a/internal/service/s3/bucket_policy_data_source_test.go +++ b/internal/service/s3/bucket_policy_data_source_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/s3" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_policy_test.go b/internal/service/s3/bucket_policy_test.go index 39d24631361e..454a194d28b3 100644 --- a/internal/service/s3/bucket_policy_test.go +++ b/internal/service/s3/bucket_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_public_access_block_test.go b/internal/service/s3/bucket_public_access_block_test.go index 4777726280be..8803af37b310 100644 --- a/internal/service/s3/bucket_public_access_block_test.go +++ b/internal/service/s3/bucket_public_access_block_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_replication_configuration_test.go b/internal/service/s3/bucket_replication_configuration_test.go index 7244edc603d8..2f631ee21498 100644 --- a/internal/service/s3/bucket_replication_configuration_test.go +++ b/internal/service/s3/bucket_replication_configuration_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_request_payment_configuration_test.go b/internal/service/s3/bucket_request_payment_configuration_test.go index 59bd1cd09f23..138f8c0e7a99 100644 --- a/internal/service/s3/bucket_request_payment_configuration_test.go +++ b/internal/service/s3/bucket_request_payment_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_server_side_encryption_configuration_test.go b/internal/service/s3/bucket_server_side_encryption_configuration_test.go index ea7ff6ac1c7c..46d1645461dc 100644 --- a/internal/service/s3/bucket_server_side_encryption_configuration_test.go +++ b/internal/service/s3/bucket_server_side_encryption_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_test.go b/internal/service/s3/bucket_test.go index bbbace5f3614..076b10bd9913 100644 --- a/internal/service/s3/bucket_test.go +++ b/internal/service/s3/bucket_test.go @@ -16,11 +16,11 @@ import ( "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfcloudformation "github.com/hashicorp/terraform-provider-aws/internal/service/cloudformation" diff --git a/internal/service/s3/bucket_versioning_test.go b/internal/service/s3/bucket_versioning_test.go index bde39f5311a8..66cffe32d64b 100644 --- a/internal/service/s3/bucket_versioning_test.go +++ b/internal/service/s3/bucket_versioning_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/bucket_website_configuration_test.go b/internal/service/s3/bucket_website_configuration_test.go index 0aa0fce21ff5..bf47e5d88940 100644 --- a/internal/service/s3/bucket_website_configuration_test.go +++ b/internal/service/s3/bucket_website_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/canonical_user_id_data_source_test.go b/internal/service/s3/canonical_user_id_data_source_test.go index ba2ed60474af..69b127735ab8 100644 --- a/internal/service/s3/canonical_user_id_data_source_test.go +++ b/internal/service/s3/canonical_user_id_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3/object_copy_test.go b/internal/service/s3/object_copy_test.go index 943cf3bfca25..7471ca6cbc24 100644 --- a/internal/service/s3/object_copy_test.go +++ b/internal/service/s3/object_copy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/object_data_source_test.go b/internal/service/s3/object_data_source_test.go index 2315c4b67777..b03d13a9d5bb 100644 --- a/internal/service/s3/object_data_source_test.go +++ b/internal/service/s3/object_data_source_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/s3/object_test.go b/internal/service/s3/object_test.go index 3594f51217ee..06eae5b7f404 100644 --- a/internal/service/s3/object_test.go +++ b/internal/service/s3/object_test.go @@ -15,10 +15,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" diff --git a/internal/service/s3/objects_data_source_test.go b/internal/service/s3/objects_data_source_test.go index 8d93915e85f9..28176b0a529e 100644 --- a/internal/service/s3/objects_data_source_test.go +++ b/internal/service/s3/objects_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3/sweep.go b/internal/service/s3/sweep.go index 577f203a15b2..a0ffb726a57b 100644 --- a/internal/service/s3/sweep.go +++ b/internal/service/s3/sweep.go @@ -17,7 +17,7 @@ import ( "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" diff --git a/internal/service/s3control/access_point_policy_test.go b/internal/service/s3control/access_point_policy_test.go index f3241337196a..7fd45a0e9c50 100644 --- a/internal/service/s3control/access_point_policy_test.go +++ b/internal/service/s3control/access_point_policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/access_point_test.go b/internal/service/s3control/access_point_test.go index 015705f92648..6f6f9220a828 100644 --- a/internal/service/s3control/access_point_test.go +++ b/internal/service/s3control/access_point_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/s3control" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/account_public_access_block_data_source_test.go b/internal/service/s3control/account_public_access_block_data_source_test.go index d73b23ae87d9..b80ee9598cfa 100644 --- a/internal/service/s3control/account_public_access_block_data_source_test.go +++ b/internal/service/s3control/account_public_access_block_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3control" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3control/account_public_access_block_test.go b/internal/service/s3control/account_public_access_block_test.go index 6dc2754fd7c1..ba9cbb771f55 100644 --- a/internal/service/s3control/account_public_access_block_test.go +++ b/internal/service/s3control/account_public_access_block_test.go @@ -7,8 +7,8 @@ import ( "time" "github.com/aws/aws-sdk-go/service/s3control" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/bucket_lifecycle_configuration_test.go b/internal/service/s3control/bucket_lifecycle_configuration_test.go index db458104c45e..fa94ca09d3e2 100644 --- a/internal/service/s3control/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3control/bucket_lifecycle_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/bucket_policy_test.go b/internal/service/s3control/bucket_policy_test.go index d84b6e3dd1cc..2490b41b9bde 100644 --- a/internal/service/s3control/bucket_policy_test.go +++ b/internal/service/s3control/bucket_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/bucket_test.go b/internal/service/s3control/bucket_test.go index 322afaf3b844..16fb36bc4456 100644 --- a/internal/service/s3control/bucket_test.go +++ b/internal/service/s3control/bucket_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/multi_region_access_point_data_source_test.go b/internal/service/s3control/multi_region_access_point_data_source_test.go index dc3316e2da85..07bf8da967e0 100644 --- a/internal/service/s3control/multi_region_access_point_data_source_test.go +++ b/internal/service/s3control/multi_region_access_point_data_source_test.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/s3control/multi_region_access_point_policy_test.go b/internal/service/s3control/multi_region_access_point_policy_test.go index 8bf3eaa1ff40..32d620eed2e7 100644 --- a/internal/service/s3control/multi_region_access_point_policy_test.go +++ b/internal/service/s3control/multi_region_access_point_policy_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/multi_region_access_point_test.go b/internal/service/s3control/multi_region_access_point_test.go index b67a08a95555..2f9116a99e7c 100644 --- a/internal/service/s3control/multi_region_access_point_test.go +++ b/internal/service/s3control/multi_region_access_point_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/object_lambda_access_point_policy_test.go b/internal/service/s3control/object_lambda_access_point_policy_test.go index 5863eb1c0711..70332ab2e9ea 100644 --- a/internal/service/s3control/object_lambda_access_point_policy_test.go +++ b/internal/service/s3control/object_lambda_access_point_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/object_lambda_access_point_test.go b/internal/service/s3control/object_lambda_access_point_test.go index e317b4966ab5..f383a63a6535 100644 --- a/internal/service/s3control/object_lambda_access_point_test.go +++ b/internal/service/s3control/object_lambda_access_point_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/storage_lens_configuration_test.go b/internal/service/s3control/storage_lens_configuration_test.go index 92bbf0742932..37c2d3cc08e7 100644 --- a/internal/service/s3control/storage_lens_configuration_test.go +++ b/internal/service/s3control/storage_lens_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3control" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3control "github.com/hashicorp/terraform-provider-aws/internal/service/s3control" diff --git a/internal/service/s3control/sweep.go b/internal/service/s3control/sweep.go index 19c0d638c0bf..1fb0a73d948b 100644 --- a/internal/service/s3control/sweep.go +++ b/internal/service/s3control/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/s3control" multierror "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/s3outposts/endpoint_test.go b/internal/service/s3outposts/endpoint_test.go index 8eda1e45aa5f..58e7c14c41be 100644 --- a/internal/service/s3outposts/endpoint_test.go +++ b/internal/service/s3outposts/endpoint_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/s3outposts" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfs3outposts "github.com/hashicorp/terraform-provider-aws/internal/service/s3outposts" diff --git a/internal/service/sagemaker/app_image_config_test.go b/internal/service/sagemaker/app_image_config_test.go index 12a77f434ee7..4c6e0ea0c3a2 100644 --- a/internal/service/sagemaker/app_image_config_test.go +++ b/internal/service/sagemaker/app_image_config_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/app_test.go b/internal/service/sagemaker/app_test.go index 379f8e7ef695..81ed27ff6577 100644 --- a/internal/service/sagemaker/app_test.go +++ b/internal/service/sagemaker/app_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/code_repository_test.go b/internal/service/sagemaker/code_repository_test.go index 6ef75b18fc89..28600ecb4345 100644 --- a/internal/service/sagemaker/code_repository_test.go +++ b/internal/service/sagemaker/code_repository_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/data_quality_job_definition_test.go b/internal/service/sagemaker/data_quality_job_definition_test.go index 7f2959376f89..8d6d166f8d52 100644 --- a/internal/service/sagemaker/data_quality_job_definition_test.go +++ b/internal/service/sagemaker/data_quality_job_definition_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/device_fleet_test.go b/internal/service/sagemaker/device_fleet_test.go index a39eb476d124..2bd07547f4e3 100644 --- a/internal/service/sagemaker/device_fleet_test.go +++ b/internal/service/sagemaker/device_fleet_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/device_test.go b/internal/service/sagemaker/device_test.go index cf4c8798a2e2..7b1ff45abfb6 100644 --- a/internal/service/sagemaker/device_test.go +++ b/internal/service/sagemaker/device_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/domain_test.go b/internal/service/sagemaker/domain_test.go index d4c0bb4cbed0..7366ccaa428b 100644 --- a/internal/service/sagemaker/domain_test.go +++ b/internal/service/sagemaker/domain_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/endpoint_configuration_test.go b/internal/service/sagemaker/endpoint_configuration_test.go index 3ad77f3fd1cc..b94cb1006365 100644 --- a/internal/service/sagemaker/endpoint_configuration_test.go +++ b/internal/service/sagemaker/endpoint_configuration_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/endpoint_test.go b/internal/service/sagemaker/endpoint_test.go index 92ad013b9411..0557c235134d 100644 --- a/internal/service/sagemaker/endpoint_test.go +++ b/internal/service/sagemaker/endpoint_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/feature_group_test.go b/internal/service/sagemaker/feature_group_test.go index aec0a603c7d0..17aac3529fd2 100644 --- a/internal/service/sagemaker/feature_group_test.go +++ b/internal/service/sagemaker/feature_group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/flow_definition_test.go b/internal/service/sagemaker/flow_definition_test.go index d477716924a1..6a8e88d9490b 100644 --- a/internal/service/sagemaker/flow_definition_test.go +++ b/internal/service/sagemaker/flow_definition_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/human_task_ui_test.go b/internal/service/sagemaker/human_task_ui_test.go index dac7be337299..473f349c24ca 100644 --- a/internal/service/sagemaker/human_task_ui_test.go +++ b/internal/service/sagemaker/human_task_ui_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/image_test.go b/internal/service/sagemaker/image_test.go index 6aeae6305256..c7c7ab0b6434 100644 --- a/internal/service/sagemaker/image_test.go +++ b/internal/service/sagemaker/image_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/image_version_test.go b/internal/service/sagemaker/image_version_test.go index 1750e3e30c70..3ca3752b70d5 100644 --- a/internal/service/sagemaker/image_version_test.go +++ b/internal/service/sagemaker/image_version_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/model_package_group_policy_test.go b/internal/service/sagemaker/model_package_group_policy_test.go index 7ce0d3d6c46a..9c645cfe0d5f 100644 --- a/internal/service/sagemaker/model_package_group_policy_test.go +++ b/internal/service/sagemaker/model_package_group_policy_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/model_package_group_test.go b/internal/service/sagemaker/model_package_group_test.go index 1b47aaece282..4b82913b64c5 100644 --- a/internal/service/sagemaker/model_package_group_test.go +++ b/internal/service/sagemaker/model_package_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/model_test.go b/internal/service/sagemaker/model_test.go index 3f8492567ffc..afcc3ccf0318 100644 --- a/internal/service/sagemaker/model_test.go +++ b/internal/service/sagemaker/model_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/monitoring_schedule_test.go b/internal/service/sagemaker/monitoring_schedule_test.go index 29c3e8dd19ac..a3f3dbe8e8ce 100644 --- a/internal/service/sagemaker/monitoring_schedule_test.go +++ b/internal/service/sagemaker/monitoring_schedule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go index 25e68c400290..2d6a02760b16 100644 --- a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go +++ b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/verify" diff --git a/internal/service/sagemaker/notebook_instance_test.go b/internal/service/sagemaker/notebook_instance_test.go index 5dd75f383cb3..2942a3370e58 100644 --- a/internal/service/sagemaker/notebook_instance_test.go +++ b/internal/service/sagemaker/notebook_instance_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go b/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go index 6556ecc771db..affc70d65b71 100644 --- a/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go +++ b/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" ) diff --git a/internal/service/sagemaker/project_test.go b/internal/service/sagemaker/project_test.go index 16725e81f81d..2f80918d8662 100644 --- a/internal/service/sagemaker/project_test.go +++ b/internal/service/sagemaker/project_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/sagemaker_test.go b/internal/service/sagemaker/sagemaker_test.go index a276cd554d4a..e385ad6313ce 100644 --- a/internal/service/sagemaker/sagemaker_test.go +++ b/internal/service/sagemaker/sagemaker_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sagemaker/servicecatalog_portfolio_status_test.go b/internal/service/sagemaker/servicecatalog_portfolio_status_test.go index 47349d8b0f41..80752ac8725c 100644 --- a/internal/service/sagemaker/servicecatalog_portfolio_status_test.go +++ b/internal/service/sagemaker/servicecatalog_portfolio_status_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/sagemaker/space_test.go b/internal/service/sagemaker/space_test.go index a955c96ca595..2fc180672994 100644 --- a/internal/service/sagemaker/space_test.go +++ b/internal/service/sagemaker/space_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/studio_lifecycle_config_test.go b/internal/service/sagemaker/studio_lifecycle_config_test.go index 147c68e06113..d6bbf53363f4 100644 --- a/internal/service/sagemaker/studio_lifecycle_config_test.go +++ b/internal/service/sagemaker/studio_lifecycle_config_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/sweep.go b/internal/service/sagemaker/sweep.go index e559a1648177..c2775fe17638 100644 --- a/internal/service/sagemaker/sweep.go +++ b/internal/service/sagemaker/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/sagemaker/user_profile_test.go b/internal/service/sagemaker/user_profile_test.go index 264456ab3b33..59d8090e0f84 100644 --- a/internal/service/sagemaker/user_profile_test.go +++ b/internal/service/sagemaker/user_profile_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/workforce_test.go b/internal/service/sagemaker/workforce_test.go index 9d6d07b019b7..fa889410afee 100644 --- a/internal/service/sagemaker/workforce_test.go +++ b/internal/service/sagemaker/workforce_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/sagemaker/workteam_test.go b/internal/service/sagemaker/workteam_test.go index 0d62a2e4bbb9..636dd08ef81d 100644 --- a/internal/service/sagemaker/workteam_test.go +++ b/internal/service/sagemaker/workteam_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sagemaker" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsagemaker "github.com/hashicorp/terraform-provider-aws/internal/service/sagemaker" diff --git a/internal/service/scheduler/schedule_group_test.go b/internal/service/scheduler/schedule_group_test.go index 209a330594e3..2fdf14c939c3 100644 --- a/internal/service/scheduler/schedule_group_test.go +++ b/internal/service/scheduler/schedule_group_test.go @@ -11,10 +11,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/aws/aws-sdk-go-v2/service/scheduler/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/scheduler/schedule_test.go b/internal/service/scheduler/schedule_test.go index f8ae6f1497da..895d4e8b8845 100644 --- a/internal/service/scheduler/schedule_test.go +++ b/internal/service/scheduler/schedule_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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/create" tfscheduler "github.com/hashicorp/terraform-provider-aws/internal/service/scheduler" diff --git a/internal/service/scheduler/sweep.go b/internal/service/scheduler/sweep.go index 8a10958db8f4..45adc7b88263 100644 --- a/internal/service/scheduler/sweep.go +++ b/internal/service/scheduler/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/schemas/discoverer_test.go b/internal/service/schemas/discoverer_test.go index 7d096e36aa61..e5527c7f813c 100644 --- a/internal/service/schemas/discoverer_test.go +++ b/internal/service/schemas/discoverer_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/schemas" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" diff --git a/internal/service/schemas/registry_policy_test.go b/internal/service/schemas/registry_policy_test.go index e3a437231601..5e93c9f9dfc4 100644 --- a/internal/service/schemas/registry_policy_test.go +++ b/internal/service/schemas/registry_policy_test.go @@ -7,10 +7,10 @@ import ( "github.com/aws/aws-sdk-go/service/schemas" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" diff --git a/internal/service/schemas/registry_test.go b/internal/service/schemas/registry_test.go index 2f8c9506d605..cfb020bf4f06 100644 --- a/internal/service/schemas/registry_test.go +++ b/internal/service/schemas/registry_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/schemas" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" diff --git a/internal/service/schemas/schema_test.go b/internal/service/schemas/schema_test.go index 0f3da5d63357..be60bb2e7207 100644 --- a/internal/service/schemas/schema_test.go +++ b/internal/service/schemas/schema_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/schemas" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfschemas "github.com/hashicorp/terraform-provider-aws/internal/service/schemas" diff --git a/internal/service/schemas/sweep.go b/internal/service/schemas/sweep.go index 335f8c5e1775..eabc58cf4894 100644 --- a/internal/service/schemas/sweep.go +++ b/internal/service/schemas/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/schemas" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/secretsmanager/random_password_data_source_test.go b/internal/service/secretsmanager/random_password_data_source_test.go index 3d0b3243f36c..697aa4e04979 100644 --- a/internal/service/secretsmanager/random_password_data_source_test.go +++ b/internal/service/secretsmanager/random_password_data_source_test.go @@ -6,8 +6,8 @@ import ( "unicode" "github.com/aws/aws-sdk-go/service/secretsmanager" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/secretsmanager/secret_data_source_test.go b/internal/service/secretsmanager/secret_data_source_test.go index 6b9f3e5fd45a..57032f126607 100644 --- a/internal/service/secretsmanager/secret_data_source_test.go +++ b/internal/service/secretsmanager/secret_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/secretsmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/secretsmanager/secret_policy_test.go b/internal/service/secretsmanager/secret_policy_test.go index 27fb9644ed53..59b9b2ce2bbf 100644 --- a/internal/service/secretsmanager/secret_policy_test.go +++ b/internal/service/secretsmanager/secret_policy_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" diff --git a/internal/service/secretsmanager/secret_rotation_data_source_test.go b/internal/service/secretsmanager/secret_rotation_data_source_test.go index 844dba8e1177..df232f370fbd 100644 --- a/internal/service/secretsmanager/secret_rotation_data_source_test.go +++ b/internal/service/secretsmanager/secret_rotation_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/secretsmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/secretsmanager/secret_rotation_test.go b/internal/service/secretsmanager/secret_rotation_test.go index 9a1fe9666ac3..aebf0eb250e6 100644 --- a/internal/service/secretsmanager/secret_rotation_test.go +++ b/internal/service/secretsmanager/secret_rotation_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/secretsmanager/secret_test.go b/internal/service/secretsmanager/secret_test.go index 0a611c207e49..d6842acebd67 100644 --- a/internal/service/secretsmanager/secret_test.go +++ b/internal/service/secretsmanager/secret_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/secretsmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" diff --git a/internal/service/secretsmanager/secret_version_data_source_test.go b/internal/service/secretsmanager/secret_version_data_source_test.go index a837725aa68e..0c7158cd5c46 100644 --- a/internal/service/secretsmanager/secret_version_data_source_test.go +++ b/internal/service/secretsmanager/secret_version_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/secretsmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/secretsmanager/secret_version_test.go b/internal/service/secretsmanager/secret_version_test.go index 6977b5423c8e..bb5165cde73b 100644 --- a/internal/service/secretsmanager/secret_version_test.go +++ b/internal/service/secretsmanager/secret_version_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsecretsmanager "github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager" diff --git a/internal/service/secretsmanager/secrets_data_source_test.go b/internal/service/secretsmanager/secrets_data_source_test.go index d6ad3802f095..41711a99032c 100644 --- a/internal/service/secretsmanager/secrets_data_source_test.go +++ b/internal/service/secretsmanager/secrets_data_source_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/secretsmanager" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/secretsmanager/sweep.go b/internal/service/secretsmanager/sweep.go index 7480f332a4db..ae5c87c28089 100644 --- a/internal/service/secretsmanager/sweep.go +++ b/internal/service/secretsmanager/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/secretsmanager/validate_test.go b/internal/service/secretsmanager/validate_test.go index 690c70e45783..777902fb37c7 100644 --- a/internal/service/secretsmanager/validate_test.go +++ b/internal/service/secretsmanager/validate_test.go @@ -3,7 +3,7 @@ package secretsmanager import ( "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" ) func TestValidSecretName(t *testing.T) { diff --git a/internal/service/securityhub/account_test.go b/internal/service/securityhub/account_test.go index 7bcd0997ccde..43147e84df62 100644 --- a/internal/service/securityhub/account_test.go +++ b/internal/service/securityhub/account_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/action_target_test.go b/internal/service/securityhub/action_target_test.go index 5350b9b725ac..986762d11346 100644 --- a/internal/service/securityhub/action_target_test.go +++ b/internal/service/securityhub/action_target_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/finding_aggregator_test.go b/internal/service/securityhub/finding_aggregator_test.go index 664a738d3052..33692e29fcba 100644 --- a/internal/service/securityhub/finding_aggregator_test.go +++ b/internal/service/securityhub/finding_aggregator_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/insight_test.go b/internal/service/securityhub/insight_test.go index ef0f541f165d..e013952614a2 100644 --- a/internal/service/securityhub/insight_test.go +++ b/internal/service/securityhub/insight_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/invite_accepter_test.go b/internal/service/securityhub/invite_accepter_test.go index 72079f399061..21881597a191 100644 --- a/internal/service/securityhub/invite_accepter_test.go +++ b/internal/service/securityhub/invite_accepter_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/securityhub/member_test.go b/internal/service/securityhub/member_test.go index 78022c5af364..ceba0bfbb6d7 100644 --- a/internal/service/securityhub/member_test.go +++ b/internal/service/securityhub/member_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/organization_admin_account_test.go b/internal/service/securityhub/organization_admin_account_test.go index 910f60885d6e..f5900a0b6492 100644 --- a/internal/service/securityhub/organization_admin_account_test.go +++ b/internal/service/securityhub/organization_admin_account_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/organization_configuration_test.go b/internal/service/securityhub/organization_configuration_test.go index ebe1d1f503b0..a3e98a77bf19 100644 --- a/internal/service/securityhub/organization_configuration_test.go +++ b/internal/service/securityhub/organization_configuration_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/securityhub/product_subscription_test.go b/internal/service/securityhub/product_subscription_test.go index 1d3bce9d63d4..908da3b937c8 100644 --- a/internal/service/securityhub/product_subscription_test.go +++ b/internal/service/securityhub/product_subscription_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/standards_control_test.go b/internal/service/securityhub/standards_control_test.go index 0fbb13824616..e174ac107532 100644 --- a/internal/service/securityhub/standards_control_test.go +++ b/internal/service/securityhub/standards_control_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/securityhub/standards_subscription_test.go b/internal/service/securityhub/standards_subscription_test.go index bb3915f6d8f6..0ef3d2478403 100644 --- a/internal/service/securityhub/standards_subscription_test.go +++ b/internal/service/securityhub/standards_subscription_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/securityhub" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfsecurityhub "github.com/hashicorp/terraform-provider-aws/internal/service/securityhub" diff --git a/internal/service/serverlessrepo/application_data_source_test.go b/internal/service/serverlessrepo/application_data_source_test.go index c4afe228fd1e..1edcd76fdc49 100644 --- a/internal/service/serverlessrepo/application_data_source_test.go +++ b/internal/service/serverlessrepo/application_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/serverlessrepo/cloudformation_stack_test.go b/internal/service/serverlessrepo/cloudformation_stack_test.go index bb826729b78f..d6a6e7fba2e5 100644 --- a/internal/service/serverlessrepo/cloudformation_stack_test.go +++ b/internal/service/serverlessrepo/cloudformation_stack_test.go @@ -13,9 +13,9 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" serverlessrepo "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfserverlessrepo "github.com/hashicorp/terraform-provider-aws/internal/service/serverlessrepo" diff --git a/internal/service/servicecatalog/budget_resource_association_test.go b/internal/service/servicecatalog/budget_resource_association_test.go index b9f5f17a4119..17beb53eabed 100644 --- a/internal/service/servicecatalog/budget_resource_association_test.go +++ b/internal/service/servicecatalog/budget_resource_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/constraint_data_source_test.go b/internal/service/servicecatalog/constraint_data_source_test.go index 94ca75d21646..cd49df32ed13 100644 --- a/internal/service/servicecatalog/constraint_data_source_test.go +++ b/internal/service/servicecatalog/constraint_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicecatalog/constraint_test.go b/internal/service/servicecatalog/constraint_test.go index 292a0c804fa1..548a59e6ae82 100644 --- a/internal/service/servicecatalog/constraint_test.go +++ b/internal/service/servicecatalog/constraint_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/launch_paths_data_source_test.go b/internal/service/servicecatalog/launch_paths_data_source_test.go index f26af5161049..2fa50be89957 100644 --- a/internal/service/servicecatalog/launch_paths_data_source_test.go +++ b/internal/service/servicecatalog/launch_paths_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicecatalog/organizations_access_test.go b/internal/service/servicecatalog/organizations_access_test.go index e07c5a736e07..e221b71efce8 100644 --- a/internal/service/servicecatalog/organizations_access_test.go +++ b/internal/service/servicecatalog/organizations_access_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go index f4924c5ba025..f836d59603ee 100644 --- a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go +++ b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicecatalog/portfolio_data_source_test.go b/internal/service/servicecatalog/portfolio_data_source_test.go index 651b8a9dfeae..4db3ec0d0d29 100644 --- a/internal/service/servicecatalog/portfolio_data_source_test.go +++ b/internal/service/servicecatalog/portfolio_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicecatalog/portfolio_share_test.go b/internal/service/servicecatalog/portfolio_share_test.go index 4543a5dc4770..93121ce3e19d 100644 --- a/internal/service/servicecatalog/portfolio_share_test.go +++ b/internal/service/servicecatalog/portfolio_share_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/portfolio_test.go b/internal/service/servicecatalog/portfolio_test.go index f4f6e4ff0c78..38d54a7ceb7c 100644 --- a/internal/service/servicecatalog/portfolio_test.go +++ b/internal/service/servicecatalog/portfolio_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/principal_portfolio_association_test.go b/internal/service/servicecatalog/principal_portfolio_association_test.go index 82a14ff2a122..a316e2477df0 100644 --- a/internal/service/servicecatalog/principal_portfolio_association_test.go +++ b/internal/service/servicecatalog/principal_portfolio_association_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/product_data_source_test.go b/internal/service/servicecatalog/product_data_source_test.go index 90e6d0bff28a..5cde16fc89b8 100644 --- a/internal/service/servicecatalog/product_data_source_test.go +++ b/internal/service/servicecatalog/product_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicecatalog/product_portfolio_association_test.go b/internal/service/servicecatalog/product_portfolio_association_test.go index 6012edaa4e5e..03d95266d8c4 100644 --- a/internal/service/servicecatalog/product_portfolio_association_test.go +++ b/internal/service/servicecatalog/product_portfolio_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/product_test.go b/internal/service/servicecatalog/product_test.go index 63fd4324099f..6082bca5014b 100644 --- a/internal/service/servicecatalog/product_test.go +++ b/internal/service/servicecatalog/product_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/provisioned_product_test.go b/internal/service/servicecatalog/provisioned_product_test.go index aa0fb287707c..8257866fe68a 100644 --- a/internal/service/servicecatalog/provisioned_product_test.go +++ b/internal/service/servicecatalog/provisioned_product_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/provisioning_artifact_test.go b/internal/service/servicecatalog/provisioning_artifact_test.go index fd2ceada3f03..f9a8c28728fb 100644 --- a/internal/service/servicecatalog/provisioning_artifact_test.go +++ b/internal/service/servicecatalog/provisioning_artifact_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go index 4fc1f4d42cce..d54a10cbf669 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" ) diff --git a/internal/service/servicecatalog/service_action_test.go b/internal/service/servicecatalog/service_action_test.go index 0f7cc3827c08..2cfb4899dc09 100644 --- a/internal/service/servicecatalog/service_action_test.go +++ b/internal/service/servicecatalog/service_action_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/sweep.go b/internal/service/servicecatalog/sweep.go index 6d12a7fa5284..2dad31b86897 100644 --- a/internal/service/servicecatalog/sweep.go +++ b/internal/service/servicecatalog/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/servicecatalog/tag_option_resource_association_test.go b/internal/service/servicecatalog/tag_option_resource_association_test.go index 0a76e10ea310..f92f10762c6b 100644 --- a/internal/service/servicecatalog/tag_option_resource_association_test.go +++ b/internal/service/servicecatalog/tag_option_resource_association_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicecatalog/tag_option_test.go b/internal/service/servicecatalog/tag_option_test.go index 873bb99fe02e..dab16c48a445 100644 --- a/internal/service/servicecatalog/tag_option_test.go +++ b/internal/service/servicecatalog/tag_option_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" diff --git a/internal/service/servicediscovery/dns_namespace_data_source_test.go b/internal/service/servicediscovery/dns_namespace_data_source_test.go index 0aafde6cd736..e68020179aee 100644 --- a/internal/service/servicediscovery/dns_namespace_data_source_test.go +++ b/internal/service/servicediscovery/dns_namespace_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicediscovery/http_namespace_data_source_test.go b/internal/service/servicediscovery/http_namespace_data_source_test.go index 3b0c5a7109cd..535adcde38cf 100644 --- a/internal/service/servicediscovery/http_namespace_data_source_test.go +++ b/internal/service/servicediscovery/http_namespace_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicediscovery/http_namespace_test.go b/internal/service/servicediscovery/http_namespace_test.go index a265823e1d20..b85dbb60d975 100644 --- a/internal/service/servicediscovery/http_namespace_test.go +++ b/internal/service/servicediscovery/http_namespace_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" diff --git a/internal/service/servicediscovery/instance_test.go b/internal/service/servicediscovery/instance_test.go index 14a1432f4e4d..2dd526db48f4 100644 --- a/internal/service/servicediscovery/instance_test.go +++ b/internal/service/servicediscovery/instance_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" diff --git a/internal/service/servicediscovery/private_dns_namespace_test.go b/internal/service/servicediscovery/private_dns_namespace_test.go index a9e1180d6dc6..556f3c89f728 100644 --- a/internal/service/servicediscovery/private_dns_namespace_test.go +++ b/internal/service/servicediscovery/private_dns_namespace_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" diff --git a/internal/service/servicediscovery/public_dns_namespace_test.go b/internal/service/servicediscovery/public_dns_namespace_test.go index c78c9632d841..2e73823cacf7 100644 --- a/internal/service/servicediscovery/public_dns_namespace_test.go +++ b/internal/service/servicediscovery/public_dns_namespace_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" diff --git a/internal/service/servicediscovery/service_data_source_test.go b/internal/service/servicediscovery/service_data_source_test.go index a99ea69ceeb9..caf7db6e4087 100644 --- a/internal/service/servicediscovery/service_data_source_test.go +++ b/internal/service/servicediscovery/service_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicediscovery/service_test.go b/internal/service/servicediscovery/service_test.go index c19607dc27ce..edda010ac1e2 100644 --- a/internal/service/servicediscovery/service_test.go +++ b/internal/service/servicediscovery/service_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicediscovery" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfservicediscovery "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" diff --git a/internal/service/servicediscovery/sweep.go b/internal/service/servicediscovery/sweep.go index 2ec97471f023..a55d08591c39 100644 --- a/internal/service/servicediscovery/sweep.go +++ b/internal/service/servicediscovery/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicediscovery" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/servicequotas/service_data_source_test.go b/internal/service/servicequotas/service_data_source_test.go index a780c39f475d..b43ae05719e1 100644 --- a/internal/service/servicequotas/service_data_source_test.go +++ b/internal/service/servicequotas/service_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicequotas" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicequotas/service_quota_data_source_test.go b/internal/service/servicequotas/service_quota_data_source_test.go index a101354353fe..f65d3d43344f 100644 --- a/internal/service/servicequotas/service_quota_data_source_test.go +++ b/internal/service/servicequotas/service_quota_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicequotas" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/servicequotas/service_quota_test.go b/internal/service/servicequotas/service_quota_test.go index e422d9b7f6ae..82418b119e3c 100644 --- a/internal/service/servicequotas/service_quota_test.go +++ b/internal/service/servicequotas/service_quota_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicequotas" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ses/active_receipt_rule_set_data_source_test.go b/internal/service/ses/active_receipt_rule_set_data_source_test.go index f0c3be31cdd8..36efdf265349 100644 --- a/internal/service/ses/active_receipt_rule_set_data_source_test.go +++ b/internal/service/ses/active_receipt_rule_set_data_source_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/ses/active_receipt_rule_set_test.go b/internal/service/ses/active_receipt_rule_set_test.go index 9fc6be6cf668..146e33eaa91d 100644 --- a/internal/service/ses/active_receipt_rule_set_test.go +++ b/internal/service/ses/active_receipt_rule_set_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/configuration_set_test.go b/internal/service/ses/configuration_set_test.go index 5ceb57ac18dd..dd0285c86245 100644 --- a/internal/service/ses/configuration_set_test.go +++ b/internal/service/ses/configuration_set_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/domain_dkim_test.go b/internal/service/ses/domain_dkim_test.go index b3dc5a290b14..a6b26dd38410 100644 --- a/internal/service/ses/domain_dkim_test.go +++ b/internal/service/ses/domain_dkim_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ses/domain_identity_data_source_test.go b/internal/service/ses/domain_identity_data_source_test.go index d431b762993b..4dce82141983 100644 --- a/internal/service/ses/domain_identity_data_source_test.go +++ b/internal/service/ses/domain_identity_data_source_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ses/domain_identity_test.go b/internal/service/ses/domain_identity_test.go index ae40a6e8012a..3ff3c23c352c 100644 --- a/internal/service/ses/domain_identity_test.go +++ b/internal/service/ses/domain_identity_test.go @@ -10,8 +10,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ses/domain_identity_verification_test.go b/internal/service/ses/domain_identity_verification_test.go index 4719ebd2a6a0..b712b7b64d55 100644 --- a/internal/service/ses/domain_identity_verification_test.go +++ b/internal/service/ses/domain_identity_verification_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/ses/domain_mail_from_test.go b/internal/service/ses/domain_mail_from_test.go index e80375f19b60..84e87afc7a85 100644 --- a/internal/service/ses/domain_mail_from_test.go +++ b/internal/service/ses/domain_mail_from_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ses/email_identity_data_dource_test.go b/internal/service/ses/email_identity_data_dource_test.go index ca99471c5707..dd6c73893146 100644 --- a/internal/service/ses/email_identity_data_dource_test.go +++ b/internal/service/ses/email_identity_data_dource_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ses/email_identity_test.go b/internal/service/ses/email_identity_test.go index 5ebe97b1f9f3..713812473881 100644 --- a/internal/service/ses/email_identity_test.go +++ b/internal/service/ses/email_identity_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/ses/event_destination_test.go b/internal/service/ses/event_destination_test.go index 722debf0912c..c574d408d33d 100644 --- a/internal/service/ses/event_destination_test.go +++ b/internal/service/ses/event_destination_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/identity_notification_topic_test.go b/internal/service/ses/identity_notification_topic_test.go index 98f67552e628..7a0d91694a93 100644 --- a/internal/service/ses/identity_notification_topic_test.go +++ b/internal/service/ses/identity_notification_topic_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/ses/identity_policy_test.go b/internal/service/ses/identity_policy_test.go index adbf4c62052e..73f9b5000834 100644 --- a/internal/service/ses/identity_policy_test.go +++ b/internal/service/ses/identity_policy_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/receipt_filter_test.go b/internal/service/ses/receipt_filter_test.go index bac62c1a3d1e..9a58358a21cd 100644 --- a/internal/service/ses/receipt_filter_test.go +++ b/internal/service/ses/receipt_filter_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/receipt_rule_set_test.go b/internal/service/ses/receipt_rule_set_test.go index b736b94305ca..e0014477e46a 100644 --- a/internal/service/ses/receipt_rule_set_test.go +++ b/internal/service/ses/receipt_rule_set_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/receipt_rule_test.go b/internal/service/ses/receipt_rule_test.go index 92cb47c7c6f7..9b72c2b006f3 100644 --- a/internal/service/ses/receipt_rule_test.go +++ b/internal/service/ses/receipt_rule_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/ses/sweep.go b/internal/service/ses/sweep.go index e12fc6848d11..c1857bee7396 100644 --- a/internal/service/ses/sweep.go +++ b/internal/service/ses/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/ses" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ses/template_test.go b/internal/service/ses/template_test.go index f6ef518725c5..c39e0142f024 100644 --- a/internal/service/ses/template_test.go +++ b/internal/service/ses/template_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ses" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfses "github.com/hashicorp/terraform-provider-aws/internal/service/ses" diff --git a/internal/service/sesv2/configuration_set_data_source_test.go b/internal/service/sesv2/configuration_set_data_source_test.go index e5c15614f6ac..7130bc4613c4 100644 --- a/internal/service/sesv2/configuration_set_data_source_test.go +++ b/internal/service/sesv2/configuration_set_data_source_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/sesv2/configuration_set_event_destination_test.go b/internal/service/sesv2/configuration_set_event_destination_test.go index c45620d1d765..7ba96ef3a64d 100644 --- a/internal/service/sesv2/configuration_set_event_destination_test.go +++ b/internal/service/sesv2/configuration_set_event_destination_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/configuration_set_test.go b/internal/service/sesv2/configuration_set_test.go index 64fa0c239af8..3442e72bc61f 100644 --- a/internal/service/sesv2/configuration_set_test.go +++ b/internal/service/sesv2/configuration_set_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/contact_list_test.go b/internal/service/sesv2/contact_list_test.go index 319e64a75d7c..e61ce4c305c0 100644 --- a/internal/service/sesv2/contact_list_test.go +++ b/internal/service/sesv2/contact_list_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/dedicated_ip_assignment_test.go b/internal/service/sesv2/dedicated_ip_assignment_test.go index bdb49ea42ca8..9bf24280cbe8 100644 --- a/internal/service/sesv2/dedicated_ip_assignment_test.go +++ b/internal/service/sesv2/dedicated_ip_assignment_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/dedicated_ip_pool_data_source_test.go b/internal/service/sesv2/dedicated_ip_pool_data_source_test.go index d4c3328958f7..e693dd0e67a6 100644 --- a/internal/service/sesv2/dedicated_ip_pool_data_source_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/sesv2/dedicated_ip_pool_test.go b/internal/service/sesv2/dedicated_ip_pool_test.go index 21f6bc61ffb4..48be91c567f7 100644 --- a/internal/service/sesv2/dedicated_ip_pool_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sesv2" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/email_identity_feedback_attributes_test.go b/internal/service/sesv2/email_identity_feedback_attributes_test.go index d5844612897a..3e2c88daa3c4 100644 --- a/internal/service/sesv2/email_identity_feedback_attributes_test.go +++ b/internal/service/sesv2/email_identity_feedback_attributes_test.go @@ -6,8 +6,8 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/email_identity_mail_from_attributes_test.go b/internal/service/sesv2/email_identity_mail_from_attributes_test.go index 7da345a9db31..12e3f8a4baf4 100644 --- a/internal/service/sesv2/email_identity_mail_from_attributes_test.go +++ b/internal/service/sesv2/email_identity_mail_from_attributes_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/email_identity_test.go b/internal/service/sesv2/email_identity_test.go index 5470b7b18ec2..9f8d1330bbfe 100644 --- a/internal/service/sesv2/email_identity_test.go +++ b/internal/service/sesv2/email_identity_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/sesv2/sweep.go b/internal/service/sesv2/sweep.go index 7a8bb57ee881..a8ebc040422d 100644 --- a/internal/service/sesv2/sweep.go +++ b/internal/service/sesv2/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sesv2" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/sfn/activity_data_source_test.go b/internal/service/sfn/activity_data_source_test.go index a04d83959610..2eac17b0d6ed 100644 --- a/internal/service/sfn/activity_data_source_test.go +++ b/internal/service/sfn/activity_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sfn" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sfn/activity_test.go b/internal/service/sfn/activity_test.go index 19a2635cca36..c2b06a92fba4 100644 --- a/internal/service/sfn/activity_test.go +++ b/internal/service/sfn/activity_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/aws/aws-sdk-go/service/sfn" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsfn "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" diff --git a/internal/service/sfn/state_machine_data_source_test.go b/internal/service/sfn/state_machine_data_source_test.go index 6252d8c95657..10f96b98510b 100644 --- a/internal/service/sfn/state_machine_data_source_test.go +++ b/internal/service/sfn/state_machine_data_source_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sfn" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sfn/state_machine_test.go b/internal/service/sfn/state_machine_test.go index b6a0fbb9fb20..c82ff8775d13 100644 --- a/internal/service/sfn/state_machine_test.go +++ b/internal/service/sfn/state_machine_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sfn" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsfn "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" diff --git a/internal/service/sfn/sweep.go b/internal/service/sfn/sweep.go index 809015894265..5ddad289458f 100644 --- a/internal/service/sfn/sweep.go +++ b/internal/service/sfn/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sfn" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/shield/protection_group_test.go b/internal/service/shield/protection_group_test.go index 6ffa9978fbcb..4621729feab4 100644 --- a/internal/service/shield/protection_group_test.go +++ b/internal/service/shield/protection_group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/shield" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" diff --git a/internal/service/shield/protection_health_check_association_test.go b/internal/service/shield/protection_health_check_association_test.go index e0eb3719d2cc..67404e88462a 100644 --- a/internal/service/shield/protection_health_check_association_test.go +++ b/internal/service/shield/protection_health_check_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/shield" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" diff --git a/internal/service/shield/protection_test.go b/internal/service/shield/protection_test.go index bbe2b4319575..390036949d6d 100644 --- a/internal/service/shield/protection_test.go +++ b/internal/service/shield/protection_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/shield" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfshield "github.com/hashicorp/terraform-provider-aws/internal/service/shield" diff --git a/internal/service/signer/signing_job_data_source_test.go b/internal/service/signer/signing_job_data_source_test.go index f539ddd00d8d..302d72843825 100644 --- a/internal/service/signer/signing_job_data_source_test.go +++ b/internal/service/signer/signing_job_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/signer/signing_job_test.go b/internal/service/signer/signing_job_test.go index 7d2fcc24bc12..b4c8eabde106 100644 --- a/internal/service/signer/signing_job_test.go +++ b/internal/service/signer/signing_job_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/signer/signing_profile_data_source_test.go b/internal/service/signer/signing_profile_data_source_test.go index cda223157489..9efabf2fdbd5 100644 --- a/internal/service/signer/signing_profile_data_source_test.go +++ b/internal/service/signer/signing_profile_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/signer/signing_profile_permission_test.go b/internal/service/signer/signing_profile_permission_test.go index bdfc0a42df3f..7c22b6dfec0d 100644 --- a/internal/service/signer/signing_profile_permission_test.go +++ b/internal/service/signer/signing_profile_permission_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/signer/signing_profile_test.go b/internal/service/signer/signing_profile_test.go index 3c5273069495..687a69d859d8 100644 --- a/internal/service/signer/signing_profile_test.go +++ b/internal/service/signer/signing_profile_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/signer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/simpledb/domain_test.go b/internal/service/simpledb/domain_test.go index 48eaf51cf754..50e3974c83fc 100644 --- a/internal/service/simpledb/domain_test.go +++ b/internal/service/simpledb/domain_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/simpledb" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsimpledb "github.com/hashicorp/terraform-provider-aws/internal/service/simpledb" diff --git a/internal/service/simpledb/sweep.go b/internal/service/simpledb/sweep.go index 88500463e92e..6f122d36b9a1 100644 --- a/internal/service/simpledb/sweep.go +++ b/internal/service/simpledb/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/simpledb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/sns/platform_application_test.go b/internal/service/sns/platform_application_test.go index 3e57f93c9daf..0d02d583df27 100644 --- a/internal/service/sns/platform_application_test.go +++ b/internal/service/sns/platform_application_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sns" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sns/sms_preferences_test.go b/internal/service/sns/sms_preferences_test.go index c76fa133e2a1..90fa95ad552b 100644 --- a/internal/service/sns/sms_preferences_test.go +++ b/internal/service/sns/sms_preferences_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sns" multierror "github.com/hashicorp/go-multierror" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sns/sweep.go b/internal/service/sns/sweep.go index ab69bd376202..79575928f7fe 100644 --- a/internal/service/sns/sweep.go +++ b/internal/service/sns/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sns" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/sns/topic_data_protection_policy_test.go b/internal/service/sns/topic_data_protection_policy_test.go index e9cdf3e94899..f784623a7edb 100644 --- a/internal/service/sns/topic_data_protection_policy_test.go +++ b/internal/service/sns/topic_data_protection_policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sns" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sns/topic_data_source_test.go b/internal/service/sns/topic_data_source_test.go index b00581c7abef..f2476b636c59 100644 --- a/internal/service/sns/topic_data_source_test.go +++ b/internal/service/sns/topic_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sns" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sns/topic_policy_test.go b/internal/service/sns/topic_policy_test.go index e4fc6d73a009..2ff9f153297a 100644 --- a/internal/service/sns/topic_policy_test.go +++ b/internal/service/sns/topic_policy_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sns" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sns/topic_subscription_test.go b/internal/service/sns/topic_subscription_test.go index df9d8c18b116..12751376b9b1 100644 --- a/internal/service/sns/topic_subscription_test.go +++ b/internal/service/sns/topic_subscription_test.go @@ -11,9 +11,9 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/sns" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sns/topic_test.go b/internal/service/sns/topic_test.go index ca1c7945ea0e..db1381d18567 100644 --- a/internal/service/sns/topic_test.go +++ b/internal/service/sns/topic_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/sns" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsns "github.com/hashicorp/terraform-provider-aws/internal/service/sns" diff --git a/internal/service/sqs/queue_data_source_test.go b/internal/service/sqs/queue_data_source_test.go index cfe58a4533e2..d87e800ec882 100644 --- a/internal/service/sqs/queue_data_source_test.go +++ b/internal/service/sqs/queue_data_source_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sqs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sqs/queue_policy_test.go b/internal/service/sqs/queue_policy_test.go index 8397b9b86db2..c6e3458b1bfd 100644 --- a/internal/service/sqs/queue_policy_test.go +++ b/internal/service/sqs/queue_policy_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sqs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfsqs "github.com/hashicorp/terraform-provider-aws/internal/service/sqs" ) diff --git a/internal/service/sqs/queue_redrive_allow_policy_test.go b/internal/service/sqs/queue_redrive_allow_policy_test.go index 9711b473b034..ffcc0014c908 100644 --- a/internal/service/sqs/queue_redrive_allow_policy_test.go +++ b/internal/service/sqs/queue_redrive_allow_policy_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sqs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfsqs "github.com/hashicorp/terraform-provider-aws/internal/service/sqs" ) diff --git a/internal/service/sqs/queue_redrive_policy_test.go b/internal/service/sqs/queue_redrive_policy_test.go index 100562cdf78e..b020037959e8 100644 --- a/internal/service/sqs/queue_redrive_policy_test.go +++ b/internal/service/sqs/queue_redrive_policy_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sqs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tfsqs "github.com/hashicorp/terraform-provider-aws/internal/service/sqs" ) diff --git a/internal/service/sqs/queue_test.go b/internal/service/sqs/queue_test.go index 784cc18bb1d0..7641b9d99ffe 100644 --- a/internal/service/sqs/queue_test.go +++ b/internal/service/sqs/queue_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/sqs" awspolicy "github.com/hashicorp/awspolicyequivalence" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsqs "github.com/hashicorp/terraform-provider-aws/internal/service/sqs" diff --git a/internal/service/sqs/queues_data_source_test.go b/internal/service/sqs/queues_data_source_test.go index 8fb7801af42f..da03ba8feb9e 100644 --- a/internal/service/sqs/queues_data_source_test.go +++ b/internal/service/sqs/queues_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sqs" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/sqs/sweep.go b/internal/service/sqs/sweep.go index a1e46dbb10a6..e4d3464a4cfc 100644 --- a/internal/service/sqs/sweep.go +++ b/internal/service/sqs/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sqs" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/ssm/activation_test.go b/internal/service/ssm/activation_test.go index 883de9b58a15..eea29df70b2e 100644 --- a/internal/service/ssm/activation_test.go +++ b/internal/service/ssm/activation_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/association_test.go b/internal/service/ssm/association_test.go index 66bb6b44aad4..ec9c412d19c0 100644 --- a/internal/service/ssm/association_test.go +++ b/internal/service/ssm/association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/default_patch_baseline_test.go b/internal/service/ssm/default_patch_baseline_test.go index 46d388f88ff4..6cc4cb2bd865 100644 --- a/internal/service/ssm/default_patch_baseline_test.go +++ b/internal/service/ssm/default_patch_baseline_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssm" "github.com/aws/aws-sdk-go-v2/service/ssm/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssm/document_data_source_test.go b/internal/service/ssm/document_data_source_test.go index 7a99b53d3689..87278c9c7aa8 100644 --- a/internal/service/ssm/document_data_source_test.go +++ b/internal/service/ssm/document_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/document_test.go b/internal/service/ssm/document_test.go index 63cc1585aa3c..b20fe5f6590b 100644 --- a/internal/service/ssm/document_test.go +++ b/internal/service/ssm/document_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/instances_data_source_test.go b/internal/service/ssm/instances_data_source_test.go index ae94a5241ee3..edd8912173e2 100644 --- a/internal/service/ssm/instances_data_source_test.go +++ b/internal/service/ssm/instances_data_source_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/maintenance_window_target_test.go b/internal/service/ssm/maintenance_window_target_test.go index f93a1ca34e2b..13a14678f942 100644 --- a/internal/service/ssm/maintenance_window_target_test.go +++ b/internal/service/ssm/maintenance_window_target_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/maintenance_window_task_test.go b/internal/service/ssm/maintenance_window_task_test.go index 00ceaf2d1b4b..6b6d5129c176 100644 --- a/internal/service/ssm/maintenance_window_task_test.go +++ b/internal/service/ssm/maintenance_window_task_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/maintenance_window_test.go b/internal/service/ssm/maintenance_window_test.go index ca9155f4b7fd..e13e4cc717ba 100644 --- a/internal/service/ssm/maintenance_window_test.go +++ b/internal/service/ssm/maintenance_window_test.go @@ -7,9 +7,9 @@ import ( "time" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/maintenance_windows_data_source_test.go b/internal/service/ssm/maintenance_windows_data_source_test.go index 42f3a2b9eefa..39d9028a06a1 100644 --- a/internal/service/ssm/maintenance_windows_data_source_test.go +++ b/internal/service/ssm/maintenance_windows_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/parameter_data_source_test.go b/internal/service/ssm/parameter_data_source_test.go index 4f91903064f5..d0c8abf8842b 100644 --- a/internal/service/ssm/parameter_data_source_test.go +++ b/internal/service/ssm/parameter_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/parameter_test.go b/internal/service/ssm/parameter_test.go index 25559e35fd6b..4eaeb5962c67 100644 --- a/internal/service/ssm/parameter_test.go +++ b/internal/service/ssm/parameter_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/parameters_by_path_data_source_test.go b/internal/service/ssm/parameters_by_path_data_source_test.go index 68600bdf40d1..ee043425e2aa 100644 --- a/internal/service/ssm/parameters_by_path_data_source_test.go +++ b/internal/service/ssm/parameters_by_path_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/patch_baseline_data_source_test.go b/internal/service/ssm/patch_baseline_data_source_test.go index 93229dde2568..9c852310f514 100644 --- a/internal/service/ssm/patch_baseline_data_source_test.go +++ b/internal/service/ssm/patch_baseline_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssm/patch_baseline_test.go b/internal/service/ssm/patch_baseline_test.go index 4ddc01343901..9e274b23ccf5 100644 --- a/internal/service/ssm/patch_baseline_test.go +++ b/internal/service/ssm/patch_baseline_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/patch_group_test.go b/internal/service/ssm/patch_group_test.go index 49a264987f12..dabe00c0e02e 100644 --- a/internal/service/ssm/patch_group_test.go +++ b/internal/service/ssm/patch_group_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/resource_data_sync_test.go b/internal/service/ssm/resource_data_sync_test.go index 2a6046aaab66..a6f124bd1424 100644 --- a/internal/service/ssm/resource_data_sync_test.go +++ b/internal/service/ssm/resource_data_sync_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssm" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssm "github.com/hashicorp/terraform-provider-aws/internal/service/ssm" diff --git a/internal/service/ssm/service_setting_test.go b/internal/service/ssm/service_setting_test.go index c1b241181f58..657ba774ae4c 100644 --- a/internal/service/ssm/service_setting_test.go +++ b/internal/service/ssm/service_setting_test.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssm/sweep.go b/internal/service/ssm/sweep.go index 9e412037edc8..116bad4ae034 100644 --- a/internal/service/ssm/sweep.go +++ b/internal/service/ssm/sweep.go @@ -15,7 +15,7 @@ import ( "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "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" diff --git a/internal/service/ssmcontacts/contact_channel_data_source_test.go b/internal/service/ssmcontacts/contact_channel_data_source_test.go index b450ccfa20e5..184a97689f1d 100644 --- a/internal/service/ssmcontacts/contact_channel_data_source_test.go +++ b/internal/service/ssmcontacts/contact_channel_data_source_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/ssmcontacts/contact_channel_test.go b/internal/service/ssmcontacts/contact_channel_test.go index 573ce0b6c6ce..70852596db46 100644 --- a/internal/service/ssmcontacts/contact_channel_test.go +++ b/internal/service/ssmcontacts/contact_channel_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssmcontacts/contact_data_source_test.go b/internal/service/ssmcontacts/contact_data_source_test.go index 13718aa14182..9f05d9e5fa9b 100644 --- a/internal/service/ssmcontacts/contact_data_source_test.go +++ b/internal/service/ssmcontacts/contact_data_source_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/ssmcontacts/contact_test.go b/internal/service/ssmcontacts/contact_test.go index 870cba4c7d1f..bfaa0eba520e 100644 --- a/internal/service/ssmcontacts/contact_test.go +++ b/internal/service/ssmcontacts/contact_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssmcontacts/plan_data_source_test.go b/internal/service/ssmcontacts/plan_data_source_test.go index 9155fcdf8d10..7935f33d2b36 100644 --- a/internal/service/ssmcontacts/plan_data_source_test.go +++ b/internal/service/ssmcontacts/plan_data_source_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/ssmcontacts/plan_test.go b/internal/service/ssmcontacts/plan_test.go index ab1368b1805c..c6d700ce6548 100644 --- a/internal/service/ssmcontacts/plan_test.go +++ b/internal/service/ssmcontacts/plan_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/aws-sdk-go-v2/service/ssmcontacts/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssmincidents/replication_set_data_source_test.go b/internal/service/ssmincidents/replication_set_data_source_test.go index e2bf37aab0d5..0b6a0129a7ab 100644 --- a/internal/service/ssmincidents/replication_set_data_source_test.go +++ b/internal/service/ssmincidents/replication_set_data_source_test.go @@ -6,7 +6,7 @@ import ( "regexp" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/ssmincidents/replication_set_test.go b/internal/service/ssmincidents/replication_set_test.go index 3ca4170cb701..892b30fd566f 100644 --- a/internal/service/ssmincidents/replication_set_test.go +++ b/internal/service/ssmincidents/replication_set_test.go @@ -8,9 +8,9 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssmincidents/response_plan_data_source_test.go b/internal/service/ssmincidents/response_plan_data_source_test.go index 81d16e38b80d..db9e868470e4 100644 --- a/internal/service/ssmincidents/response_plan_data_source_test.go +++ b/internal/service/ssmincidents/response_plan_data_source_test.go @@ -6,8 +6,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/ssmincidents/response_plan_test.go b/internal/service/ssmincidents/response_plan_test.go index f88fd7b7910f..09fa47e2ea31 100644 --- a/internal/service/ssmincidents/response_plan_test.go +++ b/internal/service/ssmincidents/response_plan_test.go @@ -6,9 +6,9 @@ import ( "fmt" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/ssoadmin/account_assignment_test.go b/internal/service/ssoadmin/account_assignment_test.go index ca3f807aa953..d9d08128f280 100644 --- a/internal/service/ssoadmin/account_assignment_test.go +++ b/internal/service/ssoadmin/account_assignment_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go index 16d081c73957..0c4aeb46e03c 100644 --- a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssoadmin" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/instance_access_control_attributes_test.go b/internal/service/ssoadmin/instance_access_control_attributes_test.go index a7b5de4d3c90..3db144aeed56 100644 --- a/internal/service/ssoadmin/instance_access_control_attributes_test.go +++ b/internal/service/ssoadmin/instance_access_control_attributes_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssoadmin" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/instances_data_source_test.go b/internal/service/ssoadmin/instances_data_source_test.go index c11eee8dfe9e..41eeec1112f6 100644 --- a/internal/service/ssoadmin/instances_data_source_test.go +++ b/internal/service/ssoadmin/instances_data_source_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssoadmin" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" ) diff --git a/internal/service/ssoadmin/managed_policy_attachment_test.go b/internal/service/ssoadmin/managed_policy_attachment_test.go index 3bf85535a423..e0054427c771 100644 --- a/internal/service/ssoadmin/managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/managed_policy_attachment_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/permission_set_data_source_test.go b/internal/service/ssoadmin/permission_set_data_source_test.go index 3dac59f9e278..21dfe85a192c 100644 --- a/internal/service/ssoadmin/permission_set_data_source_test.go +++ b/internal/service/ssoadmin/permission_set_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssoadmin" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/ssoadmin/permission_set_inline_policy_test.go b/internal/service/ssoadmin/permission_set_inline_policy_test.go index 0525238e1aef..31accf8a37d7 100644 --- a/internal/service/ssoadmin/permission_set_inline_policy_test.go +++ b/internal/service/ssoadmin/permission_set_inline_policy_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/permission_set_test.go b/internal/service/ssoadmin/permission_set_test.go index 96480bb670c5..f0ee2d41ac69 100644 --- a/internal/service/ssoadmin/permission_set_test.go +++ b/internal/service/ssoadmin/permission_set_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/permissions_boundary_attachment_test.go b/internal/service/ssoadmin/permissions_boundary_attachment_test.go index 8d810d407e9c..fec98eea2e86 100644 --- a/internal/service/ssoadmin/permissions_boundary_attachment_test.go +++ b/internal/service/ssoadmin/permissions_boundary_attachment_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/ssoadmin" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfssoadmin "github.com/hashicorp/terraform-provider-aws/internal/service/ssoadmin" diff --git a/internal/service/ssoadmin/sweep.go b/internal/service/ssoadmin/sweep.go index d1e49fe5c0f9..317674a695a5 100644 --- a/internal/service/ssoadmin/sweep.go +++ b/internal/service/ssoadmin/sweep.go @@ -11,8 +11,8 @@ import ( "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/storagegateway/cache_test.go b/internal/service/storagegateway/cache_test.go index b00b197d430e..60269ee3f522 100644 --- a/internal/service/storagegateway/cache_test.go +++ b/internal/service/storagegateway/cache_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/cached_iscsi_volume_test.go b/internal/service/storagegateway/cached_iscsi_volume_test.go index ad8ec0c1f461..271a1b45bdb3 100644 --- a/internal/service/storagegateway/cached_iscsi_volume_test.go +++ b/internal/service/storagegateway/cached_iscsi_volume_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/file_system_association_test.go b/internal/service/storagegateway/file_system_association_test.go index ea1dbaf63952..d0d35fe81ddb 100644 --- a/internal/service/storagegateway/file_system_association_test.go +++ b/internal/service/storagegateway/file_system_association_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tffsx "github.com/hashicorp/terraform-provider-aws/internal/service/fsx" diff --git a/internal/service/storagegateway/gateway_test.go b/internal/service/storagegateway/gateway_test.go index 02a9106e4258..f78f183140cb 100644 --- a/internal/service/storagegateway/gateway_test.go +++ b/internal/service/storagegateway/gateway_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/local_disk_data_source_test.go b/internal/service/storagegateway/local_disk_data_source_test.go index 0f47e308f2a9..af778ee07a66 100644 --- a/internal/service/storagegateway/local_disk_data_source_test.go +++ b/internal/service/storagegateway/local_disk_data_source_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/storagegateway/nfs_file_share_test.go b/internal/service/storagegateway/nfs_file_share_test.go index 00d301bdcfdd..f2bd908eaa6f 100644 --- a/internal/service/storagegateway/nfs_file_share_test.go +++ b/internal/service/storagegateway/nfs_file_share_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/smb_file_share_test.go b/internal/service/storagegateway/smb_file_share_test.go index 633353426d22..0c55f0908655 100644 --- a/internal/service/storagegateway/smb_file_share_test.go +++ b/internal/service/storagegateway/smb_file_share_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/stored_iscsi_volume_test.go b/internal/service/storagegateway/stored_iscsi_volume_test.go index 86122e5c2271..889c5568b73a 100644 --- a/internal/service/storagegateway/stored_iscsi_volume_test.go +++ b/internal/service/storagegateway/stored_iscsi_volume_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/sweep.go b/internal/service/storagegateway/sweep.go index 3f73bb5fa169..95335faec0f1 100644 --- a/internal/service/storagegateway/sweep.go +++ b/internal/service/storagegateway/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/storagegateway/tape_pool_test.go b/internal/service/storagegateway/tape_pool_test.go index 6160a08bab05..6deee3d1f5f0 100644 --- a/internal/service/storagegateway/tape_pool_test.go +++ b/internal/service/storagegateway/tape_pool_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/upload_buffer_test.go b/internal/service/storagegateway/upload_buffer_test.go index ed688049db66..763904081375 100644 --- a/internal/service/storagegateway/upload_buffer_test.go +++ b/internal/service/storagegateway/upload_buffer_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/storagegateway/working_storage_test.go b/internal/service/storagegateway/working_storage_test.go index d555b9a51123..6e7bc7e1ce10 100644 --- a/internal/service/storagegateway/working_storage_test.go +++ b/internal/service/storagegateway/working_storage_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfstoragegateway "github.com/hashicorp/terraform-provider-aws/internal/service/storagegateway" diff --git a/internal/service/sts/caller_identity_data_source_test.go b/internal/service/sts/caller_identity_data_source_test.go index c4bbf8adb336..df528cb74264 100644 --- a/internal/service/sts/caller_identity_data_source_test.go +++ b/internal/service/sts/caller_identity_data_source_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/sts" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/swf/domain_test.go b/internal/service/swf/domain_test.go index 7d8b223c42f4..8511d988e485 100644 --- a/internal/service/swf/domain_test.go +++ b/internal/service/swf/domain_test.go @@ -9,11 +9,11 @@ import ( "time" "github.com/aws/aws-sdk-go/service/swf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfswf "github.com/hashicorp/terraform-provider-aws/internal/service/swf" diff --git a/internal/service/swf/sweep.go b/internal/service/swf/sweep.go index 95b370dc350a..89c7fae094b8 100644 --- a/internal/service/swf/sweep.go +++ b/internal/service/swf/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/swf" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/synthetics/canary_test.go b/internal/service/synthetics/canary_test.go index 6903aa8ddffc..abc6ed2eae99 100644 --- a/internal/service/synthetics/canary_test.go +++ b/internal/service/synthetics/canary_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/synthetics" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" diff --git a/internal/service/synthetics/group_association_test.go b/internal/service/synthetics/group_association_test.go index 6c3883b35083..82e6f8ca30fc 100644 --- a/internal/service/synthetics/group_association_test.go +++ b/internal/service/synthetics/group_association_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/synthetics" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" diff --git a/internal/service/synthetics/group_test.go b/internal/service/synthetics/group_test.go index 51696200789f..d0d1dcc50a43 100644 --- a/internal/service/synthetics/group_test.go +++ b/internal/service/synthetics/group_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/synthetics" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfsynthetics "github.com/hashicorp/terraform-provider-aws/internal/service/synthetics" diff --git a/internal/service/synthetics/sweep.go b/internal/service/synthetics/sweep.go index 4b43fa0241ab..201672eac364 100644 --- a/internal/service/synthetics/sweep.go +++ b/internal/service/synthetics/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/synthetics" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/timestreamwrite/database_test.go b/internal/service/timestreamwrite/database_test.go index 6621d73965bd..662f987bbf61 100644 --- a/internal/service/timestreamwrite/database_test.go +++ b/internal/service/timestreamwrite/database_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/timestreamwrite" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftimestreamwrite "github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite" diff --git a/internal/service/timestreamwrite/sweep.go b/internal/service/timestreamwrite/sweep.go index 35f7558b47d5..44160c99c732 100644 --- a/internal/service/timestreamwrite/sweep.go +++ b/internal/service/timestreamwrite/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/timestreamwrite" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/timestreamwrite/table_test.go b/internal/service/timestreamwrite/table_test.go index 0bce77bfb414..4bdfae06485f 100644 --- a/internal/service/timestreamwrite/table_test.go +++ b/internal/service/timestreamwrite/table_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/timestreamwrite" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftimestreamwrite "github.com/hashicorp/terraform-provider-aws/internal/service/timestreamwrite" diff --git a/internal/service/transcribe/language_model_test.go b/internal/service/transcribe/language_model_test.go index 96c20862e5d8..17e0e11af8cb 100644 --- a/internal/service/transcribe/language_model_test.go +++ b/internal/service/transcribe/language_model_test.go @@ -7,9 +7,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" diff --git a/internal/service/transcribe/medical_vocabulary_test.go b/internal/service/transcribe/medical_vocabulary_test.go index 7ba69ce0ec23..80ab28eaa713 100644 --- a/internal/service/transcribe/medical_vocabulary_test.go +++ b/internal/service/transcribe/medical_vocabulary_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/transcribe" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftranscribe "github.com/hashicorp/terraform-provider-aws/internal/service/transcribe" diff --git a/internal/service/transcribe/sweep.go b/internal/service/transcribe/sweep.go index 95c96e404483..8479258824aa 100644 --- a/internal/service/transcribe/sweep.go +++ b/internal/service/transcribe/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/transcribe/vocabulary_filter_test.go b/internal/service/transcribe/vocabulary_filter_test.go index e8df4267e5f1..e686c64f9208 100644 --- a/internal/service/transcribe/vocabulary_filter_test.go +++ b/internal/service/transcribe/vocabulary_filter_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/transcribe" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/transcribe/vocabulary_test.go b/internal/service/transcribe/vocabulary_test.go index c709f9386c51..61c23877ce2d 100644 --- a/internal/service/transcribe/vocabulary_test.go +++ b/internal/service/transcribe/vocabulary_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/transcribe" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/transfer/access_test.go b/internal/service/transfer/access_test.go index 035db6a3d7c5..dadb23ba5ba5 100644 --- a/internal/service/transfer/access_test.go +++ b/internal/service/transfer/access_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/transfer/server_data_source_test.go b/internal/service/transfer/server_data_source_test.go index 77e207ca4ecf..ce4f094f8d06 100644 --- a/internal/service/transfer/server_data_source_test.go +++ b/internal/service/transfer/server_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 45263af40e03..f3bfe22eeb79 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/transfer/ssh_key_test.go b/internal/service/transfer/ssh_key_test.go index c0117f35a4e1..27760ef228bb 100644 --- a/internal/service/transfer/ssh_key_test.go +++ b/internal/service/transfer/ssh_key_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/transfer/sweep.go b/internal/service/transfer/sweep.go index 7957b76887ee..97ca70fb61af 100644 --- a/internal/service/transfer/sweep.go +++ b/internal/service/transfer/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/transfer/tag_gen_test.go b/internal/service/transfer/tag_gen_test.go index 9bc0f4e4ee7c..bb2abc5c74a0 100644 --- a/internal/service/transfer/tag_gen_test.go +++ b/internal/service/transfer/tag_gen_test.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/aws/aws-sdk-go/service/transfer" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/transfer/tag_test.go b/internal/service/transfer/tag_test.go index 9a575a826ac6..9bdf0336e56d 100644 --- a/internal/service/transfer/tag_test.go +++ b/internal/service/transfer/tag_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" ) diff --git a/internal/service/transfer/user_test.go b/internal/service/transfer/user_test.go index 1817c43e7d3e..79a48f5bf64b 100644 --- a/internal/service/transfer/user_test.go +++ b/internal/service/transfer/user_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index b0f108e91944..2c435bc945b4 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/transfer" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tftransfer "github.com/hashicorp/terraform-provider-aws/internal/service/transfer" diff --git a/internal/service/vpclattice/access_log_subscription_test.go b/internal/service/vpclattice/access_log_subscription_test.go index a7a71e22a7ad..16dfd7a9fd24 100644 --- a/internal/service/vpclattice/access_log_subscription_test.go +++ b/internal/service/vpclattice/access_log_subscription_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/auth_policy_data_source_test.go b/internal/service/vpclattice/auth_policy_data_source_test.go index 4a1008cb0a92..b38103eafb17 100644 --- a/internal/service/vpclattice/auth_policy_data_source_test.go +++ b/internal/service/vpclattice/auth_policy_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/vpclattice/auth_policy_test.go b/internal/service/vpclattice/auth_policy_test.go index 1ef5b906cb2d..957b24efd3bb 100644 --- a/internal/service/vpclattice/auth_policy_test.go +++ b/internal/service/vpclattice/auth_policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/listener_data_source_test.go b/internal/service/vpclattice/listener_data_source_test.go index 7ce8048e18dd..db76a7403934 100644 --- a/internal/service/vpclattice/listener_data_source_test.go +++ b/internal/service/vpclattice/listener_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/vpclattice/listener_rule_test.go b/internal/service/vpclattice/listener_rule_test.go index 6196f45851e1..6c137c604d42 100644 --- a/internal/service/vpclattice/listener_rule_test.go +++ b/internal/service/vpclattice/listener_rule_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/listener_test.go b/internal/service/vpclattice/listener_test.go index b98bd80663ca..6e4cc6263b63 100644 --- a/internal/service/vpclattice/listener_test.go +++ b/internal/service/vpclattice/listener_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/resource_policy_test.go b/internal/service/vpclattice/resource_policy_test.go index 5344d5e906f3..65f129ebe2c0 100644 --- a/internal/service/vpclattice/resource_policy_test.go +++ b/internal/service/vpclattice/resource_policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/service_data_source_test.go b/internal/service/vpclattice/service_data_source_test.go index b73511a84431..5963b1e3d001 100644 --- a/internal/service/vpclattice/service_data_source_test.go +++ b/internal/service/vpclattice/service_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/vpclattice" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/vpclattice/service_network_data_source_test.go b/internal/service/vpclattice/service_network_data_source_test.go index c4bd4dab4a01..ffbf96df29bd 100644 --- a/internal/service/vpclattice/service_network_data_source_test.go +++ b/internal/service/vpclattice/service_network_data_source_test.go @@ -5,8 +5,8 @@ import ( "regexp" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" ) diff --git a/internal/service/vpclattice/service_network_service_association_test.go b/internal/service/vpclattice/service_network_service_association_test.go index 27679e525969..d438d8fcd826 100644 --- a/internal/service/vpclattice/service_network_service_association_test.go +++ b/internal/service/vpclattice/service_network_service_association_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/service_network_test.go b/internal/service/vpclattice/service_network_test.go index ef3f04e87244..f8d4faebe7da 100644 --- a/internal/service/vpclattice/service_network_test.go +++ b/internal/service/vpclattice/service_network_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/service_network_vpc_association_test.go b/internal/service/vpclattice/service_network_vpc_association_test.go index 37ed860ebdd5..6565c04d53e5 100644 --- a/internal/service/vpclattice/service_network_vpc_association_test.go +++ b/internal/service/vpclattice/service_network_vpc_association_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/service_test.go b/internal/service/vpclattice/service_test.go index 6a72e4861665..a0c82cc99903 100644 --- a/internal/service/vpclattice/service_test.go +++ b/internal/service/vpclattice/service_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/vpclattice/sweep.go b/internal/service/vpclattice/sweep.go index 26dd7c3d929f..1227ed7a2050 100644 --- a/internal/service/vpclattice/sweep.go +++ b/internal/service/vpclattice/sweep.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/vpclattice/target_group_attachment_test.go b/internal/service/vpclattice/target_group_attachment_test.go index 537b56ee330a..924aff36ec40 100644 --- a/internal/service/vpclattice/target_group_attachment_test.go +++ b/internal/service/vpclattice/target_group_attachment_test.go @@ -6,9 +6,9 @@ import ( "strconv" "testing" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfvpclattice "github.com/hashicorp/terraform-provider-aws/internal/service/vpclattice" diff --git a/internal/service/vpclattice/target_group_test.go b/internal/service/vpclattice/target_group_test.go index 526b832534eb..9348409e5d16 100644 --- a/internal/service/vpclattice/target_group_test.go +++ b/internal/service/vpclattice/target_group_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/aws-sdk-go-v2/service/vpclattice/types" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/waf/byte_match_set_test.go b/internal/service/waf/byte_match_set_test.go index 1156c8d7d1ac..a165a427a1c0 100644 --- a/internal/service/waf/byte_match_set_test.go +++ b/internal/service/waf/byte_match_set_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/geo_match_set_test.go b/internal/service/waf/geo_match_set_test.go index a16b355b4711..631236249bba 100644 --- a/internal/service/waf/geo_match_set_test.go +++ b/internal/service/waf/geo_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/ipset_data_source_test.go b/internal/service/waf/ipset_data_source_test.go index 09f24363d9f1..1ec7fa5d1d85 100644 --- a/internal/service/waf/ipset_data_source_test.go +++ b/internal/service/waf/ipset_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/waf/ipset_test.go b/internal/service/waf/ipset_test.go index 05af3a39ad69..da4014c647b0 100644 --- a/internal/service/waf/ipset_test.go +++ b/internal/service/waf/ipset_test.go @@ -12,9 +12,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/rate_based_rule_data_source_test.go b/internal/service/waf/rate_based_rule_data_source_test.go index 158141c06bab..3d546ceeae39 100644 --- a/internal/service/waf/rate_based_rule_data_source_test.go +++ b/internal/service/waf/rate_based_rule_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/waf/rate_based_rule_test.go b/internal/service/waf/rate_based_rule_test.go index f7ef50b34dae..4e7702673b9c 100644 --- a/internal/service/waf/rate_based_rule_test.go +++ b/internal/service/waf/rate_based_rule_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/regex_match_set_test.go b/internal/service/waf/regex_match_set_test.go index a882d6441ae7..a140f7c91a36 100644 --- a/internal/service/waf/regex_match_set_test.go +++ b/internal/service/waf/regex_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/regex_pattern_set_test.go b/internal/service/waf/regex_pattern_set_test.go index 6e215fc19fa3..75d834488c94 100644 --- a/internal/service/waf/regex_pattern_set_test.go +++ b/internal/service/waf/regex_pattern_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/rule_data_source_test.go b/internal/service/waf/rule_data_source_test.go index 7591caf6bfbe..59a71a956f9a 100644 --- a/internal/service/waf/rule_data_source_test.go +++ b/internal/service/waf/rule_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/waf/rule_group_test.go b/internal/service/waf/rule_group_test.go index 162788ed1448..264207ec3c50 100644 --- a/internal/service/waf/rule_group_test.go +++ b/internal/service/waf/rule_group_test.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/rule_test.go b/internal/service/waf/rule_test.go index 88c9f8e7df3b..7fee26bcfbc8 100644 --- a/internal/service/waf/rule_test.go +++ b/internal/service/waf/rule_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/size_constraint_set_test.go b/internal/service/waf/size_constraint_set_test.go index 6b7a33b16bb4..a4c284135b73 100644 --- a/internal/service/waf/size_constraint_set_test.go +++ b/internal/service/waf/size_constraint_set_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/sql_injection_match_set_test.go b/internal/service/waf/sql_injection_match_set_test.go index ce5d288ebbf9..835d6fb77272 100644 --- a/internal/service/waf/sql_injection_match_set_test.go +++ b/internal/service/waf/sql_injection_match_set_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/subscribed_rule_group_test.go b/internal/service/waf/subscribed_rule_group_test.go index e157ef2f39fa..e7ba6af199cc 100644 --- a/internal/service/waf/subscribed_rule_group_test.go +++ b/internal/service/waf/subscribed_rule_group_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/waf/sweep.go b/internal/service/waf/sweep.go index efd8a2717a1a..017e6f01cb4f 100644 --- a/internal/service/waf/sweep.go +++ b/internal/service/waf/sweep.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/waf/web_acl_data_source_test.go b/internal/service/waf/web_acl_data_source_test.go index bdca4d6a75b6..4eb64848a5fc 100644 --- a/internal/service/waf/web_acl_data_source_test.go +++ b/internal/service/waf/web_acl_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/waf" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/waf/web_acl_test.go b/internal/service/waf/web_acl_test.go index 71649e4542f2..e4939af6e122 100644 --- a/internal/service/waf/web_acl_test.go +++ b/internal/service/waf/web_acl_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/waf/xss_match_set_test.go b/internal/service/waf/xss_match_set_test.go index 4e7d7f3105b2..6f6e6292738c 100644 --- a/internal/service/waf/xss_match_set_test.go +++ b/internal/service/waf/xss_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/wafregional/byte_match_set_test.go b/internal/service/wafregional/byte_match_set_test.go index 06dc0231556f..283a1bb5e1be 100644 --- a/internal/service/wafregional/byte_match_set_test.go +++ b/internal/service/wafregional/byte_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/geo_match_set_test.go b/internal/service/wafregional/geo_match_set_test.go index 3fa686328dea..373ccdcf18f0 100644 --- a/internal/service/wafregional/geo_match_set_test.go +++ b/internal/service/wafregional/geo_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/ipset_data_source_test.go b/internal/service/wafregional/ipset_data_source_test.go index c24d8723613c..0f393796d2f7 100644 --- a/internal/service/wafregional/ipset_data_source_test.go +++ b/internal/service/wafregional/ipset_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafregional" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafregional/ipset_test.go b/internal/service/wafregional/ipset_test.go index ab8a9fdc3b9c..5539eb1788d4 100644 --- a/internal/service/wafregional/ipset_test.go +++ b/internal/service/wafregional/ipset_test.go @@ -13,9 +13,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/rate_based_rule_data_source_test.go b/internal/service/wafregional/rate_based_rule_data_source_test.go index 0cad3c3b0fe0..5ae82b8ada7e 100644 --- a/internal/service/wafregional/rate_based_rule_data_source_test.go +++ b/internal/service/wafregional/rate_based_rule_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafregional" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafregional/rate_based_rule_test.go b/internal/service/wafregional/rate_based_rule_test.go index 84a33dbdc426..a1f9db6d7f4e 100644 --- a/internal/service/wafregional/rate_based_rule_test.go +++ b/internal/service/wafregional/rate_based_rule_test.go @@ -10,9 +10,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/regex_match_set_test.go b/internal/service/wafregional/regex_match_set_test.go index b2f0d952c71b..784f2aa3d9d3 100644 --- a/internal/service/wafregional/regex_match_set_test.go +++ b/internal/service/wafregional/regex_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" diff --git a/internal/service/wafregional/regex_pattern_set_test.go b/internal/service/wafregional/regex_pattern_set_test.go index 7840cdb192d2..aa0b76ffb820 100644 --- a/internal/service/wafregional/regex_pattern_set_test.go +++ b/internal/service/wafregional/regex_pattern_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/rule_data_source_test.go b/internal/service/wafregional/rule_data_source_test.go index 06751a3cb9a4..35f5868bcf9e 100644 --- a/internal/service/wafregional/rule_data_source_test.go +++ b/internal/service/wafregional/rule_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafregional" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafregional/rule_group_test.go b/internal/service/wafregional/rule_group_test.go index 7914c633d1d9..a66c77c45873 100644 --- a/internal/service/wafregional/rule_group_test.go +++ b/internal/service/wafregional/rule_group_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/rule_test.go b/internal/service/wafregional/rule_test.go index 9d7db3201365..09dea1d2d2e1 100644 --- a/internal/service/wafregional/rule_test.go +++ b/internal/service/wafregional/rule_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/size_constraint_set_test.go b/internal/service/wafregional/size_constraint_set_test.go index 2ed04b3d90e9..7d59455adc82 100644 --- a/internal/service/wafregional/size_constraint_set_test.go +++ b/internal/service/wafregional/size_constraint_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/sql_injection_match_set_test.go b/internal/service/wafregional/sql_injection_match_set_test.go index 70e8a7bccae2..2e88c41f9ce6 100644 --- a/internal/service/wafregional/sql_injection_match_set_test.go +++ b/internal/service/wafregional/sql_injection_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/subscribed_rule_group_test.go b/internal/service/wafregional/subscribed_rule_group_test.go index de1b796d1c1e..8b51e83fc10c 100644 --- a/internal/service/wafregional/subscribed_rule_group_test.go +++ b/internal/service/wafregional/subscribed_rule_group_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafregional" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafregional/sweep.go b/internal/service/wafregional/sweep.go index f6b0ef8c1403..36a3b91c2ad4 100644 --- a/internal/service/wafregional/sweep.go +++ b/internal/service/wafregional/sweep.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" tfwaf "github.com/hashicorp/terraform-provider-aws/internal/service/waf" "github.com/hashicorp/terraform-provider-aws/internal/sweep" diff --git a/internal/service/wafregional/web_acl_association_test.go b/internal/service/wafregional/web_acl_association_test.go index 0505c7388783..1dd582ffb139 100644 --- a/internal/service/wafregional/web_acl_association_test.go +++ b/internal/service/wafregional/web_acl_association_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/web_acl_data_source_test.go b/internal/service/wafregional/web_acl_data_source_test.go index ca2ca994b1f0..4da507873c32 100644 --- a/internal/service/wafregional/web_acl_data_source_test.go +++ b/internal/service/wafregional/web_acl_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafregional" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafregional/web_acl_test.go b/internal/service/wafregional/web_acl_test.go index e2cbffccd160..02f1d5ae2057 100644 --- a/internal/service/wafregional/web_acl_test.go +++ b/internal/service/wafregional/web_acl_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafregional/xss_match_set_test.go b/internal/service/wafregional/xss_match_set_test.go index 7361f677c95e..524aceba8fdd 100644 --- a/internal/service/wafregional/xss_match_set_test.go +++ b/internal/service/wafregional/xss_match_set_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafregional "github.com/hashicorp/terraform-provider-aws/internal/service/wafregional" diff --git a/internal/service/wafv2/ip_set_data_source_test.go b/internal/service/wafv2/ip_set_data_source_test.go index 3ba5089da83f..7bfdce319bd3 100644 --- a/internal/service/wafv2/ip_set_data_source_test.go +++ b/internal/service/wafv2/ip_set_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafv2/ip_set_test.go b/internal/service/wafv2/ip_set_test.go index 51b3c3edc76d..3c95da408b8e 100644 --- a/internal/service/wafv2/ip_set_test.go +++ b/internal/service/wafv2/ip_set_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" diff --git a/internal/service/wafv2/regex_pattern_set_data_source_test.go b/internal/service/wafv2/regex_pattern_set_data_source_test.go index 2762b995f48b..fbb067123e4d 100644 --- a/internal/service/wafv2/regex_pattern_set_data_source_test.go +++ b/internal/service/wafv2/regex_pattern_set_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafv2/regex_pattern_set_test.go b/internal/service/wafv2/regex_pattern_set_test.go index b7755ce89353..112c1e464893 100644 --- a/internal/service/wafv2/regex_pattern_set_test.go +++ b/internal/service/wafv2/regex_pattern_set_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" diff --git a/internal/service/wafv2/rule_group_data_source_test.go b/internal/service/wafv2/rule_group_data_source_test.go index 1e30eb1d91fa..34b23867be10 100644 --- a/internal/service/wafv2/rule_group_data_source_test.go +++ b/internal/service/wafv2/rule_group_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafv2/rule_group_test.go b/internal/service/wafv2/rule_group_test.go index c3a70c15dbe3..1fdd39f5d480 100644 --- a/internal/service/wafv2/rule_group_test.go +++ b/internal/service/wafv2/rule_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" diff --git a/internal/service/wafv2/sweep.go b/internal/service/wafv2/sweep.go index 68dbff59d369..a0a456ea9778 100644 --- a/internal/service/wafv2/sweep.go +++ b/internal/service/wafv2/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/wafv2/web_acl_association_test.go b/internal/service/wafv2/web_acl_association_test.go index 26de036c0803..ce081fdd17d1 100644 --- a/internal/service/wafv2/web_acl_association_test.go +++ b/internal/service/wafv2/web_acl_association_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/service/apigateway" diff --git a/internal/service/wafv2/web_acl_data_source_test.go b/internal/service/wafv2/web_acl_data_source_test.go index d3338d6e6ab7..c29785e75c8a 100644 --- a/internal/service/wafv2/web_acl_data_source_test.go +++ b/internal/service/wafv2/web_acl_data_source_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/wafv2/web_acl_logging_configuration_test.go b/internal/service/wafv2/web_acl_logging_configuration_test.go index 55fe40e9052f..0d78f653e0a9 100644 --- a/internal/service/wafv2/web_acl_logging_configuration_test.go +++ b/internal/service/wafv2/web_acl_logging_configuration_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" diff --git a/internal/service/wafv2/web_acl_test.go b/internal/service/wafv2/web_acl_test.go index 1ef946485e08..3b5725bcf084 100644 --- a/internal/service/wafv2/web_acl_test.go +++ b/internal/service/wafv2/web_acl_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfwafv2 "github.com/hashicorp/terraform-provider-aws/internal/service/wafv2" diff --git a/internal/service/worklink/fleet_test.go b/internal/service/worklink/fleet_test.go index d71aa4335ef9..6dcd049a6f40 100644 --- a/internal/service/worklink/fleet_test.go +++ b/internal/service/worklink/fleet_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/worklink" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfworklink "github.com/hashicorp/terraform-provider-aws/internal/service/worklink" diff --git a/internal/service/worklink/website_certificate_authority_association_test.go b/internal/service/worklink/website_certificate_authority_association_test.go index 943bfac01bbf..0a5890241f14 100644 --- a/internal/service/worklink/website_certificate_authority_association_test.go +++ b/internal/service/worklink/website_certificate_authority_association_test.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/worklink" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfworklink "github.com/hashicorp/terraform-provider-aws/internal/service/worklink" diff --git a/internal/service/workspaces/bundle_data_source_test.go b/internal/service/workspaces/bundle_data_source_test.go index 4b770c4a916d..e01fa3a40819 100644 --- a/internal/service/workspaces/bundle_data_source_test.go +++ b/internal/service/workspaces/bundle_data_source_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/workspaces" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/workspaces/directory_data_source_test.go b/internal/service/workspaces/directory_data_source_test.go index b33fa0f0d432..d12f7d6d19d8 100644 --- a/internal/service/workspaces/directory_data_source_test.go +++ b/internal/service/workspaces/directory_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/workspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/workspaces/directory_test.go b/internal/service/workspaces/directory_test.go index 3f6aeb4cff35..4612546a662d 100644 --- a/internal/service/workspaces/directory_test.go +++ b/internal/service/workspaces/directory_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" diff --git a/internal/service/workspaces/image_data_source_test.go b/internal/service/workspaces/image_data_source_test.go index 13490fb54b93..e80257e05aea 100644 --- a/internal/service/workspaces/image_data_source_test.go +++ b/internal/service/workspaces/image_data_source_test.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" ) diff --git a/internal/service/workspaces/ip_group_test.go b/internal/service/workspaces/ip_group_test.go index 70fed249d167..3548f3833302 100644 --- a/internal/service/workspaces/ip_group_test.go +++ b/internal/service/workspaces/ip_group_test.go @@ -8,9 +8,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" diff --git a/internal/service/workspaces/sweep.go b/internal/service/workspaces/sweep.go index e7af7f3cef90..133e771431fb 100644 --- a/internal/service/workspaces/sweep.go +++ b/internal/service/workspaces/sweep.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" "github.com/hashicorp/go-multierror" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/sweep" ) diff --git a/internal/service/workspaces/workspace_data_source_test.go b/internal/service/workspaces/workspace_data_source_test.go index 53829c664ca4..4a9b3078050f 100644 --- a/internal/service/workspaces/workspace_data_source_test.go +++ b/internal/service/workspaces/workspace_data_source_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/workspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/workspaces/workspace_test.go b/internal/service/workspaces/workspace_test.go index 2155a73001bf..b10db27409c9 100644 --- a/internal/service/workspaces/workspace_test.go +++ b/internal/service/workspaces/workspace_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfworkspaces "github.com/hashicorp/terraform-provider-aws/internal/service/workspaces" diff --git a/internal/service/xray/encryption_config_test.go b/internal/service/xray/encryption_config_test.go index 2a1704faa3b0..2205fd832737 100644 --- a/internal/service/xray/encryption_config_test.go +++ b/internal/service/xray/encryption_config_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/xray" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" ) diff --git a/internal/service/xray/group_test.go b/internal/service/xray/group_test.go index 0125758e912f..7c926b5386b8 100644 --- a/internal/service/xray/group_test.go +++ b/internal/service/xray/group_test.go @@ -9,9 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/xray" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfxray "github.com/hashicorp/terraform-provider-aws/internal/service/xray" diff --git a/internal/service/xray/sampling_rule_test.go b/internal/service/xray/sampling_rule_test.go index bbbd5265221c..efaa9e238d8a 100644 --- a/internal/service/xray/sampling_rule_test.go +++ b/internal/service/xray/sampling_rule_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/xray" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" tfxray "github.com/hashicorp/terraform-provider-aws/internal/service/xray" diff --git a/internal/sweep/sweep_test.go b/internal/sweep/sweep_test.go index 156a61796d02..ff46cd35a7a0 100644 --- a/internal/sweep/sweep_test.go +++ b/internal/sweep/sweep_test.go @@ -5,7 +5,7 @@ package sweep_test import ( "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" _ "github.com/hashicorp/terraform-provider-aws/internal/service/accessanalyzer" _ "github.com/hashicorp/terraform-provider-aws/internal/service/acm" _ "github.com/hashicorp/terraform-provider-aws/internal/service/acmpca" diff --git a/skaff/datasource/datasource.tmpl b/skaff/datasource/datasource.tmpl index ecde350dde9b..c7753d921f1c 100644 --- a/skaff/datasource/datasource.tmpl +++ b/skaff/datasource/datasource.tmpl @@ -58,7 +58,6 @@ import ( {{- end }} "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" diff --git a/skaff/datasource/datasourcetest.tmpl b/skaff/datasource/datasourcetest.tmpl index 30ceceeb9869..0c1034f7763a 100644 --- a/skaff/datasource/datasourcetest.tmpl +++ b/skaff/datasource/datasourcetest.tmpl @@ -52,10 +52,10 @@ import ( "github.com/aws/aws-sdk-go/service/{{ .ServicePackage }}" {{- end }} "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/skaff/resource/resourcetest.tmpl b/skaff/resource/resourcetest.tmpl index 824c47fb8b9e..7bddb046e936 100644 --- a/skaff/resource/resourcetest.tmpl +++ b/skaff/resource/resourcetest.tmpl @@ -53,10 +53,10 @@ import ( "github.com/aws/aws-sdk-go/service/{{ .ServicePackage }}" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" {{- end }} - sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" From 61b09eeca093cb20fc6bbd6212ee4139f86a5d1c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 10:38:44 -0400 Subject: [PATCH 250/304] Tweak CHANGELOG entry. --- .changelog/29555.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29555.txt b/.changelog/29555.txt index 8b20e915d784..6675db4b3009 100644 --- a/.changelog/29555.txt +++ b/.changelog/29555.txt @@ -1,2 +1,2 @@ ```release-note:note -resource/aws_eks_addon: The resolve_conflicts attribute is being deprecated in favour of separate resolve_conflicts_on_create and resolve_conflicts_on_update attributes +resource/aws_eks_addon: The `resolve_conflicts` argument has been deprecated. Use the `resolve_conflicts_on_create` and/or `resolve_conflicts_on_update` arguments instead From 99a04f65a430d6da23e7c5639dd0c3bbbca83650 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 10:59:01 -0400 Subject: [PATCH 251/304] r/aws_eks_addon: A bit of modernization. --- internal/service/eks/addon.go | 115 +++++++++++++---------------- internal/service/eks/addon_test.go | 2 +- 2 files changed, 51 insertions(+), 66 deletions(-) diff --git a/internal/service/eks/addon.go b/internal/service/eks/addon.go index 49a726ebfa5f..6679ec4c59c3 100644 --- a/internal/service/eks/addon.go +++ b/internal/service/eks/addon.go @@ -2,7 +2,6 @@ package eks import ( "context" - "fmt" "log" "regexp" "time" @@ -11,11 +10,11 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + sdkid "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "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" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -90,7 +89,7 @@ func ResourceAddon() *schema.Resource { Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice(eks.ResolveConflicts_Values(), false), - Deprecated: "The \"resolve_conflicts\" attribute can't be set to \"PRESERVE\" on initial resource creation. Use \"resolve_conflicts_on_create\" and \"resolve_conflicts_on_update\" instead", + Deprecated: `The "resolve_conflicts" attribute can't be set to "PRESERVE" on initial resource creation. Use "resolve_conflicts_on_create" and/or "resolve_conflicts_on_update" instead`, }, "resolve_conflicts_on_create": { Type: schema.TypeString, @@ -119,14 +118,15 @@ func ResourceAddon() *schema.Resource { } func resourceAddonCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EKSConn() addonName := d.Get("addon_name").(string) clusterName := d.Get("cluster_name").(string) - addonId := AddonCreateResourceID(clusterName, addonName) + id := AddonCreateResourceID(clusterName, addonName) input := &eks.CreateAddonInput{ AddonName: aws.String(addonName), - ClientRequestToken: aws.String(id.UniqueId()), + ClientRequestToken: aws.String(sdkid.UniqueId()), ClusterName: aws.String(clusterName), Tags: GetTagsIn(ctx), } @@ -135,53 +135,44 @@ func resourceAddonCreate(ctx context.Context, d *schema.ResourceData, meta inter input.AddonVersion = aws.String(v.(string)) } - if v, ok := d.GetOk("resolve_conflicts_on_create"); ok { - input.ResolveConflicts = aws.String(v.(string)) + if v, ok := d.GetOk("configuration_values"); ok { + input.ConfigurationValues = aws.String(v.(string)) } if v, ok := d.GetOk("resolve_conflicts"); ok { input.ResolveConflicts = aws.String(v.(string)) + } else if v, ok := d.GetOk("resolve_conflicts_on_create"); ok { + input.ResolveConflicts = aws.String(v.(string)) } if v, ok := d.GetOk("service_account_role_arn"); ok { input.ServiceAccountRoleArn = aws.String(v.(string)) } - if v, ok := d.GetOk("configuration_values"); ok { - input.ConfigurationValues = aws.String(v.(string)) - } - - err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError { - _, err := conn.CreateAddonWithContext(ctx, input) - - if tfawserr.ErrMessageContains(err, eks.ErrCodeInvalidParameterException, "CREATE_FAILED") { - return retry.RetryableError(err) - } - - if tfawserr.ErrMessageContains(err, eks.ErrCodeInvalidParameterException, "does not exist") { - return retry.RetryableError(err) - } - - if err != nil { - return retry.NonRetryableError(err) - } + _, err := tfresource.RetryWhen(ctx, propagationTimeout, + func() (interface{}, error) { + return conn.CreateAddonWithContext(ctx, input) + }, + func(err error) (bool, error) { + if tfawserr.ErrMessageContains(err, eks.ErrCodeInvalidParameterException, "CREATE_FAILED") { + return true, err + } - return nil - }) + if tfawserr.ErrMessageContains(err, eks.ErrCodeInvalidParameterException, "does not exist") { + return true, err + } - if tfresource.TimedOut(err) { - _, err = conn.CreateAddonWithContext(ctx, input) - } + return false, err + }, + ) if err != nil { - return diag.FromErr(fmt.Errorf("creating EKS Add-On (%s): %w", addonId, err)) + return sdkdiag.AppendErrorf(diags, "creating EKS Add-On (%s): %s", id, err) } - d.SetId(addonId) + d.SetId(id) - _, err = waitAddonCreated(ctx, conn, clusterName, addonName, d.Timeout(schema.TimeoutCreate)) - - if err != nil { + if _, err := waitAddonCreated(ctx, conn, clusterName, addonName, d.Timeout(schema.TimeoutCreate)); err != nil { // Creating addon w/o setting resolve_conflicts to "OVERWRITE" // might result in a failed creation, if unmanaged version of addon is already deployed // and there are configuration conflicts: @@ -191,20 +182,21 @@ func resourceAddonCreate(ctx context.Context, d *schema.ResourceData, meta inter // Re-creating like this will resolve the error, but it will also purge any // configurations that were applied by the user (that were conflicting). This might we an unwanted // side effect and should be left for the user to decide how to handle it. - return diag.FromErr(fmt.Errorf("unexpected EKS Add-On (%s) state returned during creation: %w\n[WARNING] Running terraform apply again will remove the kubernetes add-on and attempt to create it again effectively purging previous add-on configuration", - d.Id(), err)) + diags = sdkdiag.AppendErrorf(diags, "waiting for EKS Add-On (%s) create: %s", d.Id(), err) + return sdkdiag.AppendWarningf(diags, "Running terraform apply again will remove the kubernetes add-on and attempt to create it again effectively purging previous add-on configuration") } - return resourceAddonRead(ctx, d, meta) + return append(diags, resourceAddonRead(ctx, d, meta)...) } func resourceAddonRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EKSConn() clusterName, addonName, err := AddonParseResourceID(d.Id()) if err != nil { - return diag.FromErr(err) + return sdkdiag.AppendFromErr(diags, err) } addon, err := FindAddonByClusterNameAndAddonName(ctx, conn, clusterName, addonName) @@ -216,7 +208,7 @@ func resourceAddonRead(ctx context.Context, d *schema.ResourceData, meta interfa } if err != nil { - return diag.FromErr(fmt.Errorf("error reading EKS Add-On (%s): %w", d.Id(), err)) + return sdkdiag.AppendErrorf(diags, "reading EKS Add-On (%s): %s", d.Id(), err) } d.Set("addon_name", addon.AddonName) @@ -230,22 +222,23 @@ func resourceAddonRead(ctx context.Context, d *schema.ResourceData, meta interfa SetTagsOut(ctx, addon.Tags) - return nil + return diags } func resourceAddonUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EKSConn() clusterName, addonName, err := AddonParseResourceID(d.Id()) if err != nil { - return diag.FromErr(err) + return sdkdiag.AppendFromErr(diags, err) } if d.HasChanges("addon_version", "service_account_role_arn", "configuration_values") { input := &eks.UpdateAddonInput{ AddonName: aws.String(addonName), - ClientRequestToken: aws.String(id.UniqueId()), + ClientRequestToken: aws.String(sdkid.UniqueId()), ClusterName: aws.String(clusterName), } @@ -257,16 +250,13 @@ func resourceAddonUpdate(ctx context.Context, d *schema.ResourceData, meta inter input.ConfigurationValues = aws.String(d.Get("configuration_values").(string)) } - conflictResolutionAttr := "" - conflictResolution := "" + var conflictResolutionAttr, conflictResolution string if v, ok := d.GetOk("resolve_conflicts"); ok { conflictResolutionAttr = "resolve_conflicts" conflictResolution = v.(string) input.ResolveConflicts = aws.String(v.(string)) - } - - if v, ok := d.GetOk("resolve_conflicts_on_update"); ok { + } else if v, ok := d.GetOk("resolve_conflicts_on_update"); ok { conflictResolutionAttr = "resolve_conflicts_on_update" conflictResolution = v.(string) input.ResolveConflicts = aws.String(v.(string)) @@ -281,36 +271,33 @@ func resourceAddonUpdate(ctx context.Context, d *schema.ResourceData, meta inter output, err := conn.UpdateAddonWithContext(ctx, input) if err != nil { - return diag.FromErr(fmt.Errorf("error updating EKS Add-On (%s): %w", d.Id(), err)) + return sdkdiag.AppendErrorf(diags, "updating EKS Add-On (%s): %s", d.Id(), err) } updateID := aws.StringValue(output.Update.Id) - - _, err = waitAddonUpdateSuccessful(ctx, conn, clusterName, addonName, updateID, d.Timeout(schema.TimeoutUpdate)) - - if err != nil { + if _, err := waitAddonUpdateSuccessful(ctx, conn, clusterName, addonName, updateID, d.Timeout(schema.TimeoutUpdate)); err != nil { if conflictResolution != eks.ResolveConflictsOverwrite { // Changing addon version w/o setting resolve_conflicts to "OVERWRITE" // might result in a failed update if there are conflicts: // ConfigurationConflict Apply failed with 1 conflict: conflict with "kubectl"... - return diag.FromErr(fmt.Errorf("error waiting for EKS Add-On (%s) update (%s): %w, consider setting attribute %q to %q", - d.Id(), updateID, err, conflictResolutionAttr, eks.ResolveConflictsOverwrite)) + return sdkdiag.AppendErrorf(diags, "waiting for EKS Add-On (%s) update (%s): %s. Consider setting attribute %q to %q", d.Id(), updateID, err, conflictResolutionAttr, eks.ResolveConflictsOverwrite) } - return diag.FromErr(fmt.Errorf("error waiting for EKS Add-On (%s) update (%s): %w", d.Id(), updateID, err)) + return sdkdiag.AppendErrorf(diags, "waiting for EKS Add-On (%s) update (%s): %s", d.Id(), updateID, err) } } - return resourceAddonRead(ctx, d, meta) + return append(diags, resourceAddonRead(ctx, d, meta)...) } func resourceAddonDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EKSConn() clusterName, addonName, err := AddonParseResourceID(d.Id()) if err != nil { - return diag.FromErr(err) + return sdkdiag.AppendFromErr(diags, err) } input := &eks.DeleteAddonInput{ @@ -326,14 +313,12 @@ func resourceAddonDelete(ctx context.Context, d *schema.ResourceData, meta inter _, err = conn.DeleteAddonWithContext(ctx, input) if err != nil { - return diag.FromErr(fmt.Errorf("error deleting EKS Add-On (%s): %w", d.Id(), err)) + return sdkdiag.AppendErrorf(diags, "deleting EKS Add-On (%s): %s", d.Id(), err) } - _, err = waitAddonDeleted(ctx, conn, clusterName, addonName, d.Timeout(schema.TimeoutDelete)) - - if err != nil { - return diag.FromErr(fmt.Errorf("error waiting for EKS Add-On (%s) to delete: %w", d.Id(), err)) + if _, err := waitAddonDeleted(ctx, conn, clusterName, addonName, d.Timeout(schema.TimeoutDelete)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for EKS Add-On (%s) delete: %s", d.Id(), err) } - return nil + return diags } diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index a0c881d5cdde..2da774830402 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -181,7 +181,7 @@ func TestAccEKSAddon_deprecated(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckAddon(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckAddon(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), From f4192840e77878380951c769aae153af6d8c5de6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 11:06:42 -0400 Subject: [PATCH 252/304] Fix markdown-lint 'MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below]'. --- website/docs/r/eks_addon.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/eks_addon.html.markdown b/website/docs/r/eks_addon.html.markdown index 42eda17af355..dd7d66e995ef 100644 --- a/website/docs/r/eks_addon.html.markdown +++ b/website/docs/r/eks_addon.html.markdown @@ -25,6 +25,7 @@ resource "aws_eks_addon" "example" { ``` ## Example Update add-on usage with resolve_conflicts_on_update and PRESERVE + `resolve_conflicts_on_update` with `PRESERVE` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. ```terraform From f45ccb9ae16d2c2bdd00b3e6e0ff0fe4dbd65295 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 12:57:39 -0400 Subject: [PATCH 253/304] r/aws_eks_addon: Update versions used in acceptance test configurations. --- internal/service/eks/addon_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 2da774830402..fa3fba9e3396 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -110,8 +110,8 @@ func TestAccEKSAddon_addonVersion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_eks_addon.test" addonName := "vpc-cni" - addonVersion1 := "v1.8.0-eksbuild.1" - addonVersion2 := "v1.9.0-eksbuild.1" + addonVersion1 := "v1.12.5-eksbuild.2" + addonVersion2 := "v1.12.6-eksbuild.1" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckAddon(ctx, t) }, @@ -304,7 +304,7 @@ func TestAccEKSAddon_configurationValues(t *testing.T) { emptyConfigurationValues := "{}" invalidConfigurationValues := "{\"env\": {\"INVALID_FIELD\":\"2\"}}" addonName := "vpc-cni" - addonVersion := "v1.10.4-eksbuild.1" + addonVersion := "v1.12.6-eksbuild.1" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckAddon(ctx, t) }, From 1ceed6dc19239f81a84cc6588962c5eaf773c181 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 13:31:13 -0400 Subject: [PATCH 254/304] Apply v4.66.1 transparent tagging changes to 'tagsUpdateFunc' and 'tagsReadFunc'. --- internal/provider/tags_interceptor.go | 82 ++++++++++++++------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/internal/provider/tags_interceptor.go b/internal/provider/tags_interceptor.go index 83de6c05cc3c..896d77e23f02 100644 --- a/internal/provider/tags_interceptor.go +++ b/internal/provider/tags_interceptor.go @@ -4,14 +4,13 @@ import ( "context" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" - "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/types" - "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -26,6 +25,19 @@ func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServiceP return ctx, diags } + var identifier string + if identifierAttribute := spt.IdentifierAttribute; identifierAttribute == "id" { + identifier = d.Id() + } else { + identifier = d.Get(identifierAttribute).(string) + } + + // Some old resources may not have the required attribute set after Read: + // https://github.com/hashicorp/terraform-provider-aws/issues/31180 + if identifier == "" { + return ctx, diags + } + configTags := make(map[string]string) if config := d.GetRawConfig(); !config.IsNull() && config.IsKnown() { c := config.GetAttr(names.AttrTags) @@ -54,12 +66,6 @@ func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServiceP toAdd := configAll.Difference(tagsAll) toRemove := tagsAll.Difference(configAll) - var identifier string - if identifierAttribute := spt.IdentifierAttribute; identifierAttribute == "id" { - identifier = d.Id() - } else { - identifier = d.Get(identifierAttribute).(string) - } // If the service package has a generic resource update tags methods, call it. var err error @@ -73,13 +79,8 @@ func tagsUpdateFunc(ctx context.Context, d schemaResourceData, sp conns.ServiceP err = v.UpdateTags(ctx, meta, identifier, spt.ResourceType, toRemove, toAdd) } - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed updating tags for resource", map[string]interface{}{ - spt.IdentifierAttribute: identifier, - "error": err.Error(), - }) - + // ISO partitions may not support tagging, giving error. + if errs.IsUnsupportedOperationInPartitionError(meta.(*conns.AWSClient).Partition, err) { return ctx, diags } @@ -107,35 +108,36 @@ func tagsReadFunc(ctx context.Context, d schemaResourceData, sp conns.ServicePac identifier = d.Get(identifierAttribute).(string) } - var err error - if v, ok := sp.(interface { - ListTags(context.Context, any, string) error - }); ok { - err = v.ListTags(ctx, meta, identifier) // Sets tags in Context - } else if v, ok := sp.(interface { - ListTags(context.Context, any, string, string) error - }); ok && spt.ResourceType != "" { - err = v.ListTags(ctx, meta, identifier, spt.ResourceType) // Sets tags in Context - } + // Some old resources may not have the required attribute set after Read: + // https://github.com/hashicorp/terraform-provider-aws/issues/31180 + if identifier != "" { + var err error - if verify.ErrorISOUnsupported(meta.(*conns.AWSClient).Partition, err) { - // ISO partitions may not support tagging, giving error - tflog.Warn(ctx, "failed listing tags for resource", map[string]interface{}{ - spt.IdentifierAttribute: d.Id(), - "error": err.Error(), - }) - return ctx, diags - } + if v, ok := sp.(interface { + ListTags(context.Context, any, string) error + }); ok { + err = v.ListTags(ctx, meta, identifier) // Sets tags in Context + } else if v, ok := sp.(interface { + ListTags(context.Context, any, string, string) error + }); ok && spt.ResourceType != "" { + err = v.ListTags(ctx, meta, identifier, spt.ResourceType) // Sets tags in Context + } - if inContext.ServicePackageName == names.DynamoDB && err != nil { - // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. - if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { - err = nil + // ISO partitions may not support tagging, giving error. + if errs.IsUnsupportedOperationInPartitionError(meta.(*conns.AWSClient).Partition, err) { + return ctx, diags } - } - if err != nil { - return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + if inContext.ServicePackageName == names.DynamoDB && err != nil { + // When a DynamoDB Table is `ARCHIVED`, ListTags returns `ResourceNotFoundException`. + if tfresource.NotFound(err) || tfawserr.ErrMessageContains(err, "UnknownOperationException", "Tagging is not currently supported in DynamoDB Local.") { + err = nil + } + } + + if err != nil { + return ctx, sdkdiag.AppendErrorf(diags, "listing tags for %s %s (%s): %s", serviceName, resourceName, identifier, err) + } } // Remove any provider configured ignore_tags and system tags from those returned from the service API. From c70256cb32c7ba53626c3474e6ee190fd6a0e5f3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 13:33:54 -0400 Subject: [PATCH 255/304] Remove 'TestAccEKSAddon_DefaultTagsProviderAndResource_duplicateTag'. --- internal/service/eks/addon_test.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index fa3fba9e3396..f50344472c3f 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -669,29 +669,6 @@ func TestAccEKSAddon_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) }) } -func TestAccEKSAddon_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { - ctx := acctest.Context(t) - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: nil, - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), - testAccAddonConfig_tags1(rName, addonName, "overlapkey", "overlapvalue"), - ), - PlanOnly: true, - ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), - }, - }, - }) -} - func TestAccEKSAddon_defaultAndIgnoreTags(t *testing.T) { ctx := acctest.Context(t) var addon eks.Addon From 81700eaee3340bf9c8342fc0db17bfd2dfe7cba3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 13:36:45 -0400 Subject: [PATCH 256/304] Remove 'TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag'. --- internal/service/ec2/vpc_subnet_test.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/internal/service/ec2/vpc_subnet_test.go b/internal/service/ec2/vpc_subnet_test.go index 596d0e2100d0..f44723645b3a 100644 --- a/internal/service/ec2/vpc_subnet_test.go +++ b/internal/service/ec2/vpc_subnet_test.go @@ -375,28 +375,6 @@ func TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag(t *testing.T }) } -func TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { - ctx := acctest.Context(t) - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: nil, - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), - testAccVPCSubnetConfig_tags1(rName, "overlapkey", "overlapvalue"), - ), - PlanOnly: true, - ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), - }, - }, - }) -} - func TestAccVPCSubnet_defaultAndIgnoreTags(t *testing.T) { ctx := acctest.Context(t) var subnet ec2.Subnet From 09996686dea84ea3b4c07b5c2ddb465c79291a08 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 9 May 2023 13:40:36 -0400 Subject: [PATCH 257/304] r/aws_eks_addon: 'default_tags' and 'ignore_tags' test aren't necessary. --- internal/service/eks/addon_test.go | 353 ----------------------------- 1 file changed, 353 deletions(-) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index f50344472c3f..5edc28eb573f 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -394,359 +394,6 @@ func TestAccEKSAddon_tags(t *testing.T) { }) } -func TestAccEKSAddon_DefaultTags_providerOnly(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccAddonConfig_basic(rName, addonName), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), - testAccAddonConfig_basic(rName, addonName), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), - ), - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "value1"), - testAccAddonConfig_basic(rName, addonName), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "value1"), - ), - }, - }, - }) -} - -func TestAccEKSAddon_DefaultTags_updateToProviderOnly(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAddonConfig_basic(rName, addonName), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccEKSAddon_DefaultTags_updateToResourceOnly(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAddonConfig_basic(rName, addonName), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - Config: testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccEKSAddon_DefaultTagsProviderAndResource_nonOverlappingTag(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccAddonConfig_tags1(rName, addonName, "resourcekey1", "resourcevalue1"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccAddonConfig_tags2(rName, addonName, "resourcekey1", "resourcevalue1", "resourcekey2", "resourcevalue2"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey2", "resourcevalue2"), - ), - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey2", "providervalue2"), - testAccAddonConfig_tags1(rName, addonName, "resourcekey3", "resourcevalue3"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey3", "resourcevalue3"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey3", "resourcevalue3"), - ), - }, - }, - }) -} - -func TestAccEKSAddon_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccAddonConfig_tags1(rName, addonName, "overlapkey1", "resourcevalue1"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccAddonConfig_tags2(rName, addonName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey2", "resourcevalue2"), - ), - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccAddonConfig_tags1(rName, addonName, "overlapkey1", "resourcevalue2"), - ), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue2"), - ), - }, - }, - }) -} - -func TestAccEKSAddon_defaultAndIgnoreTags(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - testAccCheckAddonUpdateTags(ctx, &addon, nil, map[string]string{"defaultkey1": "defaultvalue1"}), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultAndIgnoreTagsKeyPrefixes1("defaultkey1", "defaultvalue1", "defaultkey"), - testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - ), - PlanOnly: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultAndIgnoreTagsKeys1("defaultkey1", "defaultvalue1"), - testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - ), - PlanOnly: true, - }, - }, - }) -} - -func TestAccEKSAddon_ignoreTags(t *testing.T) { - ctx := acctest.Context(t) - var addon eks.Addon - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_eks_addon.test" - addonName := "vpc-cni" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAddonDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAddonExists(ctx, resourceName, &addon), - testAccCheckAddonUpdateTags(ctx, &addon, nil, map[string]string{"ignorekey1": "ignorevalue1"}), - ), - ExpectNonEmptyPlan: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigIgnoreTagsKeyPrefixes1("ignorekey"), - testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - ), - PlanOnly: true, - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigIgnoreTagsKeys("ignorekey1"), - testAccAddonConfig_tags1(rName, addonName, "key1", "value1"), - ), - PlanOnly: true, - }, - }, - }) -} - func testAccCheckAddonExists(ctx context.Context, n string, v *eks.Addon) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] From 3628a144b94ef0f6ae6b9736c0af37182c9a566b Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 9 May 2023 14:11:26 -0400 Subject: [PATCH 258/304] docs: rds, docdb, neptune cluster snapshot_identifier upgrade topics --- website/docs/guides/version-5-upgrade.html.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 74e53f0c6bd0..13e59fc71662 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -23,8 +23,11 @@ Upgrade topics: - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) +- [Resource: aws_docdb_cluster](#resource-aws_docdb_cluster) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) - [Resource: aws_ec2_client_vpn_network_association](#resource-aws_ec2_client_vpn_network_association) +- [Resource: aws_neptune_cluster](#resource-aws_neptune_cluster) +- [Resource: aws_rds_cluster](#resource-aws_rds_cluster) @@ -99,6 +102,12 @@ The `threshold` attribute has been removed. The `ecs_target.propagate_tags` attribute now has no default value. If no value is specified, the tags are not propagated. +## Resource: aws_docdb_cluster + +Changes to the `snapshot_identifier` attribute will now correctly force re-creation of the resource. Previously, changing this attribute would result in a successful apply, but without the cluster being restored (only the resource state was changed). This change brings behavior of the cluster `snapshot_identifier` attribute into alignment with other RDS resources, such as `aws_db_instance`. + +Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. + ## Resource: aws_ec2_client_vpn_endpoint The `status` attribute has been removed. @@ -107,6 +116,18 @@ The `status` attribute has been removed. The `status` attribute has been removed. +## Resource: aws_neptune_cluster + +Changes to the `snapshot_identifier` attribute will now correctly force re-creation of the resource. Previously, changing this attribute would result in a successful apply, but without the cluster being restored (only the resource state was changed). This change brings behavior of the cluster `snapshot_identifier` attribute into alignment with other RDS resources, such as `aws_db_instance`. + +Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. + +## Resource: aws_rds_cluster + +Changes to the `snapshot_identifier` attribute will now correctly force re-creation of the resource. Previously, changing this attribute would result in a successful apply, but without the cluster being restored (only the resource state was changed). This change brings behavior of the cluster `snapshot_identifier` attribute into alignment with other RDS resources, such as `aws_db_instance`. + +Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From 80d15c1743df8c1193f12a4d0fb7a201100fb666 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 9 May 2023 14:16:44 -0400 Subject: [PATCH 259/304] docs: aws_autoscaling_group tags deprecation --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 13e59fc71662..e542cfd8aec4 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -21,6 +21,7 @@ Upgrade topics: - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) +- [Resource: aws_autoscaling_group](#resource-aws_autoscaling_group) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) - [Resource: aws_docdb_cluster](#resource-aws_docdb_cluster) @@ -94,6 +95,10 @@ Version 5.0.0 removes these `provider` arguments: The `status` attribute is superfluous and sometimes incorrect. It has been removed. +## Resource: aws_autoscaling_group + +The `tags` attribute has been removed. Use the `tag` attribute instead. For use cases requiring dynamic tags, see the [Dynamic Tagging example](../r/autoscaling_group.html.markdown#dynamic-tagging). + ## Resource: aws_ce_anomaly_subscription The `threshold` attribute has been removed. From c8cc01016f71516428a372b1a21048b5c4e9306a Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 9 May 2023 15:44:17 -0400 Subject: [PATCH 260/304] docs: aws_api_gateway_rest_api minimum_compression_size type change --- website/docs/guides/version-5-upgrade.html.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index e542cfd8aec4..00eee17beda9 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -18,9 +18,11 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Provider Arguments](#provider-arguments) +- [Data Source: aws_api_gateway_rest_api](#data-source-aws_api_gateway_rest_api) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) +- [Resource: aws_api_gateway_rest_api](#resource-aws_api_gateway_rest_api) - [Resource: aws_autoscaling_group](#resource-aws_autoscaling_group) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) @@ -95,6 +97,10 @@ Version 5.0.0 removes these `provider` arguments: The `status` attribute is superfluous and sometimes incorrect. It has been removed. +## Resource: aws_api_gateway_rest_api + +The `minimum_compression_size` attribute is now a String type, allowing it to be computed when set via the `body` attribute. Valid values remain the same. + ## Resource: aws_autoscaling_group The `tags` attribute has been removed. Use the `tag` attribute instead. For use cases requiring dynamic tags, see the [Dynamic Tagging example](../r/autoscaling_group.html.markdown#dynamic-tagging). @@ -133,6 +139,10 @@ Changes to the `snapshot_identifier` attribute will now correctly force re-creat Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. +## Data Source: aws_api_gateway_rest_api + +The `minimum_compression_size` attribute is now a String type, allowing it to be computed when set via the `body` attribute. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From a1cec3dc8fd709aa97aef9484841486f827cf503 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 11:26:44 -0400 Subject: [PATCH 261/304] d/aws_identitystore_group: Remove 'filter' argument. --- .changelog/#####.txt | 3 + .../identitystore/group_data_source.go | 113 +------- .../identitystore/group_data_source_test.go | 270 +----------------- .../service/identitystore/user_data_source.go | 28 ++ .../docs/d/identitystore_group.html.markdown | 14 +- website/docs/guides/version-5-upgrade.html.md | 5 + 6 files changed, 55 insertions(+), 378 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..ac13094aecaa --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +data-source/aws_identitystore_group: The `filter` argument has been removed +``` \ No newline at end of file diff --git a/internal/service/identitystore/group_data_source.go b/internal/service/identitystore/group_data_source.go index 07b572fc94bf..57e5c76fb306 100644 --- a/internal/service/identitystore/group_data_source.go +++ b/internal/service/identitystore/group_data_source.go @@ -6,7 +6,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/identitystore" - "github.com/aws/aws-sdk-go-v2/service/identitystore/types" "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" @@ -23,10 +22,9 @@ func DataSourceGroup() *schema.Resource { Schema: map[string]*schema.Schema{ "alternate_identifier": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - ConflictsWith: []string{"filter", "group_id"}, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "external_id": { @@ -67,6 +65,7 @@ func DataSourceGroup() *schema.Resource { }, }, }, + ExactlyOneOf: []string{"alternate_identifier", "group_id"}, }, "description": { Type: schema.TypeString, @@ -92,36 +91,15 @@ func DataSourceGroup() *schema.Resource { }, }, }, - "filter": { - Deprecated: "Use the alternate_identifier attribute instead.", - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - AtLeastOneOf: []string{"alternate_identifier", "filter", "group_id"}, - ConflictsWith: []string{"alternate_identifier"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "attribute_path": { - Type: schema.TypeString, - Required: true, - }, - "attribute_value": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, "group_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - AtLeastOneOf: []string{"alternate_identifier", "filter", "group_id"}, - ConflictsWith: []string{"alternate_identifier"}, + Type: schema.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.All( validation.StringLenBetween(1, 47), validation.StringMatch(regexp.MustCompile(`^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$`), "must match ([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}"), ), + ExactlyOneOf: []string{"alternate_identifier", "group_id"}, }, "identity_store_id": { Type: schema.TypeString, @@ -144,53 +122,6 @@ func dataSourceGroupRead(ctx context.Context, d *schema.ResourceData, meta inter identityStoreID := d.Get("identity_store_id").(string) - if v, ok := d.GetOk("filter"); ok && len(v.([]interface{})) > 0 { - // Use ListGroups for backwards compat. - input := &identitystore.ListGroupsInput{ - IdentityStoreId: aws.String(identityStoreID), - Filters: expandFilters(d.Get("filter").([]interface{})), - } - paginator := identitystore.NewListGroupsPaginator(conn, input) - var results []types.Group - - for paginator.HasMorePages() { - page, err := paginator.NextPage(ctx) - - if err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionReading, DSNameGroup, identityStoreID, err) - } - - for _, group := range page.Groups { - if v, ok := d.GetOk("group_id"); ok && v.(string) != aws.ToString(group.GroupId) { - continue - } - - results = append(results, group) - } - } - - if len(results) == 0 { - return diag.Errorf("no Identity Store Group found matching criteria\n%v; try different search", input.Filters) - } - - if len(results) > 1 { - return diag.Errorf("multiple Identity Store Groups found matching criteria\n%v; try different search", input.Filters) - } - - group := results[0] - - d.SetId(aws.ToString(group.GroupId)) - d.Set("description", group.Description) - d.Set("display_name", group.DisplayName) - d.Set("group_id", group.GroupId) - - if err := d.Set("external_ids", flattenExternalIds(group.ExternalIds)); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameGroup, d.Id(), err) - } - - return nil - } - var groupID string if v, ok := d.GetOk("alternate_identifier"); ok && len(v.([]interface{})) > 0 { @@ -239,31 +170,3 @@ func dataSourceGroupRead(ctx context.Context, d *schema.ResourceData, meta inter return nil } - -func expandFilters(l []interface{}) []types.Filter { - if len(l) == 0 || l[0] == nil { - return nil - } - - filters := make([]types.Filter, 0, len(l)) - for _, v := range l { - tfMap, ok := v.(map[string]interface{}) - if !ok { - continue - } - - filter := types.Filter{} - - if v, ok := tfMap["attribute_path"].(string); ok && v != "" { - filter.AttributePath = aws.String(v) - } - - if v, ok := tfMap["attribute_value"].(string); ok && v != "" { - filter.AttributeValue = aws.String(v) - } - - filters = append(filters, filter) - } - - return filters -} diff --git a/internal/service/identitystore/group_data_source_test.go b/internal/service/identitystore/group_data_source_test.go index 47d86d840422..f6764b5d2738 100644 --- a/internal/service/identitystore/group_data_source_test.go +++ b/internal/service/identitystore/group_data_source_test.go @@ -14,34 +14,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" ) -func TestAccIdentityStoreGroupDataSource_filterDisplayName(t *testing.T) { - ctx := acctest.Context(t) - resourceName := "aws_identitystore_group.test" - dataSourceName := "data.aws_identitystore_group.test" - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_filterDisplayName(name), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), - resource.TestCheckResourceAttrPair(dataSourceName, "display_name", resourceName, "display_name"), - resource.TestCheckResourceAttrPair(dataSourceName, "group_id", resourceName, "group_id"), - resource.TestCheckResourceAttr(dataSourceName, "external_ids.#", "0"), - ), - }, - }, - }) -} - func TestAccIdentityStoreGroupDataSource_uniqueAttributeDisplayName(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_identitystore_group.test" @@ -70,12 +42,8 @@ func TestAccIdentityStoreGroupDataSource_uniqueAttributeDisplayName(t *testing.T }) } -func TestAccIdentityStoreGroupDataSource_filterDisplayNameAndGroupId(t *testing.T) { +func TestAccIdentityStoreGroupDataSource_externalIDConflictsWithUniqueAttribute(t *testing.T) { ctx := acctest.Context(t) - resourceName := "aws_identitystore_group.test" - dataSourceName := "data.aws_identitystore_group.test" - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) @@ -86,118 +54,14 @@ func TestAccIdentityStoreGroupDataSource_filterDisplayNameAndGroupId(t *testing. CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGroupDataSourceConfig_filterDisplayNameAndGroupId(name), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), - resource.TestCheckResourceAttrPair(dataSourceName, "display_name", resourceName, "display_name"), - resource.TestCheckResourceAttrPair(dataSourceName, "group_id", resourceName, "group_id"), - resource.TestCheckResourceAttr(dataSourceName, "external_ids.#", "0"), - ), - }, - }, - }) -} - -func TestAccIdentityStoreGroupDataSource_nonExistent(t *testing.T) { - ctx := acctest.Context(t) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_nonExistent, - ExpectError: regexp.MustCompile(`no Identity Store Group found matching criteria`), - }, - }, - }) -} - -func TestAccIdentityStoreGroupDataSource_groupIdFilterMismatch(t *testing.T) { - ctx := acctest.Context(t) - name1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - name2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_groupIdFilterMismatch(name1, name2), - ExpectError: regexp.MustCompile(`no Identity Store Group found matching criteria`), - }, - }, - }) -} - -func TestAccIdentityStoreGroupDataSource_externalIdConflictsWithUniqueAttribute(t *testing.T) { - ctx := acctest.Context(t) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_externalIdConflictsWithUniqueAttribute, + Config: testAccGroupDataSourceConfig_externalIDConflictsWithUniqueAttribute, ExpectError: regexp.MustCompile(`Invalid combination of arguments`), }, }, }) } -func TestAccIdentityStoreGroupDataSource_filterConflictsWithUniqueAttribute(t *testing.T) { - ctx := acctest.Context(t) - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_filterConflictsWithUniqueAttribute(name), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), - }, - }, - }) -} - -func TestAccIdentityStoreGroupDataSource_groupIdConflictsWithUniqueAttribute(t *testing.T) { - ctx := acctest.Context(t) - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccGroupDataSourceConfig_groupIdConflictsWithUniqueAttribute(name), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), - }, - }, - }) -} - -func TestAccIdentityStoreGroupDataSource_filterConflictsWithExternalId(t *testing.T) { +func TestAccIdentityStoreGroupDataSource_groupIDConflictsWithUniqueAttribute(t *testing.T) { ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -211,14 +75,14 @@ func TestAccIdentityStoreGroupDataSource_filterConflictsWithExternalId(t *testin CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGroupDataSourceConfig_filterConflictsWithExternalId(name), + Config: testAccGroupDataSourceConfig_groupIDConflictsWithUniqueAttribute(name), ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), }, }, }) } -func TestAccIdentityStoreGroupDataSource_groupIdConflictsWithExternalId(t *testing.T) { +func TestAccIdentityStoreGroupDataSource_groupIDConflictsWithExternalID(t *testing.T) { ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -232,7 +96,7 @@ func TestAccIdentityStoreGroupDataSource_groupIdConflictsWithExternalId(t *testi CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGroupDataSourceConfig_groupIdConflictsWithExternalId(name), + Config: testAccGroupDataSourceConfig_groupIDConflictsWithExternalID(name), ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), }, }, @@ -251,22 +115,6 @@ resource "aws_identitystore_group" "test" { `, name) } -func testAccGroupDataSourceConfig_filterDisplayName(name string) string { - return acctest.ConfigCompose( - testAccGroupDataSourceConfig_base(name), - ` -data "aws_identitystore_group" "test" { - filter { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } - - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] -} -`, - ) -} - func testAccGroupDataSourceConfig_uniqueAttributeDisplayName(name string) string { return acctest.ConfigCompose( testAccGroupDataSourceConfig_base(name), @@ -285,61 +133,7 @@ data "aws_identitystore_group" "test" { ) } -func testAccGroupDataSourceConfig_filterDisplayNameAndGroupId(name string) string { - return acctest.ConfigCompose( - testAccGroupDataSourceConfig_base(name), - ` -data "aws_identitystore_group" "test" { - filter { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } - - group_id = aws_identitystore_group.test.group_id - - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] -} -`, - ) -} - -const testAccGroupDataSourceConfig_nonExistent = ` -data "aws_ssoadmin_instances" "test" {} - -data "aws_identitystore_group" "test" { - filter { - attribute_path = "DisplayName" - attribute_value = "does-not-exist" - } - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] -} -` - -func testAccGroupDataSourceConfig_groupIdFilterMismatch(name1, name2 string) string { - return acctest.ConfigCompose( - testAccGroupDataSourceConfig_base(name1), - fmt.Sprintf(` -resource "aws_identitystore_group" "test2" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - display_name = %[1]q - description = "Acceptance Test" -} - -data "aws_identitystore_group" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - filter { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } - - group_id = aws_identitystore_group.test2.group_id -} -`, name2), - ) -} - -const testAccGroupDataSourceConfig_externalIdConflictsWithUniqueAttribute = ` +const testAccGroupDataSourceConfig_externalIDConflictsWithUniqueAttribute = ` data "aws_ssoadmin_instances" "test" {} data "aws_identitystore_group" "test" { @@ -359,30 +153,7 @@ data "aws_identitystore_group" "test" { } ` -func testAccGroupDataSourceConfig_filterConflictsWithUniqueAttribute(name string) string { - return acctest.ConfigCompose( - testAccGroupDataSourceConfig_base(name), - ` -data "aws_identitystore_group" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - alternate_identifier { - unique_attribute { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } - } - - filter { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } -} -`, - ) -} - -func testAccGroupDataSourceConfig_groupIdConflictsWithUniqueAttribute(name string) string { +func testAccGroupDataSourceConfig_groupIDConflictsWithUniqueAttribute(name string) string { return acctest.ConfigCompose( testAccGroupDataSourceConfig_base(name), ` @@ -402,30 +173,7 @@ data "aws_identitystore_group" "test" { ) } -func testAccGroupDataSourceConfig_filterConflictsWithExternalId(name string) string { - return acctest.ConfigCompose( - testAccGroupDataSourceConfig_base(name), - ` -data "aws_identitystore_group" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - alternate_identifier { - external_id { - id = "test" - issuer = "test" - } - } - - filter { - attribute_path = "DisplayName" - attribute_value = aws_identitystore_group.test.display_name - } -} -`, - ) -} - -func testAccGroupDataSourceConfig_groupIdConflictsWithExternalId(name string) string { +func testAccGroupDataSourceConfig_groupIDConflictsWithExternalID(name string) string { return acctest.ConfigCompose( testAccGroupDataSourceConfig_base(name), ` diff --git a/internal/service/identitystore/user_data_source.go b/internal/service/identitystore/user_data_source.go index 6fddd5404d4b..69b2a4eab652 100644 --- a/internal/service/identitystore/user_data_source.go +++ b/internal/service/identitystore/user_data_source.go @@ -433,3 +433,31 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, meta interf return nil } + +func expandFilters(l []interface{}) []types.Filter { + if len(l) == 0 || l[0] == nil { + return nil + } + + filters := make([]types.Filter, 0, len(l)) + for _, v := range l { + tfMap, ok := v.(map[string]interface{}) + if !ok { + continue + } + + filter := types.Filter{} + + if v, ok := tfMap["attribute_path"].(string); ok && v != "" { + filter.AttributePath = aws.String(v) + } + + if v, ok := tfMap["attribute_value"].(string); ok && v != "" { + filter.AttributeValue = aws.String(v) + } + + filters = append(filters, filter) + } + + return filters +} diff --git a/website/docs/d/identitystore_group.html.markdown b/website/docs/d/identitystore_group.html.markdown index 1b07def753ee..788c4668659c 100644 --- a/website/docs/d/identitystore_group.html.markdown +++ b/website/docs/d/identitystore_group.html.markdown @@ -39,11 +39,10 @@ The following arguments are required: The following arguments are optional: -* `alternate_identifier` (Optional) A unique identifier for the group that is not the primary identifier. Conflicts with `group_id` and `filter`. Detailed below. -* `filter` - (Optional, **Deprecated** use the `alternate_identifier` attribute instead) Configuration block for filtering by a unique attribute of the group. Detailed below. +* `alternate_identifier` (Optional) A unique identifier for the group that is not the primary identifier. Conflicts with `group_id`. Detailed below. * `group_id` - (Optional) The identifier for a group in the Identity Store. --> Exactly one of the above arguments must be provided. Passing both `filter` and `group_id` is allowed for backwards compatibility. +-> Exactly one of the above arguments must be provided. ### `alternate_identifier` Configuration Block @@ -61,15 +60,6 @@ The following arguments are supported by the `external_id` configuration block: * `id` - (Required) The identifier issued to this resource by an external identity provider. * `issuer` - (Required) The issuer for an external identifier. -### `filter` Configuration Block - -~> The `filter` configuration block has been deprecated. Use `alternate_identifier` instead. - -The following arguments are supported by the `filter` configuration block: - -* `attribute_path` - (Required) Attribute path that is used to specify which attribute name to search. Currently, `DisplayName` is the only valid attribute path. -* `attribute_value` - (Required) Value for an attribute. - ### `unique_attribute` Configuration Block The following arguments are supported by the `unique_attribute` configuration block: diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 00eee17beda9..72e171a0c58c 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -19,6 +19,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Provider Arguments](#provider-arguments) - [Data Source: aws_api_gateway_rest_api](#data-source-aws_api_gateway_rest_api) +- [Data Source: aws_identitystore_group](#data-source-aws_identitystore_group) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) @@ -143,6 +144,10 @@ Automated snapshots **should not** be used for this attribute, unless from a dif The `minimum_compression_size` attribute is now a String type, allowing it to be computed when set via the `body` attribute. +## Data Source: aws_identitystore_group + +The `filter` argument has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From 75e72e3d4db0e6d04d61bf02d79bd989e2d51771 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 11:29:17 -0400 Subject: [PATCH 262/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31312.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31312.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31312.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31312.txt From 754d75542640b00de475076991abc5049bfc3bc1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 11:40:33 -0400 Subject: [PATCH 263/304] d/aws_identitystore_user: Remove 'filter' argument. --- .changelog/31312.txt | 4 + .../service/identitystore/user_data_source.go | 136 +----------- .../identitystore/user_data_source_test.go | 193 +----------------- .../docs/d/identitystore_user.html.markdown | 14 +- website/docs/guides/version-5-upgrade.html.md | 5 + 5 files changed, 25 insertions(+), 327 deletions(-) diff --git a/.changelog/31312.txt b/.changelog/31312.txt index ac13094aecaa..6dab030dd1f8 100644 --- a/.changelog/31312.txt +++ b/.changelog/31312.txt @@ -1,3 +1,7 @@ ```release-note:note data-source/aws_identitystore_group: The `filter` argument has been removed +``` + +```release-note:note +data-source/aws_identitystore_user: The `filter` argument has been removed ``` \ No newline at end of file diff --git a/internal/service/identitystore/user_data_source.go b/internal/service/identitystore/user_data_source.go index 69b2a4eab652..37d723d96de0 100644 --- a/internal/service/identitystore/user_data_source.go +++ b/internal/service/identitystore/user_data_source.go @@ -64,10 +64,9 @@ func DataSourceUser() *schema.Resource { }, }, "alternate_identifier": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - ConflictsWith: []string{"filter", "user_id"}, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "external_id": { @@ -108,6 +107,7 @@ func DataSourceUser() *schema.Resource { }, }, }, + ExactlyOneOf: []string{"alternate_identifier", "user_id"}, }, "display_name": { Type: schema.TypeString, @@ -149,26 +149,6 @@ func DataSourceUser() *schema.Resource { }, }, }, - "filter": { - Deprecated: "Use the alternate_identifier attribute instead.", - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - AtLeastOneOf: []string{"alternate_identifier", "filter", "user_id"}, - ConflictsWith: []string{"alternate_identifier"}, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "attribute_path": { - Type: schema.TypeString, - Required: true, - }, - "attribute_value": { - Type: schema.TypeString, - Required: true, - }, - }, - }, - }, "identity_store_id": { Type: schema.TypeString, Required: true, @@ -254,15 +234,14 @@ func DataSourceUser() *schema.Resource { Computed: true, }, "user_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - AtLeastOneOf: []string{"alternate_identifier", "filter", "user_id"}, - ConflictsWith: []string{"alternate_identifier"}, + Type: schema.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.All( validation.StringLenBetween(1, 47), validation.StringMatch(regexp.MustCompile(`^([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$`), "must match ([0-9a-f]{10}-|)[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}"), ), + ExactlyOneOf: []string{"alternate_identifier", "user_id"}, }, "user_name": { Type: schema.TypeString, @@ -285,77 +264,6 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, meta interf identityStoreID := d.Get("identity_store_id").(string) - if v, ok := d.GetOk("filter"); ok && len(v.([]interface{})) > 0 { - // Use ListUsers for backwards compat. - input := &identitystore.ListUsersInput{ - Filters: expandFilters(d.Get("filter").([]interface{})), - IdentityStoreId: aws.String(identityStoreID), - } - paginator := identitystore.NewListUsersPaginator(conn, input) - var results []types.User - - for paginator.HasMorePages() { - page, err := paginator.NextPage(ctx) - - if err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionReading, DSNameUser, identityStoreID, err) - } - - for _, user := range page.Users { - if v, ok := d.GetOk("user_id"); ok && v.(string) != aws.ToString(user.UserId) { - continue - } - - results = append(results, user) - } - } - - if len(results) == 0 { - return diag.Errorf("no Identity Store User found matching criteria\n%v; try different search", input.Filters) - } - - if len(results) > 1 { - return diag.Errorf("multiple Identity Store Users found matching criteria\n%v; try different search", input.Filters) - } - - user := results[0] - - d.SetId(aws.ToString(user.UserId)) - d.Set("display_name", user.DisplayName) - d.Set("identity_store_id", user.IdentityStoreId) - d.Set("locale", user.Locale) - d.Set("nickname", user.NickName) - d.Set("preferred_language", user.PreferredLanguage) - d.Set("profile_url", user.ProfileUrl) - d.Set("timezone", user.Timezone) - d.Set("title", user.Title) - d.Set("user_id", user.UserId) - d.Set("user_name", user.UserName) - d.Set("user_type", user.UserType) - - if err := d.Set("addresses", flattenAddresses(user.Addresses)); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameUser, d.Id(), err) - } - - if err := d.Set("emails", flattenEmails(user.Emails)); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameUser, d.Id(), err) - } - - if err := d.Set("external_ids", flattenExternalIds(user.ExternalIds)); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameUser, d.Id(), err) - } - - if err := d.Set("name", []interface{}{flattenName(user.Name)}); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameUser, d.Id(), err) - } - - if err := d.Set("phone_numbers", flattenPhoneNumbers(user.PhoneNumbers)); err != nil { - return create.DiagError(names.IdentityStore, create.ErrActionSetting, DSNameUser, d.Id(), err) - } - - return nil - } - var userID string if v, ok := d.GetOk("alternate_identifier"); ok && len(v.([]interface{})) > 0 { @@ -433,31 +341,3 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, meta interf return nil } - -func expandFilters(l []interface{}) []types.Filter { - if len(l) == 0 || l[0] == nil { - return nil - } - - filters := make([]types.Filter, 0, len(l)) - for _, v := range l { - tfMap, ok := v.(map[string]interface{}) - if !ok { - continue - } - - filter := types.Filter{} - - if v, ok := tfMap["attribute_path"].(string); ok && v != "" { - filter.AttributePath = aws.String(v) - } - - if v, ok := tfMap["attribute_value"].(string); ok && v != "" { - filter.AttributeValue = aws.String(v) - } - - filters = append(filters, filter) - } - - return filters -} diff --git a/internal/service/identitystore/user_data_source_test.go b/internal/service/identitystore/user_data_source_test.go index 0697c0412ec8..6ea14a2ac38c 100644 --- a/internal/service/identitystore/user_data_source_test.go +++ b/internal/service/identitystore/user_data_source_test.go @@ -53,33 +53,6 @@ func TestAccIdentityStoreUserDataSource_basic(t *testing.T) { }) } -func TestAccIdentityStoreUserDataSource_filterUserName(t *testing.T) { - ctx := acctest.Context(t) - dataSourceName := "data.aws_identitystore_user.test" - resourceName := "aws_identitystore_user.test" - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - email := acctest.RandomEmailAddress(acctest.RandomDomainName()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckUserDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccUserDataSourceConfig_filterUserName(name, email), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(dataSourceName, "user_id", resourceName, "user_id"), - resource.TestCheckResourceAttr(dataSourceName, "user_name", name), - ), - }, - }, - }) -} - func TestAccIdentityStoreUserDataSource_uniqueAttributeUserName(t *testing.T) { ctx := acctest.Context(t) dataSourceName := "data.aws_identitystore_user.test" @@ -134,33 +107,6 @@ func TestAccIdentityStoreUserDataSource_email(t *testing.T) { }) } -func TestAccIdentityStoreUserDataSource_userID(t *testing.T) { - ctx := acctest.Context(t) - dataSourceName := "data.aws_identitystore_user.test" - resourceName := "aws_identitystore_user.test" - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - email := acctest.RandomEmailAddress(acctest.RandomDomainName()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - acctest.PreCheck(ctx, t) - testAccPreCheckSSOAdminInstances(ctx, t) - }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckUserDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccUserDataSourceConfig_id(name, email), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(dataSourceName, "user_id", resourceName, "user_id"), - resource.TestCheckResourceAttrPair(dataSourceName, "user_name", resourceName, "user_name"), - ), - }, - }, - }) -} - func TestAccIdentityStoreUserDataSource_nonExistent(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ @@ -177,13 +123,8 @@ func TestAccIdentityStoreUserDataSource_nonExistent(t *testing.T) { }) } -func TestAccIdentityStoreUserDataSource_userIdFilterMismatch(t *testing.T) { +func TestAccIdentityStoreUserDataSource_externalIDConflictsWithUniqueAttribute(t *testing.T) { ctx := acctest.Context(t) - name1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - email1 := acctest.RandomEmailAddress(acctest.RandomDomainName()) - name2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - email2 := acctest.RandomEmailAddress(acctest.RandomDomainName()) - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -191,49 +132,14 @@ func TestAccIdentityStoreUserDataSource_userIdFilterMismatch(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccUserDataSourceConfig_userIdFilterMismatch(name1, email1, name2, email2), - ExpectError: regexp.MustCompile(`no Identity Store User found matching criteria`), - }, - }, - }) -} - -func TestAccIdentityStoreUserDataSource_externalIdConflictsWithUniqueAttribute(t *testing.T) { - ctx := acctest.Context(t) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckUserDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccUserDataSourceConfig_externalIdConflictsWithUniqueAttribute, + Config: testAccUserDataSourceConfig_externalIDConflictsWithUniqueAttribute, ExpectError: regexp.MustCompile(`Invalid combination of arguments`), }, }, }) } -func TestAccIdentityStoreUserDataSource_filterConflictsWithExternalId(t *testing.T) { - ctx := acctest.Context(t) - name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - email := acctest.RandomEmailAddress(acctest.RandomDomainName()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckUserDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccUserDataSourceConfig_filterConflictsWithUniqueAttribute(name, email), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), - }, - }, - }) -} - -func TestAccIdentityStoreUserDataSource_userIdConflictsWithExternalId(t *testing.T) { +func TestAccIdentityStoreUserDataSource_userIDConflictsWithExternalID(t *testing.T) { ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) email := acctest.RandomEmailAddress(acctest.RandomDomainName()) @@ -245,7 +151,7 @@ func TestAccIdentityStoreUserDataSource_userIdConflictsWithExternalId(t *testing CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccUserDataSourceConfig_userIdConflictsWithUniqueAttribute(name, email), + Config: testAccUserDataSourceConfig_userIDConflictsWithUniqueAttribute(name, email), ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), }, }, @@ -332,22 +238,6 @@ data "aws_identitystore_user" "test" { `, name, email) } -func testAccUserDataSourceConfig_filterUserName(name, email string) string { - return acctest.ConfigCompose( - testAccUserDataSourceConfig_base(name, email), - ` -data "aws_identitystore_user" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - filter { - attribute_path = "UserName" - attribute_value = aws_identitystore_user.test.user_name - } -} -`, - ) -} - func testAccUserDataSourceConfig_uniqueAttributeUserName(name, email string) string { return acctest.ConfigCompose( testAccUserDataSourceConfig_base(name, email), @@ -384,55 +274,6 @@ data "aws_identitystore_user" "test" { ) } -func testAccUserDataSourceConfig_id(name, email string) string { - return acctest.ConfigCompose( - testAccUserDataSourceConfig_base(name, email), - ` -data "aws_identitystore_user" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - filter { - attribute_path = "UserName" - attribute_value = aws_identitystore_user.test.user_name - } - - user_id = aws_identitystore_user.test.user_id -} -`) -} - -func testAccUserDataSourceConfig_userIdFilterMismatch(name1, email1, name2, email2 string) string { - return acctest.ConfigCompose( - testAccUserDataSourceConfig_base(name1, email1), - fmt.Sprintf(` -resource "aws_identitystore_user" "test2" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - display_name = "Acceptance Test" - user_name = %[1]q - - name { - family_name = "Acceptance" - given_name = "Test" - } - - emails { - value = %[2]q - } -} - -data "aws_identitystore_user" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - filter { - attribute_path = "UserName" - attribute_value = aws_identitystore_user.test.user_name - } - - user_id = aws_identitystore_user.test2.user_id -} -`, name2, email2)) -} - const testAccUserDataSourceConfig_nonExistent = ` data "aws_ssoadmin_instances" "test" {} @@ -448,7 +289,7 @@ data "aws_identitystore_user" "test" { } ` -const testAccUserDataSourceConfig_externalIdConflictsWithUniqueAttribute = ` +const testAccUserDataSourceConfig_externalIDConflictsWithUniqueAttribute = ` data "aws_ssoadmin_instances" "test" {} data "aws_identitystore_user" "test" { @@ -468,29 +309,7 @@ data "aws_identitystore_user" "test" { } ` -func testAccUserDataSourceConfig_filterConflictsWithUniqueAttribute(name, email string) string { - return acctest.ConfigCompose( - testAccUserDataSourceConfig_base(name, email), - ` -data "aws_identitystore_user" "test" { - identity_store_id = tolist(data.aws_ssoadmin_instances.test.identity_store_ids)[0] - - alternate_identifier { - unique_attribute { - attribute_path = "UserName" - attribute_value = aws_identitystore_user.test.user_name - } - } - - filter { - attribute_path = "UserName" - attribute_value = aws_identitystore_user.test.user_name - } -} -`) -} - -func testAccUserDataSourceConfig_userIdConflictsWithUniqueAttribute(name, email string) string { +func testAccUserDataSourceConfig_userIDConflictsWithUniqueAttribute(name, email string) string { return acctest.ConfigCompose( testAccUserDataSourceConfig_base(name, email), ` diff --git a/website/docs/d/identitystore_user.html.markdown b/website/docs/d/identitystore_user.html.markdown index e62bd41d4f30..99546e176e3c 100644 --- a/website/docs/d/identitystore_user.html.markdown +++ b/website/docs/d/identitystore_user.html.markdown @@ -39,11 +39,10 @@ The following arguments are required: The following arguments are optional: -* `alternate_identifier` (Optional) A unique identifier for a user or group that is not the primary identifier. Conflicts with `user_id` and `filter`. Detailed below. -* `filter` - (Optional, **Deprecated** use the `alternate_identifier` attribute instead) Configuration block for filtering by a unique attribute of the user. Detailed below. +* `alternate_identifier` (Optional) A unique identifier for a user or group that is not the primary identifier. Conflicts with `user_id`. Detailed below. * `user_id` - (Optional) The identifier for a user in the Identity Store. --> Exactly one of the above arguments must be provided. Passing both `filter` and `user_id` is allowed for backwards compatibility. +-> Exactly one of the above arguments must be provided. ### `alternate_identifier` Configuration Block @@ -61,15 +60,6 @@ The following arguments are supported by the `external_id` configuration block: * `id` - (Required) The identifier issued to this resource by an external identity provider. * `issuer` - (Required) The issuer for an external identifier. -### `filter` Configuration Block - -~> The `filter` configuration block has been deprecated. Use `alternate_identifier` instead. - -The following arguments are supported by the `filter` configuration block: - -* `attribute_path` - (Required) Attribute path that is used to specify which attribute name to search. Currently, `UserName` is the only valid attribute path. -* `attribute_value` - (Required) Value for an attribute. - ### `unique_attribute` Configuration Block The following arguments are supported by the `unique_attribute` configuration block: diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 72e171a0c58c..59819f7f9d9b 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -20,6 +20,7 @@ Upgrade topics: - [Provider Arguments](#provider-arguments) - [Data Source: aws_api_gateway_rest_api](#data-source-aws_api_gateway_rest_api) - [Data Source: aws_identitystore_group](#data-source-aws_identitystore_group) +- [Data Source: aws_identitystore_user](#data-source-aws_identitystore_user) - [Data Source: aws_redshift_service_account](#data-source-aws_redshift_service_account) - [Data Source: aws_subnet_ids](#data-source-aws_subnet_ids) - [Resource: aws_acmpca_certificate_authority](#resource-aws_acmpca_certificate_authority) @@ -148,6 +149,10 @@ The `minimum_compression_size` attribute is now a String type, allowing it to be The `filter` argument has been removed. +## Data Source: aws_identitystore_user + +The `filter` argument has been removed. + ## Data Source: aws_redshift_service_account [AWS document](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) that [a service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) be used instead of AWS account ID in any relevant IAM policy. From d32db69947b8b3205accc8f09b9f9c9ad84a6c64 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 12:03:22 -0400 Subject: [PATCH 264/304] Fixup acceptance tests. --- internal/service/identitystore/group_data_source_test.go | 4 ++-- internal/service/identitystore/user_data_source_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/identitystore/group_data_source_test.go b/internal/service/identitystore/group_data_source_test.go index f6764b5d2738..e0330266f283 100644 --- a/internal/service/identitystore/group_data_source_test.go +++ b/internal/service/identitystore/group_data_source_test.go @@ -76,7 +76,7 @@ func TestAccIdentityStoreGroupDataSource_groupIDConflictsWithUniqueAttribute(t * Steps: []resource.TestStep{ { Config: testAccGroupDataSourceConfig_groupIDConflictsWithUniqueAttribute(name), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), + ExpectError: regexp.MustCompile(`Invalid combination of arguments`), }, }, }) @@ -97,7 +97,7 @@ func TestAccIdentityStoreGroupDataSource_groupIDConflictsWithExternalID(t *testi Steps: []resource.TestStep{ { Config: testAccGroupDataSourceConfig_groupIDConflictsWithExternalID(name), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), + ExpectError: regexp.MustCompile(`Invalid combination of arguments`), }, }, }) diff --git a/internal/service/identitystore/user_data_source_test.go b/internal/service/identitystore/user_data_source_test.go index 6ea14a2ac38c..7e7e9de98ebb 100644 --- a/internal/service/identitystore/user_data_source_test.go +++ b/internal/service/identitystore/user_data_source_test.go @@ -152,7 +152,7 @@ func TestAccIdentityStoreUserDataSource_userIDConflictsWithExternalID(t *testing Steps: []resource.TestStep{ { Config: testAccUserDataSourceConfig_userIDConflictsWithUniqueAttribute(name, email), - ExpectError: regexp.MustCompile(`Conflicting configuration arguments`), + ExpectError: regexp.MustCompile(`Invalid combination of arguments`), }, }, }) From 440ebd5702e6b0ea0d48fb5f89236ca67a2b8208 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 10 May 2023 17:10:31 +0000 Subject: [PATCH 265/304] Update CHANGELOG.md for #31312 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c484fd1a05..35948f240e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,8 @@ NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) * data-source/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * data-source/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* data-source/aws_identitystore_group: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) +* data-source/aws_identitystore_user: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) * data-source/aws_quicksight_data_set: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) * data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) * resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) From 6b3828b99784aae187aa42ea78de5234dc550183 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 16:58:31 -0400 Subject: [PATCH 266/304] r/aws_msk_cluster: Remove 'broker_node_group_info.ebs_volume_size'. --- .changelog/#####.txt | 3 + .../kafka/broker_nodes_data_source_test.go | 9 +- internal/service/kafka/cluster.go | 81 +---- .../service/kafka/cluster_data_source_test.go | 9 +- internal/service/kafka/cluster_test.go | 316 +++++++++--------- .../kafka/scram_secret_association_test.go | 17 +- .../service/kafkaconnect/connector_test.go | 7 +- .../lambda/event_source_mapping_test.go | 14 +- website/docs/r/msk_cluster.html.markdown | 3 +- 9 files changed, 222 insertions(+), 237 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..3d2a10dca127 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_msk_cluster: The `broker_node_group_info.ebs_volume_size` attribute has been removed +``` \ No newline at end of file diff --git a/internal/service/kafka/broker_nodes_data_source_test.go b/internal/service/kafka/broker_nodes_data_source_test.go index 72b0461d7e36..a46c936d793c 100644 --- a/internal/service/kafka/broker_nodes_data_source_test.go +++ b/internal/service/kafka/broker_nodes_data_source_test.go @@ -37,7 +37,7 @@ func TestAccKafkaBrokerNodesDataSource_basic(t *testing.T) { } func testAccBrokerNodesDataSourceConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.2.1" @@ -45,9 +45,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.t3.small" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } tags = { diff --git a/internal/service/kafka/cluster.go b/internal/service/kafka/cluster.go index 00273343309e..ebe78911af54 100644 --- a/internal/service/kafka/cluster.go +++ b/internal/service/kafka/cluster.go @@ -44,12 +44,6 @@ func ResourceCluster() *schema.Resource { customdiff.ForceNewIfChange("kafka_version", func(_ context.Context, old, new, meta interface{}) bool { return verify.SemVerLessThan(new.(string), old.(string)) }), - customdiff.ComputedIf("broker_node_group_info.0.storage_info", func(_ context.Context, diff *schema.ResourceDiff, meta interface{}) bool { - return diff.HasChange("broker_node_group_info.0.ebs_volume_size") - }), - customdiff.ComputedIf("broker_node_group_info.0.ebs_volume_size", func(_ context.Context, diff *schema.ResourceDiff, meta interface{}) bool { - return diff.HasChange("broker_node_group_info.0.storage_info") - }), verify.SetTagsDiff, ), @@ -134,14 +128,6 @@ func ResourceCluster() *schema.Resource { }, }, }, - "ebs_volume_size": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - Deprecated: "use 'storage_info' argument instead", - ValidateFunc: validation.IntBetween(1, 16384), - ConflictsWith: []string{"broker_node_group_info.0.storage_info"}, - }, "instance_type": { Type: schema.TypeString, Required: true, @@ -155,11 +141,10 @@ func ResourceCluster() *schema.Resource { }, }, "storage_info": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - ConflictsWith: []string{"broker_node_group_info.0.ebs_volume_size"}, + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "ebs_storage_info": { @@ -671,52 +656,32 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int } } - if d.HasChanges("broker_node_group_info.0.ebs_volume_size", "broker_node_group_info.0.storage_info") { + if d.HasChanges("broker_node_group_info.0.storage_info") { input := &kafka.UpdateBrokerStorageInput{ ClusterArn: aws.String(d.Id()), CurrentVersion: aws.String(d.Get("current_version").(string)), - } - if d.HasChange("broker_node_group_info.0.storage_info") { - // case 1: deprecated ebs_volume_size replaced with storage_info - // case 2: regular update of storage_info - ebsVolumeInfo := &kafka.BrokerEBSVolumeInfo{ + TargetBrokerEBSVolumeInfo: []*kafka.BrokerEBSVolumeInfo{{ KafkaBrokerNodeId: aws.String("All"), VolumeSizeGB: aws.Int64(int64(d.Get("broker_node_group_info.0.storage_info.0.ebs_storage_info.0.volume_size").(int))), - } - if v, ok := d.GetOk("broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - ebsVolumeInfo.ProvisionedThroughput = expandProvisionedThroughput(v.([]interface{})[0].(map[string]interface{})) - } - input.TargetBrokerEBSVolumeInfo = []*kafka.BrokerEBSVolumeInfo{ebsVolumeInfo} - } else { - // case 3: regular update of deprecated ebs_volume_size - input.TargetBrokerEBSVolumeInfo = []*kafka.BrokerEBSVolumeInfo{ - { - KafkaBrokerNodeId: aws.String("All"), - VolumeSizeGB: aws.Int64(int64(d.Get("broker_node_group_info.0.ebs_volume_size").(int))), - }, - } + }}, + } + + if v, ok := d.GetOk("broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + input.TargetBrokerEBSVolumeInfo[0].ProvisionedThroughput = expandProvisionedThroughput(v.([]interface{})[0].(map[string]interface{})) } output, err := conn.UpdateBrokerStorageWithContext(ctx, input) - // the following error is thrown if previous ebs_volume_size and new storage_info.ebs_storage_info.volume_size have the same value: - // BadRequestException: The request does not include any updates to the EBS volumes of the cluster. Verify the request, then try again - // ignore this error to allow users to replace deprecated ebs_volume_size with storage_info - Address case 1 - if err != nil && !tfawserr.ErrMessageContains(err, kafka.ErrCodeBadRequestException, "The request does not include any updates to the EBS volumes of the cluster") { + if err != nil { return diag.Errorf("updating MSK Cluster (%s) broker storage: %s", d.Id(), err) } clusterOperationARN := aws.StringValue(output.ClusterOperationArn) - // when there are no changes, output.ClusterOperationArn is not returned leading to - // InvalidParameter: 1 validation error(s) found. - minimum field size of 1, DescribeClusterOperationInput.ClusterOperationArn. - // skip the wait if the EBS volume size is unchanged - if !tfawserr.ErrMessageContains(err, kafka.ErrCodeBadRequestException, "The request does not include any updates to the EBS volumes of the cluster") { - _, err = waitClusterOperationCompleted(ctx, conn, clusterOperationARN, d.Timeout(schema.TimeoutUpdate)) + _, err = waitClusterOperationCompleted(ctx, conn, clusterOperationARN, d.Timeout(schema.TimeoutUpdate)) - if err != nil { - return diag.Errorf("waiting for MSK Cluster (%s) operation (%s): %s", d.Id(), clusterOperationARN, err) - } + if err != nil { + return diag.Errorf("waiting for MSK Cluster (%s) operation (%s): %s", d.Id(), clusterOperationARN, err) } // refresh the current_version attribute after each update @@ -979,14 +944,6 @@ func expandBrokerNodeGroupInfo(tfMap map[string]interface{}) *kafka.BrokerNodeGr apiObject.SecurityGroups = flex.ExpandStringSet(v) } - if v, ok := tfMap["ebs_volume_size"].(int); ok && v != 0 { - apiObject.StorageInfo = &kafka.StorageInfo{ - EbsStorageInfo: &kafka.EBSStorageInfo{ - VolumeSize: aws.Int64(int64(v)), - }, - } - } - if v, ok := tfMap["storage_info"].([]interface{}); ok && len(v) > 0 && v[0] != nil { apiObject.StorageInfo = expandStorageInfo(v[0].(map[string]interface{})) } @@ -1376,14 +1333,6 @@ func flattenBrokerNodeGroupInfo(apiObject *kafka.BrokerNodeGroupInfo) map[string tfMap["storage_info"] = flattenStorageInfo(v) } - if v := apiObject.StorageInfo; v != nil { - if v := v.EbsStorageInfo; v != nil { - if v := v.VolumeSize; v != nil { - tfMap["ebs_volume_size"] = aws.Int64Value(v) - } - } - } - return tfMap } diff --git a/internal/service/kafka/cluster_data_source_test.go b/internal/service/kafka/cluster_data_source_test.go index 360d38987a93..fd3bd7deaa71 100644 --- a/internal/service/kafka/cluster_data_source_test.go +++ b/internal/service/kafka/cluster_data_source_test.go @@ -46,7 +46,7 @@ func TestAccKafkaClusterDataSource_basic(t *testing.T) { } func testAccClusterDataSourceConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.2.1" @@ -54,9 +54,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } tags = { diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index 86ad6047d01a..471f7bd8cc0c 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -71,7 +71,6 @@ func TestAccKafkaCluster_basic(t *testing.T) { testAccCheckResourceAttrIsSortedCSV(resourceName, "bootstrap_brokers_tls"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.az_distribution", kafka.BrokerAZDistributionDefault), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", "10"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.client_subnets.#", "3"), resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az1", "id"), resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az2", "id"), @@ -82,6 +81,11 @@ func TestAccKafkaCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.instance_type", "kafka.m5.large"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.security_groups.#", "1"), resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.security_groups.*", "aws_security_group.example_sg", "id"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.volume_size", "10"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput.#", "0"), resource.TestCheckResourceAttr(resourceName, "client_authentication.#", "0"), resource.TestCheckResourceAttr(resourceName, "cluster_name", rName), resource.TestCheckResourceAttr(resourceName, "configuration_info.#", "1"), @@ -185,48 +189,6 @@ func TestAccKafkaCluster_tags(t *testing.T) { }) } -func TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize(t *testing.T) { - ctx := acctest.Context(t) - var cluster1, cluster2 kafka.ClusterInfo - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_msk_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_deprecatedBrokerNodeGroupInfoEBSVolumeSize(rName, 11), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", "11"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "current_version", - }, - }, - { - // BadRequestException: The minimum increase in storage size of the cluster should be atleast 100GB - Config: testAccClusterConfig_deprecatedBrokerNodeGroupInfoEBSVolumeSize(rName, 112), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster2), - testAccCheckClusterNotRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", "112"), - ), - }, - }, - }) -} - func TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo(t *testing.T) { ctx := acctest.Context(t) var cluster1, cluster2 kafka.ClusterInfo @@ -246,7 +208,6 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &cluster1), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", strconv.Itoa(original_volume_size)), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.volume_size", strconv.Itoa(original_volume_size)), @@ -265,54 +226,6 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo(t *testing.T) { { // update broker_node_group_info.0.storage_info.0.ebs_storage_info.0.volume_size Config: testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeSetAndProvThroughputEnabled(rName, updated_volume_size, "kafka.m5.4xlarge"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster2), - testAccCheckClusterNotRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", strconv.Itoa(updated_volume_size)), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.volume_size", strconv.Itoa(updated_volume_size)), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput.0.enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.0.provisioned_throughput.0.volume_throughput", "250"), - ), - }, - }, - }) -} - -func TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo(t *testing.T) { - ctx := acctest.Context(t) - var cluster1, cluster2 kafka.ClusterInfo - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_msk_cluster.test" - original_volume_size := 11 - updated_volume_size := 112 - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - // init with the deprecated ebs_volume_size - Config: testAccClusterConfig_deprecatedBrokerNodeGroupInfoEBSVolumeSize(rName, original_volume_size), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.ebs_volume_size", strconv.Itoa(original_volume_size)), - ), - }, - { - // refactor deprecated ebs_volume_size to storage_info - Config: testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeOnly(rName, original_volume_size, "kafka.m5.large"), - PlanOnly: true, - }, - { - // upgrade the instance type, update storage, and enable provisioned throughput - Config: testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeSetAndProvThroughputEnabled(rName, updated_volume_size, "kafka.m5.4xlarge"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &cluster2), testAccCheckClusterNotRecreated(&cluster1, &cluster2), @@ -1317,7 +1230,7 @@ func testAccPreCheck(ctx context.Context, t *testing.T) { } } -func testAccClusterBaseConfig(rName string) string { +func testAccClusterConfig_base(rName string) string { return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` resource "aws_vpc" "example_vpc" { cidr_block = "192.168.0.0/22" @@ -1487,7 +1400,7 @@ resource "aws_route_table_association" "route_tbl_assoc_3" { } func testAccClusterConfig_basic(rName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1495,33 +1408,21 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] - } -} -`, rName)) -} -func testAccClusterConfig_deprecatedBrokerNodeGroupInfoEBSVolumeSize(rName string, ebsVolumeSize int) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` -resource "aws_msk_cluster" "test" { - cluster_name = %[1]q - kafka_version = "2.7.1" - number_of_broker_nodes = 3 - - broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = %[2]d - instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } -`, rName, ebsVolumeSize)) +`, rName)) } func testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeOnly(rName string, ebsVolumeSize int, instanceType string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1542,7 +1443,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeSetAndProvThroughputNotEnabled(rName string, ebsVolumeSize int, instanceType string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1566,7 +1467,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeSetAndProvThroughputEnabled(rName string, ebsVolumeSize int, instanceType string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1591,7 +1492,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_brokerNodeGroupInfoInstanceType(rName string, t string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1599,9 +1500,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = %[2]q security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName, t)) @@ -1631,9 +1537,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_public_subnet_az1.id, aws_subnet.example_public_subnet_az2.id, aws_subnet.example_public_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } configuration_info { @@ -1662,10 +1573,15 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_public_subnet_az1.id, aws_subnet.example_public_subnet_az2.id, aws_subnet.example_public_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + storage_info { + ebs_storage_info { + volume_size = 10 + } + } + connectivity_info { public_access { type = %[2]q @@ -1707,7 +1623,7 @@ resource "aws_acmpca_certificate_authority" "test" { func testAccClusterConfig_clientAuthenticationTLSCertificateAuthorityARNs(rName, commonName string) string { return acctest.ConfigCompose( - testAccClusterBaseConfig(rName), + testAccClusterConfig_base(rName), testAccClusterConfig_rootCA(commonName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { @@ -1717,9 +1633,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } client_authentication { @@ -1744,7 +1665,7 @@ resource "aws_msk_cluster" "test" { func testAccClusterConfig_rootCANoClientAuthentication(rName, commonName string) string { return acctest.ConfigCompose( - testAccClusterBaseConfig(rName), + testAccClusterConfig_base(rName), testAccClusterConfig_rootCA(commonName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { @@ -1754,9 +1675,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } encryption_info { @@ -1770,7 +1696,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_clientAuthenticationSASLScram(rName string, scramEnabled bool) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1778,9 +1704,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } client_authentication { @@ -1795,7 +1726,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_clientAuthenticationSASLIAM(rName string, saslEnabled bool) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1803,9 +1734,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } client_authentication { @@ -1820,7 +1756,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_configurationInfoRevision1(rName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_configuration" "test1" { kafka_versions = ["2.7.1"] name = "%[1]s-1" @@ -1837,9 +1773,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } configuration_info { @@ -1851,7 +1792,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_configurationInfoRevision2(rName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_configuration" "test1" { kafka_versions = ["2.7.1"] name = "%[1]s-1" @@ -1877,9 +1818,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } configuration_info { @@ -1891,7 +1837,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_encryptionInfoEncryptionAtRestKMSKeyARN(rName string) string { // nosemgrep:ci.msk-in-func-name - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_kms_key" "example_key" { description = %[1]q @@ -1907,9 +1853,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } encryption_info { @@ -1920,7 +1871,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_encryptionInfoEncryptionInTransitClientBroker(rName, clientBroker string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1928,9 +1879,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } encryption_info { @@ -1943,7 +1899,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_encryptionInfoEncryptionInTransitIn(rName string, inCluster bool) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -1951,9 +1907,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } encryption_info { @@ -1966,7 +1927,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_enhancedMonitoring(rName, enhancedMonitoring string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q enhanced_monitoring = %[2]q @@ -1975,16 +1936,21 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName, enhancedMonitoring)) } func testAccClusterConfig_storageMode(rName string, storageMode string, kafkaVersion string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q storage_mode = %[2]q @@ -1993,16 +1959,21 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName, storageMode, kafkaVersion)) } func testAccClusterConfig_numberOfBrokerNodes(rName string, brokerCount int) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -2010,16 +1981,21 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName, brokerCount)) } func testAccClusterConfig_openMonitoring(rName string, jmxExporterEnabled bool, nodeExporterEnabled bool) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -2027,9 +2003,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } open_monitoring { @@ -2062,7 +2043,7 @@ func testAccClusterConfig_loggingInfo(rName string, cloudwatchLogsEnabled bool, s3Bucket = "aws_s3_bucket.bucket.id" } - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_cloudwatch_log_group" "test" { name = %[1]q } @@ -2125,9 +2106,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } logging_info { @@ -2154,7 +2140,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_version(rName string, kafkaVersion string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = %[2]q @@ -2168,16 +2154,21 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName, kafkaVersion)) } func testAccClusterConfig_versionConfigurationInfo(rName string, kafkaVersion string, configResourceName string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_configuration" "config1" { kafka_versions = ["2.7.1"] name = "%[1]s-1" @@ -2207,9 +2198,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } configuration_info { @@ -2221,7 +2217,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -2229,9 +2225,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } tags = { @@ -2242,7 +2243,7 @@ resource "aws_msk_cluster" "test" { } func testAccClusterConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(rName), fmt.Sprintf(` + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q kafka_version = "2.7.1" @@ -2250,9 +2251,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } tags = { diff --git a/internal/service/kafka/scram_secret_association_test.go b/internal/service/kafka/scram_secret_association_test.go index 8a27986e7e60..c8e30c212274 100644 --- a/internal/service/kafka/scram_secret_association_test.go +++ b/internal/service/kafka/scram_secret_association_test.go @@ -184,8 +184,8 @@ func testAccCheckScramSecretAssociationExists(ctx context.Context, resourceName } } -func testAccScramSecretAssociationBaseConfig(rName string, count int) string { - return fmt.Sprintf(` +func testAccScramSecretAssociationConfig_base(rName string, count int) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` data "aws_partition" "current" {} resource "aws_msk_cluster" "test" { @@ -195,9 +195,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] - ebs_volume_size = 10 instance_type = "kafka.t3.small" security_groups = [aws_security_group.example_sg.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } client_authentication { @@ -242,13 +247,11 @@ resource "aws_secretsmanager_secret_policy" "test" { } POLICY } -`, rName, count) +`, rName, count)) } func testAccScramSecretAssociationConfig_basic(rName string, count int) string { - return acctest.ConfigCompose( - testAccClusterBaseConfig(rName), - testAccScramSecretAssociationBaseConfig(rName, count), ` + return acctest.ConfigCompose(testAccScramSecretAssociationConfig_base(rName, count), ` resource "aws_msk_scram_secret_association" "test" { cluster_arn = aws_msk_cluster.test.arn secret_arn_list = aws_secretsmanager_secret.test[*].arn diff --git a/internal/service/kafkaconnect/connector_test.go b/internal/service/kafkaconnect/connector_test.go index 9501b57ffbfa..2641da8be187 100644 --- a/internal/service/kafkaconnect/connector_test.go +++ b/internal/service/kafkaconnect/connector_test.go @@ -397,9 +397,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = [aws_subnet.test1.id, aws_subnet.test2.id, aws_subnet.test3.id] - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.test.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } `, rName)) diff --git a/internal/service/lambda/event_source_mapping_test.go b/internal/service/lambda/event_source_mapping_test.go index f0c32bcff7db..3237266e6891 100644 --- a/internal/service/lambda/event_source_mapping_test.go +++ b/internal/service/lambda/event_source_mapping_test.go @@ -2199,9 +2199,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = aws_subnet.test[*].id - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.test.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } @@ -2231,9 +2236,14 @@ resource "aws_msk_cluster" "test" { broker_node_group_info { client_subnets = aws_subnet.test[*].id - ebs_volume_size = 10 instance_type = "kafka.m5.large" security_groups = [aws_security_group.test.id] + + storage_info { + ebs_storage_info { + volume_size = 10 + } + } } } diff --git a/website/docs/r/msk_cluster.html.markdown b/website/docs/r/msk_cluster.html.markdown index 3105584b7157..85a4190d4d15 100644 --- a/website/docs/r/msk_cluster.html.markdown +++ b/website/docs/r/msk_cluster.html.markdown @@ -218,7 +218,6 @@ The following arguments are supported: ### broker_node_group_info Argument Reference * `client_subnets` - (Required) A list of subnets to connect to in client VPC ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-prop-brokernodegroupinfo-clientsubnets)). -* `ebs_volume_size` - (Optional, **Deprecated** use `storage_info.ebs_storage_info.volume_size` instead) The size in GiB of the EBS volume for the data drive on each broker node. * `instance_type` - (Required) Specify the instance type to use for the kafka brokersE.g., kafka.m5.large. ([Pricing info](https://aws.amazon.com/msk/pricing/)) * `security_groups` - (Required) A list of the security groups to associate with the elastic network interfaces to control who can communicate with the cluster. * `az_distribution` - (Optional) The distribution of broker nodes across availability zones ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-model-brokerazdistribution)). Currently the only valid value is `DEFAULT`. @@ -339,7 +338,7 @@ In addition to all arguments above, the following attributes are exported: * `create` - (Default `120m`) * `update` - (Default `120m`) -Note that the `update` timeout is used separately for `ebs_volume_size`, `instance_type`, `number_of_broker_nodes`, `configuration_info`, `kafka_version` and monitoring and logging update timeouts. +Note that the `update` timeout is used separately for `storage_info`, `instance_type`, `number_of_broker_nodes`, `configuration_info`, `kafka_version` and monitoring and logging update timeouts. * `delete` - (Default `120m`) ## Import From 9b5c3e93a8c5e2638dba962c3b71b8c356a18fa2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 17:02:25 -0400 Subject: [PATCH 267/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31324.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31324.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31324.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31324.txt From 3c983d2ce9b1dd3e470ee7242e974a9c6c0ef594 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 May 2023 17:21:45 -0400 Subject: [PATCH 268/304] Kafka: Tidy up acceptance test configurations. --- .../kafka/broker_nodes_data_source_test.go | 4 +- .../service/kafka/cluster_data_source_test.go | 4 +- internal/service/kafka/cluster_test.go | 272 ++++++------------ .../kafka/scram_secret_association_test.go | 4 +- 4 files changed, 95 insertions(+), 189 deletions(-) diff --git a/internal/service/kafka/broker_nodes_data_source_test.go b/internal/service/kafka/broker_nodes_data_source_test.go index a46c936d793c..0899333e850e 100644 --- a/internal/service/kafka/broker_nodes_data_source_test.go +++ b/internal/service/kafka/broker_nodes_data_source_test.go @@ -44,9 +44,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.t3.small" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { diff --git a/internal/service/kafka/cluster_data_source_test.go b/internal/service/kafka/cluster_data_source_test.go index fd3bd7deaa71..455d86d8dfda 100644 --- a/internal/service/kafka/cluster_data_source_test.go +++ b/internal/service/kafka/cluster_data_source_test.go @@ -53,9 +53,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index 471f7bd8cc0c..b2327bce1be2 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -72,15 +72,15 @@ func TestAccKafkaCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.az_distribution", kafka.BrokerAZDistributionDefault), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.client_subnets.#", "3"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az1", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az2", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az3", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.0", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.1", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.2", "id"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.connectivity_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.connectivity_info.0.public_access.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.connectivity_info.0.public_access.0.type", "DISABLED"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.instance_type", "kafka.m5.large"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.security_groups.#", "1"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.security_groups.*", "aws_security_group.example_sg", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.security_groups.*", "aws_security_group.test", "id"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.storage_info.0.ebs_storage_info.#", "1"), @@ -825,9 +825,9 @@ func TestAccKafkaCluster_numberOfBrokerNodes(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers_tls", clusterBoostrapBrokersTLSRegexp), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.client_subnets.#", "3"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az1", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az2", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az3", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.0", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.1", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.2", "id"), resource.TestCheckResourceAttr(resourceName, "number_of_broker_nodes", "3"), testAccCheckResourceAttrIsSortedCSV(resourceName, "bootstrap_brokers_tls"), ), @@ -850,9 +850,9 @@ func TestAccKafkaCluster_numberOfBrokerNodes(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers_tls", clusterBoostrapBrokersTLSRegexp), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.client_subnets.#", "3"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az1", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az2", "id"), - resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.example_subnet_az3", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.0", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.1", "id"), + resource.TestCheckTypeSetElemAttrPair(resourceName, "broker_node_group_info.0.client_subnets.*", "aws_subnet.test.2", "id"), resource.TestCheckResourceAttr(resourceName, "number_of_broker_nodes", "6"), testAccCheckResourceAttrIsSortedCSV(resourceName, "bootstrap_brokers_tls"), ), @@ -1231,47 +1231,10 @@ func testAccPreCheck(ctx context.Context, t *testing.T) { } func testAccClusterConfig_base(rName string) string { - return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -resource "aws_vpc" "example_vpc" { - cidr_block = "192.168.0.0/22" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_subnet_az1" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.0.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_subnet_az2" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.1.0/24" - availability_zone = data.aws_availability_zones.available.names[1] - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_subnet_az3" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.2.0/24" - availability_zone = data.aws_availability_zones.available.names[2] - - tags = { - Name = %[1]q - } -} - -resource "aws_security_group" "example_sg" { - vpc_id = aws_vpc.example_vpc.id + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 3), fmt.Sprintf(` +resource "aws_security_group" "test" { + name = %[1]q + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1280,69 +1243,22 @@ resource "aws_security_group" "example_sg" { `, rName)) } -func testAccClusterBasePublicAccessConfig(rName string) string { +func testAccClusterConfig_basePublicAccess(rName string) string { return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -resource "aws_vpc" "example_vpc" { - cidr_block = "192.168.0.0/21" +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" tags = { Name = %[1]q } } -resource "aws_subnet" "example_subnet_az1" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.0.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - - tags = { - Name = %[1]q - } -} +resource "aws_subnet" "test" { + count = 3 -resource "aws_subnet" "example_subnet_az2" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.1.0/24" - availability_zone = data.aws_availability_zones.available.names[1] - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_subnet_az3" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.2.0/24" - availability_zone = data.aws_availability_zones.available.names[2] - - tags = { - Name = %[1]q - } -} - -resource "aws_security_group" "example_sg" { - vpc_id = aws_vpc.example_vpc.id - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_public_subnet_az1" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.3.0/24" - availability_zone = data.aws_availability_zones.available.names[0] - map_public_ip_on_launch = true - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "example_public_subnet_az2" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.4.0/24" - availability_zone = data.aws_availability_zones.available.names[1] + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[count.index] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) map_public_ip_on_launch = true tags = { @@ -1350,31 +1266,29 @@ resource "aws_subnet" "example_public_subnet_az2" { } } -resource "aws_subnet" "example_public_subnet_az3" { - vpc_id = aws_vpc.example_vpc.id - cidr_block = "192.168.5.0/24" - availability_zone = data.aws_availability_zones.available.names[2] - map_public_ip_on_launch = true +resource "aws_security_group" "test" { + name = %[1]q + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_internet_gateway" "example_igw" { - vpc_id = aws_vpc.example_vpc.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_route_table" "example_route_tbl" { - vpc_id = aws_vpc.example_vpc.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id route { cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.example_igw.id + gateway_id = aws_internet_gateway.test.id } tags = { @@ -1382,19 +1296,11 @@ resource "aws_route_table" "example_route_tbl" { } } -resource "aws_route_table_association" "route_tbl_assoc_1" { - subnet_id = aws_subnet.example_public_subnet_az1.id - route_table_id = aws_route_table.example_route_tbl.id -} - -resource "aws_route_table_association" "route_tbl_assoc_2" { - subnet_id = aws_subnet.example_public_subnet_az2.id - route_table_id = aws_route_table.example_route_tbl.id -} +resource "aws_route_table_association" "test" { + count = 3 -resource "aws_route_table_association" "route_tbl_assoc_3" { - subnet_id = aws_subnet.example_public_subnet_az3.id - route_table_id = aws_route_table.example_route_tbl.id + subnet_id = aws_subnet.test[count.index].id + route_table_id = aws_route_table.test.id } `, rName)) } @@ -1407,9 +1313,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1429,9 +1335,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = %[3]q - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { volume_size = %[2]d @@ -1450,9 +1356,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = %[3]q - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { provisioned_throughput { @@ -1474,9 +1380,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = %[3]q - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { provisioned_throughput { @@ -1499,9 +1405,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = %[2]q - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1513,7 +1419,7 @@ resource "aws_msk_cluster" "test" { `, rName, t)) } -func testAccConfigurationAllowEveryoneNoACLFoundFalse(rName string) string { +func testAccClusterConfig_allowEveryoneNoACLFoundFalse(rName string) string { return fmt.Sprintf(` resource "aws_msk_configuration" "test" { kafka_versions = ["2.7.1"] @@ -1527,8 +1433,8 @@ resource "aws_msk_configuration" "test" { func testAccClusterConfig_brokerNodeGroupInfoNoPublicAccessSASLIAM(rName string) string { return acctest.ConfigCompose( - testAccClusterBasePublicAccessConfig(rName), - testAccConfigurationAllowEveryoneNoACLFoundFalse(rName), + testAccClusterConfig_basePublicAccess(rName), + testAccClusterConfig_allowEveryoneNoACLFoundFalse(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q @@ -1536,9 +1442,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_public_subnet_az1.id, aws_subnet.example_public_subnet_az2.id, aws_subnet.example_public_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1563,8 +1469,8 @@ resource "aws_msk_cluster" "test" { func testAccClusterConfig_brokerNodeGroupInfoPublicAccessSASLIAM(rName string, pa string) string { return acctest.ConfigCompose( - testAccClusterBasePublicAccessConfig(rName), - testAccConfigurationAllowEveryoneNoACLFoundFalse(rName), + testAccClusterConfig_basePublicAccess(rName), + testAccClusterConfig_allowEveryoneNoACLFoundFalse(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q @@ -1572,9 +1478,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_public_subnet_az1.id, aws_subnet.example_public_subnet_az2.id, aws_subnet.example_public_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1632,9 +1538,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1674,9 +1580,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1703,9 +1609,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1733,9 +1639,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1772,9 +1678,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1817,9 +1723,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1852,9 +1758,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1878,9 +1784,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1906,9 +1812,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1935,9 +1841,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1958,9 +1864,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -1980,9 +1886,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = %[2]d broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2002,9 +1908,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2105,9 +2011,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2153,9 +2059,9 @@ resource "aws_msk_cluster" "test" { } broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2197,9 +2103,9 @@ resource "aws_msk_cluster" "test" { } broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2224,9 +2130,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { @@ -2250,9 +2156,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.m5.large" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { diff --git a/internal/service/kafka/scram_secret_association_test.go b/internal/service/kafka/scram_secret_association_test.go index c8e30c212274..9569947dc58b 100644 --- a/internal/service/kafka/scram_secret_association_test.go +++ b/internal/service/kafka/scram_secret_association_test.go @@ -194,9 +194,9 @@ resource "aws_msk_cluster" "test" { number_of_broker_nodes = 3 broker_node_group_info { - client_subnets = [aws_subnet.example_subnet_az1.id, aws_subnet.example_subnet_az2.id, aws_subnet.example_subnet_az3.id] + client_subnets = aws_subnet.test[*].id instance_type = "kafka.t3.small" - security_groups = [aws_security_group.example_sg.id] + security_groups = [aws_security_group.test.id] storage_info { ebs_storage_info { From ed881ea8d77581e4544fd00afa853eb093116487 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 07:58:53 -0400 Subject: [PATCH 269/304] Use 'extended_s3_configuration' in 'aws_kinesis_firehose_delivery_stream' configuration. --- internal/service/kafka/cluster_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index b2327bce1be2..344981d563fe 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -1959,11 +1959,6 @@ resource "aws_s3_bucket" "bucket" { force_destroy = true } -resource "aws_s3_bucket_acl" "test" { - bucket = aws_s3_bucket.bucket.id - acl = "private" -} - resource "aws_iam_role" "firehose_role" { name = %[1]q @@ -1986,9 +1981,9 @@ EOF resource "aws_kinesis_firehose_delivery_stream" "test" { name = %[1]q - destination = "s3" + destination = "extended_s3" - s3_configuration { + extended_s3_configuration { role_arn = aws_iam_role.firehose_role.arn bucket_arn = aws_s3_bucket.bucket.arn } From e4070d83daf8c6ae8f9745e7b1381645c9a60222 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 08:01:29 -0400 Subject: [PATCH 270/304] Add Terraform AWS Provider Version 5 Upgrade Guide entry. --- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 59819f7f9d9b..8b15f35a05f9 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -31,6 +31,7 @@ Upgrade topics: - [Resource: aws_docdb_cluster](#resource-aws_docdb_cluster) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) - [Resource: aws_ec2_client_vpn_network_association](#resource-aws_ec2_client_vpn_network_association) +- [Resource: aws_msk_cluster](#resource-aws_msk_cluster) - [Resource: aws_neptune_cluster](#resource-aws_neptune_cluster) - [Resource: aws_rds_cluster](#resource-aws_rds_cluster) @@ -129,6 +130,10 @@ The `status` attribute has been removed. The `status` attribute has been removed. +## Resource: aws_msk_cluster + +The `broker_node_group_info.ebs_volume_size` attribute has been removed. + ## Resource: aws_neptune_cluster Changes to the `snapshot_identifier` attribute will now correctly force re-creation of the resource. Previously, changing this attribute would result in a successful apply, but without the cluster being restored (only the resource state was changed). This change brings behavior of the cluster `snapshot_identifier` attribute into alignment with other RDS resources, such as `aws_db_instance`. From 40c4627b611045b4aa609eb9e15c00ff381ad29d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 08:28:18 -0400 Subject: [PATCH 271/304] Fix Kendra documentation links. --- website/docs/d/kendra_index.html.markdown | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/website/docs/d/kendra_index.html.markdown b/website/docs/d/kendra_index.html.markdown index 3777e1c25884..cd8ad09af06e 100644 --- a/website/docs/d/kendra_index.html.markdown +++ b/website/docs/d/kendra_index.html.markdown @@ -42,15 +42,14 @@ In addition to all of the arguments above, the following attributes are exported * `server_side_encryption_configuration` - A block that specifies the identifier of the AWS KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs. Documented below. * `status` - Current status of the index. When the value is `ACTIVE`, the index is ready for use. If the Status field value is `FAILED`, the `error_message` field contains a message that explains why. * `updated_at` - Unix datetime that the index was last updated. -* `user_context_policy` - User context policy. Valid values are `ATTRIBUTE_FILTER` or `USER_TOKEN`. For more information, refer to [UserContextPolicy](https://docs.aws.amazon.com/kendra/latest/dg/API_CreateIndex. -html#Kendra-CreateIndex-request-UserContextPolicy). +* `user_context_policy` - User context policy. Valid values are `ATTRIBUTE_FILTER` or `USER_TOKEN`. For more information, refer to [UserContextPolicy](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateIndex.html#kendra-CreateIndex-request-UserContextPolicy). * `user_group_resolution_configuration` - A block that enables fetching access levels of groups and users from an AWS Single Sign-On identity source. Documented below. * `user_token_configurations` - A block that specifies the user token configuration. Documented below. * `tags` - Metadata that helps organize the Indices you create. A `capacity_units` block supports the following attributes: -* `query_capacity_units` - The amount of extra query capacity for an index and GetQuerySuggestions capacity. For more information, refer to [QueryCapacityUnits](https://docs.aws.amazon.com/kendra/latest/dg/API_CapacityUnitsConfiguration.html#Kendra-Type-CapacityUnitsConfiguration-QueryCapacityUnits). +* `query_capacity_units` - The amount of extra query capacity for an index and GetQuerySuggestions capacity. For more information, refer to [QueryCapacityUnits](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CapacityUnitsConfiguration.html#Kendra-Type-CapacityUnitsConfiguration-QueryCapacityUnits). * `storage_capacity_units` - The amount of extra storage capacity for an index. A single capacity unit provides 30 GB of storage space or 100,000 documents, whichever is reached first. Minimum value of 0. A `document_metadata_configuration_updates` block supports the following attributes: @@ -62,11 +61,11 @@ A `document_metadata_configuration_updates` block supports the following attribu A `relevance` block supports the following attributes: -* `duration` - Time period that the boost applies to. For more information, refer to [Duration](https://docs.aws.amazon.com/kendra/latest/dg/API_Relevance.html#Kendra-Type-Relevance-Duration). -* `freshness` - How "fresh" a document is. For more information, refer to [Freshness](https://docs.aws.amazon.com/kendra/latest/dg/API_Relevance.html#Kendra-Type-Relevance-Freshness). +* `duration` - Time period that the boost applies to. For more information, refer to [Duration](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Relevance.html#Kendra-Type-Relevance-Duration). +* `freshness` - How "fresh" a document is. For more information, refer to [Freshness](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Relevance.html#Kendra-Type-Relevance-Freshness). * `importance` - Relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers. Minimum value of 1. Maximum value of 10. -* `rank_order` - Determines how values should be interpreted. For more information, refer to [RankOrder](https://docs.aws.amazon.com/kendra/latest/dg/API_Relevance.html#Kendra-Type-Relevance-RankOrder). -* `values_importance_map` - A list of values that should be given a different boost when they appear in the result list. For more information, refer to [ValueImportanceMap](https://docs.aws.amazon.com/kendra/latest/dg/API_Relevance.html#Kendra-Type-Relevance-ValueImportanceMap). +* `rank_order` - Determines how values should be interpreted. For more information, refer to [RankOrder](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Relevance.html#Kendra-Type-Relevance-RankOrder). +* `values_importance_map` - A list of values that should be given a different boost when they appear in the result list. For more information, refer to [ValueImportanceMap](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Relevance.html#Kendra-Type-Relevance-ValueImportanceMap). A `search` block supports the following attributes: From 1d3ae40cffe576528a6faa88e8530e030c86b595 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 12:17:34 -0400 Subject: [PATCH 272/304] Fix golangci-lint 'unused'. --- internal/service/eks/addon_test.go | 9 --------- internal/service/kafka/cluster_test.go | 21 --------------------- 2 files changed, 30 deletions(-) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 5edc28eb573f..503e7c0a9b96 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -6,7 +6,6 @@ import ( "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -473,14 +472,6 @@ func testAccPreCheckAddon(ctx context.Context, t *testing.T) { } } -func testAccCheckAddonUpdateTags(ctx context.Context, addon *eks.Addon, oldTags, newTags map[string]string) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).EKSConn() - - return tfeks.UpdateTags(ctx, conn, aws.StringValue(addon.AddonArn), oldTags, newTags) - } -} - func testAccAddonConfig_base(rName string) string { return acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` data "aws_partition" "current" {} diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index 344981d563fe..e1da19d97ff3 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -1327,27 +1327,6 @@ resource "aws_msk_cluster" "test" { `, rName)) } -func testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeOnly(rName string, ebsVolumeSize int, instanceType string) string { - return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` -resource "aws_msk_cluster" "test" { - cluster_name = %[1]q - kafka_version = "2.7.1" - number_of_broker_nodes = 3 - - broker_node_group_info { - client_subnets = aws_subnet.test[*].id - instance_type = %[3]q - security_groups = [aws_security_group.test.id] - storage_info { - ebs_storage_info { - volume_size = %[2]d - } - } - } -} -`, rName, ebsVolumeSize, instanceType)) -} - func testAccClusterConfig_brokerNodeGroupInfoStorageInfoVolumeSizeSetAndProvThroughputNotEnabled(rName string, ebsVolumeSize int, instanceType string) string { return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_msk_cluster" "test" { From c9b0bdc54a98cf887cf06b27882ef0a62c63ae86 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 11 May 2023 17:06:38 +0000 Subject: [PATCH 273/304] Update CHANGELOG.md for #31324 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35948f240e7c..cdf6870053ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ NOTES: * resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_guardduty_organization_configuration: The `auto_enable` argument has been deprecated. Use the `auto_enable_organization_members` argument instead. ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) +* resource/aws_msk_cluster: The `broker_node_group_info.ebs_volume_size` attribute has been removed ([#31324](https://github.com/hashicorp/terraform-provider-aws/issues/31324)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From e0186e66123df8a475047e9f2139374603ff81cc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 14:02:58 -0400 Subject: [PATCH 274/304] Correctly note breaking changes. --- .changelog/31312.txt | 4 ++-- .changelog/31324.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changelog/31312.txt b/.changelog/31312.txt index 6dab030dd1f8..ed0535188a95 100644 --- a/.changelog/31312.txt +++ b/.changelog/31312.txt @@ -1,7 +1,7 @@ -```release-note:note +```release-note:breaking-change data-source/aws_identitystore_group: The `filter` argument has been removed ``` -```release-note:note +```release-note:breaking-change data-source/aws_identitystore_user: The `filter` argument has been removed ``` \ No newline at end of file diff --git a/.changelog/31324.txt b/.changelog/31324.txt index 3d2a10dca127..49a988673f52 100644 --- a/.changelog/31324.txt +++ b/.changelog/31324.txt @@ -1,3 +1,3 @@ -```release-note:note +```release-note:breaking-change resource/aws_msk_cluster: The `broker_node_group_info.ebs_volume_size` attribute has been removed ``` \ No newline at end of file From 809416acd4fa2effa4ee6aa99df365768c4ca452 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 14:50:30 -0400 Subject: [PATCH 275/304] r/aws_ecs_cluster: Remove 'capacity_providers'. --- .changelog/#####.txt | 3 + internal/service/ecs/cluster.go | 20 +- internal/service/ecs/cluster_test.go | 261 ------------------ internal/service/ecs/service_test.go | 100 ------- internal/service/ecs/task_set_test.go | 126 --------- website/docs/guides/version-5-upgrade.html.md | 5 + website/docs/r/ecs_cluster.html.markdown | 31 --- ...s_cluster_capacity_providers.html.markdown | 2 - 8 files changed, 9 insertions(+), 539 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..cc5b281775a5 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_ecs_cluster: The `capacity_providers` attribute has been removed +``` \ No newline at end of file diff --git a/internal/service/ecs/cluster.go b/internal/service/ecs/cluster.go index 21191517ee60..385932978cc3 100644 --- a/internal/service/ecs/cluster.go +++ b/internal/service/ecs/cluster.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/errs" "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" - "github.com/hashicorp/terraform-provider-aws/internal/flex" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/internal/verify" @@ -43,15 +42,6 @@ func ResourceCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "capacity_providers": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Deprecated: "Use the aws_ecs_cluster_capacity_providers resource instead", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, "configuration": { Type: schema.TypeList, Optional: true, @@ -199,10 +189,6 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int Tags: GetTagsIn(ctx), } - if v, ok := d.GetOk("capacity_providers"); ok { - input.CapacityProviders = flex.ExpandStringSet(v.(*schema.Set)) - } - if v, ok := d.GetOk("configuration"); ok && len(v.([]interface{})) > 0 { input.Configuration = expandClusterConfiguration(v.([]interface{})) } @@ -275,9 +261,6 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter d.Set("arn", cluster.ClusterArn) d.Set("name", cluster.ClusterName) - if err := d.Set("capacity_providers", aws.StringValueSlice(cluster.CapacityProviders)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting capacity_providers: %s", err) - } if err := d.Set("default_capacity_provider_strategy", flattenCapacityProviderStrategy(cluster.DefaultCapacityProviderStrategy)); err != nil { return sdkdiag.AppendErrorf(diags, "setting default_capacity_provider_strategy: %s", err) } @@ -336,10 +319,9 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int } } - if d.HasChanges("capacity_providers", "default_capacity_provider_strategy") { + if d.HasChanges("default_capacity_provider_strategy") { input := ecs.PutClusterCapacityProvidersInput{ Cluster: aws.String(d.Id()), - CapacityProviders: flex.ExpandStringSet(d.Get("capacity_providers").(*schema.Set)), DefaultCapacityProviderStrategy: expandCapacityProviderStrategy(d.Get("default_capacity_provider_strategy").(*schema.Set)), } diff --git a/internal/service/ecs/cluster_test.go b/internal/service/ecs/cluster_test.go index f5ad0a79ba3e..e93ae82e9ced 100644 --- a/internal/service/ecs/cluster_test.go +++ b/internal/service/ecs/cluster_test.go @@ -32,7 +32,6 @@ func TestAccECSCluster_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &v), acctest.CheckResourceAttrRegionalARN(resourceName, "arn", "ecs", fmt.Sprintf("cluster/%s", rName)), - resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "0"), resource.TestCheckResourceAttr(resourceName, "configuration.#", "0"), resource.TestCheckResourceAttr(resourceName, "default_capacity_provider_strategy.#", "0"), resource.TestCheckResourceAttr(resourceName, "name", rName), @@ -167,140 +166,6 @@ func TestAccECSCluster_serviceConnectDefaults(t *testing.T) { }) } -func TestAccECSCluster_singleCapacityProvider(t *testing.T) { - ctx := acctest.Context(t) - var cluster1 ecs.Cluster - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_singleCapacityProvider(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - { - ResourceName: resourceName, - ImportStateId: rName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccECSCluster_capacityProviders(t *testing.T) { - ctx := acctest.Context(t) - var cluster ecs.Cluster - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_capacityProviders(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster), - ), - }, - { - ResourceName: resourceName, - ImportStateId: rName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccClusterConfig_capacityProvidersReOrdered(rName), - PlanOnly: true, - }, - }, - }) -} - -func TestAccECSCluster_capacityProvidersUpdate(t *testing.T) { - ctx := acctest.Context(t) - var cluster1 ecs.Cluster - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_capacityProvidersFargate(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - { - ResourceName: resourceName, - ImportStateId: rName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccClusterConfig_capacityProvidersFargateSpot(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - { - Config: testAccClusterConfig_capacityProvidersFargateBoth(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - }, - }) -} - -func TestAccECSCluster_capacityProvidersNoStrategy(t *testing.T) { - ctx := acctest.Context(t) - var cluster1 ecs.Cluster - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccClusterConfig_capacityProvidersFargateNoStrategy(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - { - ResourceName: resourceName, - ImportStateId: rName, - ImportState: true, - ImportStateVerify: true, - }, - { - Config: testAccClusterConfig_capacityProvidersFargateSpotNoStrategy(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName, &cluster1), - ), - }, - }, - }) -} - func TestAccECSCluster_containerInsights(t *testing.T) { ctx := acctest.Context(t) var cluster1 ecs.Cluster @@ -510,132 +375,6 @@ resource "aws_ecs_capacity_provider" "test" { `, rName)) } -func testAccClusterConfig_singleCapacityProvider(rName string) string { - return acctest.ConfigCompose(testAccClusterCapacityProviderConfig_base(rName), fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = [aws_ecs_capacity_provider.test.name] - - default_capacity_provider_strategy { - base = 1 - capacity_provider = aws_ecs_capacity_provider.test.name - weight = 1 - } -} -`, rName)) -} - -func testAccClusterConfig_capacityProviders(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE_SPOT", "FARGATE"] - - default_capacity_provider_strategy { - capacity_provider = "FARGATE_SPOT" - weight = 1 - base = 1 - } - - default_capacity_provider_strategy { - capacity_provider = "FARGATE" - weight = 1 - } -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersReOrdered(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE", "FARGATE_SPOT"] - - default_capacity_provider_strategy { - capacity_provider = "FARGATE" - weight = 1 - } - - default_capacity_provider_strategy { - capacity_provider = "FARGATE_SPOT" - weight = 1 - base = 1 - } -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersFargate(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE"] - - default_capacity_provider_strategy { - base = 1 - capacity_provider = "FARGATE" - weight = 1 - } -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersFargateSpot(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE_SPOT"] - - default_capacity_provider_strategy { - base = 1 - capacity_provider = "FARGATE_SPOT" - weight = 1 - } -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersFargateBoth(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE", "FARGATE_SPOT"] - - default_capacity_provider_strategy { - base = 1 - capacity_provider = "FARGATE_SPOT" - weight = 1 - } -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersFargateNoStrategy(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE"] -} -`, rName) -} - -func testAccClusterConfig_capacityProvidersFargateSpotNoStrategy(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "test" { - name = %[1]q - - capacity_providers = ["FARGATE_SPOT"] -} -`, rName) -} - func testAccClusterConfig_containerInsights(rName, value string) string { return fmt.Sprintf(` resource "aws_ecs_cluster" "test" { diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index 58c1ae51bf88..ae9c59efd83d 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -303,29 +303,6 @@ func TestAccECSService_CapacityProviderStrategy_update(t *testing.T) { }) } -func TestAccECSService_CapacityProviderStrategy_multiple(t *testing.T) { - ctx := acctest.Context(t) - var service ecs.Service - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_service.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckServiceDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccServiceConfig_multipleCapacityProviderStrategies(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckServiceExists(ctx, resourceName, &service), - resource.TestCheckResourceAttr(resourceName, "capacity_provider_strategy.#", "2"), - ), - }, - }, - }) -} - func TestAccECSService_familyAndRevision(t *testing.T) { ctx := acctest.Context(t) var service ecs.Service @@ -2076,83 +2053,6 @@ resource "aws_ecs_service" "test" { `, rName)) } -func testAccServiceConfig_multipleCapacityProviderStrategies(rName string) string { - return acctest.ConfigCompose(testAccClusterConfig_capacityProviders(rName), fmt.Sprintf(` -resource "aws_ecs_service" "test" { - name = %[1]q - cluster = aws_ecs_cluster.test.id - task_definition = aws_ecs_task_definition.test.arn - desired_count = 1 - - network_configuration { - security_groups = [aws_security_group.allow_all.id] - subnets = [aws_subnet.test.id] - assign_public_ip = false - } - - capacity_provider_strategy { - capacity_provider = "FARGATE" - weight = 1 - } - capacity_provider_strategy { - capacity_provider = "FARGATE_SPOT" - weight = 1 - } -} - -resource "aws_ecs_task_definition" "test" { - family = %[1]q - network_mode = "awsvpc" - requires_compatibilities = ["FARGATE"] - cpu = "256" - memory = "512" - - container_definitions = < **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone [`aws_ecs_cluster_capacity_providers`](/docs/providers/aws/r/ecs_cluster_capacity_providers.html) resource, as well as allowing the capacity providers and default strategies to be managed in-line by the `aws_ecs_cluster` resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, nor use more than one Capacity Providers resource with a single Cluster, as doing so will cause a conflict and will lead to mutual overwrites. - ## Example Usage ```terraform @@ -54,39 +52,10 @@ resource "aws_ecs_cluster" "test" { } ``` -### Example with Capacity Providers - -```terraform -resource "aws_ecs_cluster" "example" { - name = "example" -} - -resource "aws_ecs_cluster_capacity_providers" "example" { - cluster_name = aws_ecs_cluster.example.name - - capacity_providers = [aws_ecs_capacity_provider.example.name] - - default_capacity_provider_strategy { - base = 1 - weight = 100 - capacity_provider = aws_ecs_capacity_provider.example.name - } -} - -resource "aws_ecs_capacity_provider" "example" { - name = "example" - - auto_scaling_group_provider { - auto_scaling_group_arn = aws_autoscaling_group.example.arn - } -} -``` - ## Argument Reference The following arguments are supported: -* `capacity_providers` - (Optional, **Deprecated** use the `aws_ecs_cluster_capacity_providers` resource instead) List of short names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`. * `configuration` - (Optional) The execute command configuration for the cluster. Detailed below. * `default_capacity_provider_strategy` - (Optional, **Deprecated** use the `aws_ecs_cluster_capacity_providers` resource instead) Configuration block for capacity provider strategy to use by default for the cluster. Can be one or more. Detailed below. * `name` - (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores) diff --git a/website/docs/r/ecs_cluster_capacity_providers.html.markdown b/website/docs/r/ecs_cluster_capacity_providers.html.markdown index 88ecb30c7a51..24b8f3e84625 100644 --- a/website/docs/r/ecs_cluster_capacity_providers.html.markdown +++ b/website/docs/r/ecs_cluster_capacity_providers.html.markdown @@ -12,8 +12,6 @@ Manages the capacity providers of an ECS Cluster. More information about capacity providers can be found in the [ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html). -~> **NOTE on Clusters and Cluster Capacity Providers:** Terraform provides both a standalone `aws_ecs_cluster_capacity_providers` resource, as well as allowing the capacity providers and default strategies to be managed in-line by the [`aws_ecs_cluster`](/docs/providers/aws/r/ecs_cluster.html) resource. You cannot use a Cluster with in-line capacity providers in conjunction with the Capacity Providers resource, nor use more than one Capacity Providers resource with a single Cluster, as doing so will cause a conflict and will lead to mutual overwrites. - ## Example Usage ```terraform From e68fff4460e98473d955178b52964941a8a51788 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 14:57:49 -0400 Subject: [PATCH 276/304] r/aws_ecs_cluster: Remove 'default_capacity_provider_strategy'. --- .changelog/#####.txt | 2 +- internal/service/ecs/cluster.go | 50 +------------------ website/docs/guides/version-5-upgrade.html.md | 2 +- website/docs/r/ecs_cluster.html.markdown | 7 --- 4 files changed, 4 insertions(+), 57 deletions(-) diff --git a/.changelog/#####.txt b/.changelog/#####.txt index cc5b281775a5..6867171fcd97 100644 --- a/.changelog/#####.txt +++ b/.changelog/#####.txt @@ -1,3 +1,3 @@ ```release-note:breaking-change -resource/aws_ecs_cluster: The `capacity_providers` attribute has been removed +resource/aws_ecs_cluster: The `capacity_providers` and `default_capacity_provider_strategy` attributes have been removed ``` \ No newline at end of file diff --git a/internal/service/ecs/cluster.go b/internal/service/ecs/cluster.go index 385932978cc3..9e4f1dd774da 100644 --- a/internal/service/ecs/cluster.go +++ b/internal/service/ecs/cluster.go @@ -98,30 +98,6 @@ func ResourceCluster() *schema.Resource { }, }, }, - "default_capacity_provider_strategy": { - Type: schema.TypeSet, - Optional: true, - Computed: true, - Deprecated: "Use the aws_ecs_cluster_capacity_providers resource instead", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "base": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validation.IntBetween(0, 100000), - }, - "capacity_provider": { - Type: schema.TypeString, - Required: true, - }, - "weight": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validation.IntBetween(0, 1000), - }, - }, - }, - }, "name": { Type: schema.TypeString, Required: true, @@ -184,9 +160,8 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int clusterName := d.Get("name").(string) input := &ecs.CreateClusterInput{ - ClusterName: aws.String(clusterName), - DefaultCapacityProviderStrategy: expandCapacityProviderStrategy(d.Get("default_capacity_provider_strategy").(*schema.Set)), - Tags: GetTagsIn(ctx), + ClusterName: aws.String(clusterName), + Tags: GetTagsIn(ctx), } if v, ok := d.GetOk("configuration"); ok && len(v.([]interface{})) > 0 { @@ -261,10 +236,6 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter d.Set("arn", cluster.ClusterArn) d.Set("name", cluster.ClusterName) - if err := d.Set("default_capacity_provider_strategy", flattenCapacityProviderStrategy(cluster.DefaultCapacityProviderStrategy)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting default_capacity_provider_strategy: %s", err) - } - if cluster.ServiceConnectDefaults != nil { if err := d.Set("service_connect_defaults", []interface{}{flattenClusterServiceConnectDefaults(cluster.ServiceConnectDefaults)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting service_connect_defaults: %s", err) @@ -319,23 +290,6 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int } } - if d.HasChanges("default_capacity_provider_strategy") { - input := ecs.PutClusterCapacityProvidersInput{ - Cluster: aws.String(d.Id()), - DefaultCapacityProviderStrategy: expandCapacityProviderStrategy(d.Get("default_capacity_provider_strategy").(*schema.Set)), - } - - err := retryClusterCapacityProvidersPut(ctx, conn, &input) - - if err != nil { - return diag.Errorf("updating ECS Cluster (%s) capacity providers: %s", d.Id(), err) - } - - if _, err := waitClusterAvailable(ctx, conn, d.Id()); err != nil { - return diag.Errorf("waiting for ECS Cluster (%s) capacity providers update: %s", d.Id(), err) - } - } - return nil } diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index cdb4aa130f5b..b7a20def536c 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -133,7 +133,7 @@ The `status` attribute has been removed. ## Resource: aws_ecs_cluster -The `capacity_providers` attribute has been removed. +The `capacity_providers` and `default_capacity_provider_strategy` attributes have been removed. ## Resource: aws_msk_cluster diff --git a/website/docs/r/ecs_cluster.html.markdown b/website/docs/r/ecs_cluster.html.markdown index a9dc85eb2f70..096496f4f66c 100644 --- a/website/docs/r/ecs_cluster.html.markdown +++ b/website/docs/r/ecs_cluster.html.markdown @@ -57,7 +57,6 @@ resource "aws_ecs_cluster" "test" { The following arguments are supported: * `configuration` - (Optional) The execute command configuration for the cluster. Detailed below. -* `default_capacity_provider_strategy` - (Optional, **Deprecated** use the `aws_ecs_cluster_capacity_providers` resource instead) Configuration block for capacity provider strategy to use by default for the cluster. Can be one or more. Detailed below. * `name` - (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores) * `service_connect_defaults` - (Optional) Configures a default Service Connect namespace. Detailed below. * `setting` - (Optional) Configuration block(s) with cluster settings. For example, this can be used to enable CloudWatch Container Insights for a cluster. Detailed below. @@ -81,12 +80,6 @@ The following arguments are supported: * `s3_bucket_encryption_enabled` - (Optional) Whether or not to enable encryption on the logs sent to S3. If not specified, encryption will be disabled. * `s3_key_prefix` - (Optional) An optional folder in the S3 bucket to place logs in. -### `default_capacity_provider_strategy` - -* `capacity_provider` - (Required) The short name of the capacity provider. -* `weight` - (Optional) The relative percentage of the total number of launched tasks that should use the specified capacity provider. -* `base` - (Optional) The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. - ### `setting` * `name` - (Required) Name of the setting to manage. Valid values: `containerInsights`. From 08cd20a7549a148092c24d835a513f797b63b3c8 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 11 May 2023 14:00:56 -0500 Subject: [PATCH 277/304] default tags: add changelog and upgrade guide entry (#31343) * add CHANGELOG entry * add default tags to upgrade guide * fix typo --- .changelog/30793.txt | 11 +++++++++++ website/docs/guides/version-5-upgrade.html.md | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 .changelog/30793.txt diff --git a/.changelog/30793.txt b/.changelog/30793.txt new file mode 100644 index 000000000000..d659458feca8 --- /dev/null +++ b/.changelog/30793.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +provider: Duplicate `default_tags` can now be included and will be overwritten by resource `tags` +``` + +```release-note:enhancement +provider: Allow `default_tags` and resource `tags` to include zero values `""` +``` + +```release-note:enhancement +provider: Allow `computed` `tags` on resources +``` \ No newline at end of file diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 8b15f35a05f9..e3c918ec36d0 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -18,6 +18,7 @@ Upgrade topics: - [Provider Version Configuration](#provider-version-configuration) - [Provider Arguments](#provider-arguments) +- [Default Tags](#default-tags) - [Data Source: aws_api_gateway_rest_api](#data-source-aws_api_gateway_rest_api) - [Data Source: aws_identitystore_group](#data-source-aws_identitystore_group) - [Data Source: aws_identitystore_user](#data-source-aws_identitystore_user) @@ -167,6 +168,14 @@ The [`aws_redshift_service_account`](/docs/providers/aws/d/redshift_service_acco The `aws_subnet_ids` data source has been removed. Use the [`aws_subnets`](/docs/providers/aws/d/subnets.html) data source instead. +## Default Tags + +The following enhancements are included: + +* Duplicate `default_tags` can now be included and will be overwritten by resource `tags`. +* Zero value tags, `""`, can now be included in both `default_tags` and resource `tags`. +* Tags can now be `computed`. + ## EC2-Classic Retirement Following the retirement of EC2-Classic a number of resources and attributes have been removed. From c43c6699a60d98fef2acc3bcc564a7257b741ea3 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 11 May 2023 19:03:51 +0000 Subject: [PATCH 278/304] Update CHANGELOG.md for #31343 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf6870053ab..73c4fb30044a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,9 @@ NOTES: ENHANCEMENTS: +* provider: Allow `computed` `tags` on resources ([#30793](https://github.com/hashicorp/terraform-provider-aws/issues/30793)) +* provider: Allow `default_tags` and resource `tags` to include zero values `""` ([#30793](https://github.com/hashicorp/terraform-provider-aws/issues/30793)) +* provider: Duplicate `default_tags` can now be included and will be overwritten by resource `tags` ([#30793](https://github.com/hashicorp/terraform-provider-aws/issues/30793)) * resource/aws_guardduty_organization_configuration: Add `auto_enable_organization_members` attribute ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) * resource/aws_kinesis_firehose_delivery_stream: Add `s3_configuration` to `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` ([#31138](https://github.com/hashicorp/terraform-provider-aws/issues/31138)) From 3365c9c8f103933e49c751811d0f67506e0c22f1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 15:12:02 -0400 Subject: [PATCH 279/304] r/aws_ecs_cluster: Tidy up resource Delete. --- internal/service/ecs/cluster.go | 165 +++++++++++++++++++++++--------- internal/service/ecs/find.go | 53 ---------- internal/service/ecs/status.go | 16 ---- internal/service/ecs/wait.go | 35 ------- 4 files changed, 121 insertions(+), 148 deletions(-) diff --git a/internal/service/ecs/cluster.go b/internal/service/ecs/cluster.go index 9e4f1dd774da..63bbf7e75524 100644 --- a/internal/service/ecs/cluster.go +++ b/internal/service/ecs/cluster.go @@ -234,8 +234,12 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter cluster := outputRaw.(*ecs.Cluster) d.Set("arn", cluster.ClusterArn) + if cluster.Configuration != nil { + if err := d.Set("configuration", flattenClusterConfiguration(cluster.Configuration)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting configuration: %s", err) + } + } d.Set("name", cluster.ClusterName) - if cluster.ServiceConnectDefaults != nil { if err := d.Set("service_connect_defaults", []interface{}{flattenClusterServiceConnectDefaults(cluster.ServiceConnectDefaults)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting service_connect_defaults: %s", err) @@ -243,17 +247,10 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter } else { d.Set("service_connect_defaults", nil) } - if err := d.Set("setting", flattenClusterSettings(cluster.Settings)); err != nil { return sdkdiag.AppendErrorf(diags, "setting setting: %s", err) } - if cluster.Configuration != nil { - if err := d.Set("configuration", flattenClusterConfiguration(cluster.Configuration)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting configuration: %s", err) - } - } - SetTagsOut(ctx, cluster.Tags) return diags @@ -262,15 +259,11 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*conns.AWSClient).ECSConn() - if d.HasChanges("setting", "configuration", "service_connect_defaults") { + if d.HasChanges("configuration", "service_connect_defaults", "setting") { input := &ecs.UpdateClusterInput{ Cluster: aws.String(d.Id()), } - if v, ok := d.GetOk("setting"); ok { - input.Settings = expandClusterSettings(v.(*schema.Set)) - } - if v, ok := d.GetOk("configuration"); ok && len(v.([]interface{})) > 0 { input.Configuration = expandClusterConfiguration(v.([]interface{})) } @@ -279,6 +272,10 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int input.ServiceConnectDefaults = expandClusterServiceConnectDefaultsRequest(v.([]interface{})[0].(map[string]interface{})) } + if v, ok := d.GetOk("setting"); ok { + input.Settings = expandClusterSettings(v.(*schema.Set)) + } + _, err := conn.UpdateClusterWithContext(ctx, input) if err != nil { @@ -293,52 +290,132 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int return nil } -func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).ECSConn() +func FindClusterByNameOrARN(ctx context.Context, conn *ecs.ECS, nameOrARN string) (*ecs.Cluster, error) { + input := &ecs.DescribeClustersInput{ + Clusters: aws.StringSlice([]string{nameOrARN}), + Include: aws.StringSlice([]string{ecs.ClusterFieldTags, ecs.ClusterFieldConfigurations, ecs.ClusterFieldSettings}), + } + + output, err := conn.DescribeClustersWithContext(ctx, input) + + // Some partitions (e.g. ISO) may not support tagging. + if errs.IsUnsupportedOperationInPartitionError(conn.PartitionID, err) { + input.Include = aws.StringSlice([]string{ecs.ClusterFieldConfigurations, ecs.ClusterFieldSettings}) - log.Printf("[DEBUG] Deleting ECS cluster %s", d.Id()) - input := &ecs.DeleteClusterInput{ - Cluster: aws.String(d.Id()), + output, err = conn.DescribeClustersWithContext(ctx, input) } - err := retry.RetryContext(ctx, clusterDeleteTimeout, func() *retry.RetryError { - _, err := conn.DeleteClusterWithContext(ctx, input) - if err == nil { - log.Printf("[DEBUG] ECS cluster %s deleted", d.Id()) - return nil - } + // Some partitions (e.g. ISO) may not support describe including configuration. + if errs.IsUnsupportedOperationInPartitionError(conn.PartitionID, err) { + input.Include = aws.StringSlice([]string{ecs.ClusterFieldSettings}) - if tfawserr.ErrCodeEquals(err, "ClusterContainsContainerInstancesException") { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) - return retry.RetryableError(err) + output, err = conn.DescribeClustersWithContext(ctx, input) + } + + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException) { + return nil, &retry.NotFoundError{ + LastError: err, + LastRequest: input, } - if tfawserr.ErrCodeEquals(err, "ClusterContainsServicesException") { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) - return retry.RetryableError(err) + } + + if err != nil { + return nil, err + } + + if output == nil || len(output.Clusters) == 0 || output.Clusters[0] == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if count := len(output.Clusters); count > 1 { + return nil, tfresource.NewTooManyResultsError(count, input) + } + + if status := aws.StringValue(output.Clusters[0].Status); status == clusterStatusInactive { + return nil, &retry.NotFoundError{ + Message: status, + LastRequest: input, } - if tfawserr.ErrCodeEquals(err, "ClusterContainsTasksException") { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) - return retry.RetryableError(err) + } + + return output.Clusters[0], nil +} + +func statusCluster(ctx context.Context, conn *ecs.ECS, arn string) retry.StateRefreshFunc { + return func() (interface{}, string, error) { + cluster, err := FindClusterByNameOrARN(ctx, conn, arn) + + if tfresource.NotFound(err) { + return nil, "", nil } - if tfawserr.ErrCodeEquals(err, ecs.ErrCodeUpdateInProgressException) { - log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) - return retry.RetryableError(err) + + if err != nil { + return nil, "", err } - return retry.NonRetryableError(err) - }) - if tfresource.TimedOut(err) { - _, err = conn.DeleteClusterWithContext(ctx, input) + + return cluster, aws.StringValue(cluster.Status), err } +} + +func waitClusterAvailable(ctx context.Context, conn *ecs.ECS, arn string) (*ecs.Cluster, error) { //nolint:unparam + stateConf := &retry.StateChangeConf{ + Pending: []string{clusterStatusProvisioning}, + Target: []string{clusterStatusActive}, + Refresh: statusCluster(ctx, conn, arn), + Timeout: clusterAvailableTimeout, + Delay: clusterAvailableDelay, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if v, ok := outputRaw.(*ecs.Cluster); ok { + return v, err + } + + return nil, err +} + +func waitClusterDeleted(ctx context.Context, conn *ecs.ECS, arn string) (*ecs.Cluster, error) { + stateConf := &retry.StateChangeConf{ + Pending: []string{clusterStatusActive, clusterStatusDeprovisioning}, + Target: []string{}, + Refresh: statusCluster(ctx, conn, arn), + Timeout: clusterDeleteTimeout, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if v, ok := outputRaw.(*ecs.Cluster); ok { + return v, err + } + + return nil, err +} + +func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).ECSConn() + + log.Printf("[DEBUG] Deleting ECS Cluster: %s", d.Id()) + _, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, clusterDeleteTimeout, func() (interface{}, error) { + return conn.DeleteClusterWithContext(ctx, &ecs.DeleteClusterInput{ + Cluster: aws.String(d.Id()), + }) + }, + ecs.ErrCodeClusterContainsContainerInstancesException, + ecs.ErrCodeClusterContainsServicesException, + ecs.ErrCodeClusterContainsTasksException, + ecs.ErrCodeUpdateInProgressException, + ) + if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting ECS cluster: %s", err) + return sdkdiag.AppendErrorf(diags, "deleting ECS Cluster (%s): %s", d.Id(), err) } if _, err := waitClusterDeleted(ctx, conn, d.Id()); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for ECS Cluster (%s) to become Deleted: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for ECS Cluster (%s) delete: %s", d.Id(), err) } - log.Printf("[DEBUG] ECS cluster %q deleted", d.Id()) return diags } diff --git a/internal/service/ecs/find.go b/internal/service/ecs/find.go index 3f6b0a5ebe8d..11e8e5505170 100644 --- a/internal/service/ecs/find.go +++ b/internal/service/ecs/find.go @@ -52,59 +52,6 @@ func FindCapacityProviderByARN(ctx context.Context, conn *ecs.ECS, arn string) ( return capacityProvider, nil } -func FindClusterByNameOrARN(ctx context.Context, conn *ecs.ECS, nameOrARN string) (*ecs.Cluster, error) { - input := &ecs.DescribeClustersInput{ - Clusters: aws.StringSlice([]string{nameOrARN}), - Include: aws.StringSlice([]string{ecs.ClusterFieldTags, ecs.ClusterFieldConfigurations, ecs.ClusterFieldSettings}), - } - - output, err := conn.DescribeClustersWithContext(ctx, input) - - // Some partitions (i.e., ISO) may not support tagging, giving error - if verify.ErrorISOUnsupported(conn.PartitionID, err) { - log.Printf("[WARN] failed describing ECS Cluster (%s) including tags: %s; retrying without tags", nameOrARN, err) - - input.Include = aws.StringSlice([]string{ecs.ClusterFieldConfigurations, ecs.ClusterFieldSettings}) - output, err = conn.DescribeClustersWithContext(ctx, input) - } - - // Some partitions (i.e., ISO) may not support describe including configuration, giving error - if verify.ErrorISOUnsupported(conn.PartitionID, err) { - log.Printf("[WARN] failed describing ECS Cluster (%s) including configuration: %s; retrying without configuration", nameOrARN, err) - - input.Include = aws.StringSlice([]string{ecs.ClusterFieldSettings}) - output, err = conn.DescribeClustersWithContext(ctx, input) - } - - if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException) { - return nil, &retry.NotFoundError{ - LastError: err, - LastRequest: input, - } - } - - if err != nil { - return nil, err - } - - if output == nil || len(output.Clusters) == 0 || output.Clusters[0] == nil { - return nil, tfresource.NewEmptyResultError(input) - } - - if count := len(output.Clusters); count > 1 { - return nil, tfresource.NewTooManyResultsError(count, input) - } - - if status := aws.StringValue(output.Clusters[0].Status); status == clusterStatusInactive { - return nil, &retry.NotFoundError{ - Message: status, - LastRequest: input, - } - } - - return output.Clusters[0], nil -} - func FindServiceByID(ctx context.Context, conn *ecs.ECS, id, cluster string) (*ecs.Service, error) { input := &ecs.DescribeServicesInput{ Cluster: aws.String(cluster), diff --git a/internal/service/ecs/status.go b/internal/service/ecs/status.go index 616daec5dba9..5befd24c5c55 100644 --- a/internal/service/ecs/status.go +++ b/internal/service/ecs/status.go @@ -93,22 +93,6 @@ func statusServiceWaitForStable(ctx context.Context, conn *ecs.ECS, id, cluster } } -func statusCluster(ctx context.Context, conn *ecs.ECS, arn string) retry.StateRefreshFunc { - return func() (interface{}, string, error) { - cluster, err := FindClusterByNameOrARN(ctx, conn, arn) - - if tfresource.NotFound(err) { - return nil, "", nil - } - - if err != nil { - return nil, "", err - } - - return cluster, aws.StringValue(cluster.Status), err - } -} - func stabilityStatusTaskSet(ctx context.Context, conn *ecs.ECS, taskSetID, service, cluster string) retry.StateRefreshFunc { return func() (interface{}, string, error) { input := &ecs.DescribeTaskSetsInput{ diff --git a/internal/service/ecs/wait.go b/internal/service/ecs/wait.go index 6654f63cfff5..660132079612 100644 --- a/internal/service/ecs/wait.go +++ b/internal/service/ecs/wait.go @@ -129,41 +129,6 @@ func waitServiceActive(ctx context.Context, conn *ecs.ECS, id, cluster string, t return nil, err } -func waitClusterAvailable(ctx context.Context, conn *ecs.ECS, arn string) (*ecs.Cluster, error) { //nolint:unparam - stateConf := &retry.StateChangeConf{ - Pending: []string{clusterStatusProvisioning}, - Target: []string{clusterStatusActive}, - Refresh: statusCluster(ctx, conn, arn), - Timeout: clusterAvailableTimeout, - Delay: clusterAvailableDelay, - } - - outputRaw, err := stateConf.WaitForStateContext(ctx) - - if v, ok := outputRaw.(*ecs.Cluster); ok { - return v, err - } - - return nil, err -} - -func waitClusterDeleted(ctx context.Context, conn *ecs.ECS, arn string) (*ecs.Cluster, error) { - stateConf := &retry.StateChangeConf{ - Pending: []string{clusterStatusActive, clusterStatusDeprovisioning}, - Target: []string{}, - Refresh: statusCluster(ctx, conn, arn), - Timeout: clusterDeleteTimeout, - } - - outputRaw, err := stateConf.WaitForStateContext(ctx) - - if v, ok := outputRaw.(*ecs.Cluster); ok { - return v, err - } - - return nil, err -} - func waitTaskSetStable(ctx context.Context, conn *ecs.ECS, timeout time.Duration, taskSetID, service, cluster string) error { stateConf := &retry.StateChangeConf{ Pending: []string{ecs.StabilityStatusStabilizing}, From 2906dcaf53fa871b5ca5d1c365b731ea43614dcb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 15:15:17 -0400 Subject: [PATCH 280/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31346.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31346.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31346.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31346.txt From cd5f1154d7b7e902dd2ab6f67d078fa3ba856743 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 15:27:27 -0400 Subject: [PATCH 281/304] r/aws_ecs_service: Tidy up acceptance test configurations. --- internal/service/ecs/service_test.go | 202 ++++++--------------------- 1 file changed, 41 insertions(+), 161 deletions(-) diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index ae9c59efd83d..f7b1621feadf 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -332,38 +332,6 @@ func TestAccECSService_familyAndRevision(t *testing.T) { }) } -// Regression for https://github.com/hashicorp/terraform/issues/2427 -func TestAccECSService_renamedCluster(t *testing.T) { - ctx := acctest.Context(t) - var service ecs.Service - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resourceName := "aws_ecs_service.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckServiceDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccServiceConfig_renamedCluster(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckServiceExists(ctx, resourceName, &service), - resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), - ), - }, - - { - Config: testAccServiceConfig_renamedCluster(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckServiceExists(ctx, resourceName, &service), - resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), - ), - }, - }, - }) -} - func TestAccECSService_healthCheckGracePeriodSeconds(t *testing.T) { ctx := acctest.Context(t) var service ecs.Service @@ -1633,7 +1601,7 @@ func testAccCheckServiceNotRecreated(i, j *ecs.Service) resource.TestCheckFunc { func testAccServiceConfig_basic(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -1655,7 +1623,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 } @@ -1664,7 +1632,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_modified(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -1686,7 +1654,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 2 } @@ -1856,7 +1824,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_interchangeablePlacementStrategy(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -1878,7 +1846,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -1900,7 +1868,7 @@ resource "aws_ecs_capacity_provider" "test" { } } -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -1922,7 +1890,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 force_new_deployment = %[4]t @@ -2055,7 +2023,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_forceNewDeployment(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2076,7 +2044,7 @@ DEFINITION } resource "aws_ecs_service" "test" { - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id desired_count = 1 force_new_deployment = true name = %[1]q @@ -2092,7 +2060,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_forceNewDeploymentTriggers(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2113,7 +2081,7 @@ DEFINITION } resource "aws_ecs_service" "test" { - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id desired_count = 1 force_new_deployment = true name = %[1]q @@ -2133,7 +2101,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_placementStrategy(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2155,7 +2123,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2204,7 +2172,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_randomPlacementStrategy(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2226,7 +2194,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2239,7 +2207,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_multiplacementStrategy(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2261,7 +2229,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2289,7 +2257,7 @@ data "aws_availability_zones" "available" { } } -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2311,7 +2279,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2325,7 +2293,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_placementConstraintEmptyExpression(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2347,7 +2315,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2359,35 +2327,7 @@ resource "aws_ecs_service" "test" { } func testAccServiceConfig_healthCheckGracePeriodSeconds(rName string, healthCheckGracePeriodSeconds int) string { - return fmt.Sprintf(` -data "aws_availability_zones" "available" { - state = "available" - - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] - } -} - -resource "aws_vpc" "test" { - cidr_block = "10.10.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - availability_zone = data.aws_availability_zones.available.names[count.index] - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2499,40 +2439,11 @@ resource "aws_ecs_service" "test" { depends_on = [aws_iam_role_policy.ecs_service] } -`, rName, healthCheckGracePeriodSeconds) +`, rName, healthCheckGracePeriodSeconds)) } func testAccServiceConfig_iamRole(rName string) string { - return fmt.Sprintf(` -data "aws_availability_zones" "available" { - state = "available" - - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] - } -} - -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test" { - count = 2 - - availability_zone = data.aws_availability_zones.available.names[count.index] - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2628,12 +2539,12 @@ resource "aws_ecs_service" "test" { depends_on = [aws_iam_role_policy.ecs_service] } -`, rName) +`, rName)) } func testAccServiceConfig_alarms(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2655,7 +2566,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 @@ -2684,7 +2595,7 @@ resource "aws_cloudwatch_metric_alarm" "test" { func testAccServiceConfig_deploymentValues(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2706,7 +2617,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = aws_ecs_task_definition.test.arn desired_count = 1 } @@ -2857,7 +2768,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id + cluster = aws_ecs_cluster.test.id task_definition = "${aws_ecs_task_definition.test.family}:${aws_ecs_task_definition.test.revision}" desired_count = 1 } @@ -2866,7 +2777,7 @@ resource "aws_ecs_service" "test" { func testAccServiceConfig_familyAndRevisionModified(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -2888,38 +2799,7 @@ DEFINITION resource "aws_ecs_service" "test" { name = %[1]q - cluster = aws_ecs_cluster.default.id - task_definition = "${aws_ecs_task_definition.test.family}:${aws_ecs_task_definition.test.revision}" - desired_count = 1 -} -`, rName) -} - -func testAccServiceConfig_renamedCluster(rName string) string { - return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { - name = %[1]q -} - -resource "aws_ecs_task_definition" "test" { - family = %[1]q - - container_definitions = < Date: Thu, 11 May 2023 15:36:51 -0400 Subject: [PATCH 282/304] r/aws_ecs_task_set: Tidy up acceptance test configurations. --- internal/service/ecs/task_set_test.go | 276 +++++++++----------------- 1 file changed, 98 insertions(+), 178 deletions(-) diff --git a/internal/service/ecs/task_set_test.go b/internal/service/ecs/task_set_test.go index 92de82b23837..20853f626f09 100644 --- a/internal/service/ecs/task_set_test.go +++ b/internal/service/ecs/task_set_test.go @@ -386,11 +386,82 @@ func TestAccECSTaskSet_tags(t *testing.T) { }) } -////////////// -// Fixtures // -////////////// +func testAccCheckTaskSetExists(ctx context.Context, name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).ECSConn() + + taskSetId, service, cluster, err := tfecs.TaskSetParseID(rs.Primary.ID) + + if err != nil { + return err + } + + input := &ecs.DescribeTaskSetsInput{ + TaskSets: aws.StringSlice([]string{taskSetId}), + Cluster: aws.String(cluster), + Service: aws.String(service), + } + + output, err := conn.DescribeTaskSetsWithContext(ctx, input) + + if err != nil { + return err + } + + if output == nil || len(output.TaskSets) == 0 { + return fmt.Errorf("ECS TaskSet (%s) not found", rs.Primary.ID) + } + + return nil + } +} + +func testAccCheckTaskSetDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).ECSConn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ecs_task_set" { + continue + } + + taskSetId, service, cluster, err := tfecs.TaskSetParseID(rs.Primary.ID) + + if err != nil { + return err + } + + input := &ecs.DescribeTaskSetsInput{ + TaskSets: aws.StringSlice([]string{taskSetId}), + Cluster: aws.String(cluster), + Service: aws.String(service), + } + + output, err := conn.DescribeTaskSetsWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException, ecs.ErrCodeServiceNotFoundException, ecs.ErrCodeTaskSetNotFoundException) { + continue + } + + if err != nil { + return err + } + + if output != nil && len(output.TaskSets) == 1 { + return fmt.Errorf("ECS TaskSet (%s) still exists", rs.Primary.ID) + } + } + + return nil + } +} -func testAccTaskSetBaseConfig(rName string) string { +func testAccTaskSetConfig_base(rName string) string { return fmt.Sprintf(` resource "aws_ecs_cluster" "test" { name = %[1]q @@ -423,9 +494,7 @@ resource "aws_ecs_service" "test" { } func testAccTaskSetConfig_basic(rName string) string { - return acctest.ConfigCompose( - testAccTaskSetBaseConfig(rName), - ` + return acctest.ConfigCompose(testAccTaskSetConfig_base(rName), ` resource "aws_ecs_task_set" "test" { service = aws_ecs_service.test.id cluster = aws_ecs_cluster.test.id @@ -435,9 +504,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_externalID(rName string) string { - return acctest.ConfigCompose( - testAccTaskSetBaseConfig(rName), - ` + return acctest.ConfigCompose(testAccTaskSetConfig_base(rName), ` resource "aws_ecs_task_set" "test" { service = aws_ecs_service.test.id cluster = aws_ecs_cluster.test.id @@ -448,9 +515,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_scale(rName string, scale float64) string { - return acctest.ConfigCompose( - testAccTaskSetBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccTaskSetConfig_base(rName), fmt.Sprintf(` resource "aws_ecs_task_set" "test" { service = aws_ecs_service.test.id cluster = aws_ecs_cluster.test.id @@ -463,10 +528,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_capacityProviderStrategy(rName string, weight, base int) string { - return acctest.ConfigCompose( - testAccCapacityProviderConfig_base(rName), - testAccTaskSetBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccCapacityProviderConfig_base(rName), testAccTaskSetConfig_base(rName), fmt.Sprintf(` resource "aws_ecs_capacity_provider" "test" { name = %[1]q auto_scaling_group_provider { @@ -488,26 +550,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_alb(rName string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.10.0.0/16" - tags = { - Name = "terraform-testacc-ecs-service-with-alb" - } -} - -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - availability_zone = data.aws_availability_zones.available.names[count.index] - vpc_id = aws_vpc.test.id - tags = { - Name = "tf-acc-ecs-service-with-alb" - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_ecs_cluster" "test" { name = %[1]q } @@ -579,9 +622,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_tags1(rName, tag1Key, tag1Value string) string { - return acctest.ConfigCompose( - testAccTaskSetBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccTaskSetConfig_base(rName), fmt.Sprintf(` resource "aws_ecs_task_set" "test" { service = aws_ecs_service.test.id cluster = aws_ecs_cluster.test.id @@ -594,9 +635,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_tags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { - return acctest.ConfigCompose( - testAccTaskSetBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccTaskSetConfig_base(rName), fmt.Sprintf(` resource "aws_ecs_task_set" "test" { service = aws_ecs_service.test.id cluster = aws_ecs_cluster.test.id @@ -610,35 +649,21 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_serviceRegistries(rName string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - tags = { - Name = "tf-acc-with-svc-reg" - } -} - -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - availability_zone = data.aws_availability_zones.available.names[count.index] - vpc_id = aws_vpc.test.id - tags = { - Name = "tf-acc-with-svc-reg" - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_security_group" "test" { name = %[1]q vpc_id = aws_vpc.test.id + ingress { protocol = "-1" from_port = 0 to_port = 0 cidr_blocks = [aws_vpc.test.cidr_block] } + + tags = { + Name = %[1]q + } } resource "aws_service_discovery_private_dns_namespace" "test" { @@ -704,26 +729,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_launchTypeFargate(rName string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.10.0.0/16" - tags = { - Name = "terraform-testacc-ecs-service-with-launch-type-fargate" - } -} - -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - availability_zone = data.aws_availability_zones.available.names[count.index] - vpc_id = aws_vpc.test.id - tags = { - Name = "tf-acc-ecs-service-with-launch-type-fargate" - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_security_group" "test" { count = 2 @@ -736,6 +742,10 @@ resource "aws_security_group" "test" { to_port = 8000 cidr_blocks = [aws_vpc.test.cidr_block] } + + tags = { + Name = %[1]q + } } resource "aws_ecs_cluster" "test" { @@ -786,26 +796,7 @@ resource "aws_ecs_task_set" "test" { } func testAccTaskSetConfig_launchTypeFargateAndPlatformVersion(rName, platformVersion string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.10.0.0/16" - tags = { - Name = "terraform-testacc-ecs-service-with-launch-type-fargate-and-platform-version" - } -} - -resource "aws_subnet" "test" { - count = 2 - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) - availability_zone = data.aws_availability_zones.available.names[count.index] - vpc_id = aws_vpc.test.id - tags = { - Name = "tf-acc-ecs-service-with-launch-type-fargate-and-platform-version" - } -} - + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` resource "aws_security_group" "test" { count = 2 @@ -818,6 +809,10 @@ resource "aws_security_group" "test" { to_port = 8000 cidr_blocks = [aws_vpc.test.cidr_block] } + + tags = { + Name = %[1]q + } } resource "aws_ecs_cluster" "test" { @@ -867,78 +862,3 @@ resource "aws_ecs_task_set" "test" { } `, rName, platformVersion)) } - -func testAccCheckTaskSetExists(ctx context.Context, name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } - - conn := acctest.Provider.Meta().(*conns.AWSClient).ECSConn() - - taskSetId, service, cluster, err := tfecs.TaskSetParseID(rs.Primary.ID) - - if err != nil { - return err - } - - input := &ecs.DescribeTaskSetsInput{ - TaskSets: aws.StringSlice([]string{taskSetId}), - Cluster: aws.String(cluster), - Service: aws.String(service), - } - - output, err := conn.DescribeTaskSetsWithContext(ctx, input) - - if err != nil { - return err - } - - if output == nil || len(output.TaskSets) == 0 { - return fmt.Errorf("ECS TaskSet (%s) not found", rs.Primary.ID) - } - - return nil - } -} - -func testAccCheckTaskSetDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).ECSConn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_ecs_task_set" { - continue - } - - taskSetId, service, cluster, err := tfecs.TaskSetParseID(rs.Primary.ID) - - if err != nil { - return err - } - - input := &ecs.DescribeTaskSetsInput{ - TaskSets: aws.StringSlice([]string{taskSetId}), - Cluster: aws.String(cluster), - Service: aws.String(service), - } - - output, err := conn.DescribeTaskSetsWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException, ecs.ErrCodeServiceNotFoundException, ecs.ErrCodeTaskSetNotFoundException) { - continue - } - - if err != nil { - return err - } - - if output != nil && len(output.TaskSets) == 1 { - return fmt.Errorf("ECS TaskSet (%s) still exists", rs.Primary.ID) - } - } - - return nil - } -} From ed4737d252779df28de49325cce92fdb24ced59d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 15:38:00 -0400 Subject: [PATCH 283/304] Fix golangci-lint 'unused'. --- internal/service/ecs/cluster_test.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/service/ecs/cluster_test.go b/internal/service/ecs/cluster_test.go index e93ae82e9ced..a38a6949166e 100644 --- a/internal/service/ecs/cluster_test.go +++ b/internal/service/ecs/cluster_test.go @@ -363,18 +363,6 @@ resource "aws_ecs_cluster" "test" { `, rName, ns, idx) } -func testAccClusterCapacityProviderConfig_base(rName string) string { - return acctest.ConfigCompose(testAccCapacityProviderConfig_base(rName), fmt.Sprintf(` -resource "aws_ecs_capacity_provider" "test" { - name = %[1]q - - auto_scaling_group_provider { - auto_scaling_group_arn = aws_autoscaling_group.test.arn - } -} -`, rName)) -} - func testAccClusterConfig_containerInsights(rName, value string) string { return fmt.Sprintf(` resource "aws_ecs_cluster" "test" { From aa9f8311f7f55a53edd88cb21ad31bb3ab61ede5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 11 May 2023 16:38:28 -0400 Subject: [PATCH 284/304] Fixup 'testAccServiceConfig_familyAndRevision'. --- internal/service/ecs/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index f7b1621feadf..b5c4ebe5d323 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -2746,7 +2746,7 @@ func testAccServiceConfig_lbChangesModified(rName string) string { func testAccServiceConfig_familyAndRevision(rName string) string { return fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { +resource "aws_ecs_cluster" "test" { name = %[1]q } From 70eb9aadf5e0cd79d18305207c48d3797cb8e915 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 11 May 2023 21:07:44 +0000 Subject: [PATCH 285/304] Update CHANGELOG.md for #31346 --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c4fb30044a..dd1b47402bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ BREAKING CHANGES: * data-source/aws_elasticache_replication_group: Remove `number_cache_clusters`, `replication_group_description` arguments -- use `num_cache_clusters`, and `description`, respectively, instead ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * data-source/aws_iam_policy_document: Don't add empty `statement.sid` values to `json` attribute value ([#28539](https://github.com/hashicorp/terraform-provider-aws/issues/28539)) * data-source/aws_iam_policy_document: `source_json` and `override_json` have been removed -- use `source_policy_documents` and `override_policy_documents`, respectively, instead ([#30829](https://github.com/hashicorp/terraform-provider-aws/issues/30829)) +* data-source/aws_identitystore_group: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) +* data-source/aws_identitystore_user: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) * data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -30,6 +32,7 @@ BREAKING CHANGES: * resource/aws_docdb_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_ec2_client_vpn_endpoint: The `status` attribute has been removed ([#31223](https://github.com/hashicorp/terraform-provider-aws/issues/31223)) * resource/aws_ec2_client_vpn_network_association: The `status` attribute has been removed ([#31223](https://github.com/hashicorp/terraform-provider-aws/issues/31223)) +* resource/aws_ecs_cluster: The `capacity_providers` and `default_capacity_provider_strategy` attributes have been removed ([#31346](https://github.com/hashicorp/terraform-provider-aws/issues/31346)) * resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) @@ -42,6 +45,7 @@ BREAKING CHANGES: * resource/aws_kinesis_firehose_delivery_stream: Rename `s3_configuration.0.buffer_size` and `s3_configuration.0.buffer_internval` to `s3_configuration.0.buffering_size` and `s3_configuration.0.buffering_internval`, respectively ([#31141](https://github.com/hashicorp/terraform-provider-aws/issues/31141)) * resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_medialive_multiplex_program: The `statemux_settings` attribute has been removed. Use `statmux_settings` argument instead ([#31034](https://github.com/hashicorp/terraform-provider-aws/issues/31034)) +* resource/aws_msk_cluster: The `broker_node_group_info.ebs_volume_size` attribute has been removed ([#31324](https://github.com/hashicorp/terraform-provider-aws/issues/31324)) * resource/aws_neptune_cluster: `snapshot_identifier` change now properly forces replacement ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Removed `policy_document` argument -- use `aws_networkmanager_core_network_policy_attachment` resource instead ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: The `engine` argument is now required and has no default ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) @@ -63,8 +67,6 @@ NOTES: * data-source/aws_db_security_group: The `aws_redshift_service_account` data source has been deprecated and will be removed in a future version. AWS documentation [states that](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) a [service principal name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services) should be used instead of an AWS account ID in any relevant IAM policy ([#31006](https://github.com/hashicorp/terraform-provider-aws/issues/31006)) * data-source/aws_elasticache_replication_group: Update configurations to use `description` instead of the `replication_group_description` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * data-source/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) -* data-source/aws_identitystore_group: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) -* data-source/aws_identitystore_user: The `filter` argument has been removed ([#31312](https://github.com/hashicorp/terraform-provider-aws/issues/31312)) * data-source/aws_quicksight_data_set: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) * data-source/aws_service_discovery_service: The `tags_all` attribute has been deprecated and will be removed in a future version ([#31162](https://github.com/hashicorp/terraform-provider-aws/issues/31162)) * resource/aws_api_gateway_rest_api: Update configurations with `minimum_compression_size` set to pass the value as a string. Valid values remain the same. ([#30969](https://github.com/hashicorp/terraform-provider-aws/issues/30969)) @@ -75,7 +77,6 @@ NOTES: * resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_guardduty_organization_configuration: The `auto_enable` argument has been deprecated. Use the `auto_enable_organization_members` argument instead. ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) -* resource/aws_msk_cluster: The `broker_node_group_info.ebs_volume_size` attribute has been removed ([#31324](https://github.com/hashicorp/terraform-provider-aws/issues/31324)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875)) * resource/aws_rds_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) From 2c86a9db4bad44b66a23ecdea259b1fc0b76874b Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Thu, 11 May 2023 19:44:22 -0500 Subject: [PATCH 286/304] chore: fix linter errors --- internal/service/connect/user_data_source_test.go | 2 +- internal/service/connect/vocabulary_data_source_test.go | 2 +- internal/service/organizations/policy_data_source_test.go | 2 +- internal/service/quicksight/template_alias_test.go | 4 ++-- internal/service/quicksight/template_test.go | 4 ++-- internal/service/quicksight/vpc_connection_test.go | 4 ++-- .../service/redshiftserverless/namespace_data_source_test.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/connect/user_data_source_test.go b/internal/service/connect/user_data_source_test.go index 9b69ebc3e54e..4c8d291fede9 100644 --- a/internal/service/connect/user_data_source_test.go +++ b/internal/service/connect/user_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/service/connect" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/connect/vocabulary_data_source_test.go b/internal/service/connect/vocabulary_data_source_test.go index 53143a286dd3..9dbee75dcc4c 100644 --- a/internal/service/connect/vocabulary_data_source_test.go +++ b/internal/service/connect/vocabulary_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/service/connect" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/organizations/policy_data_source_test.go b/internal/service/organizations/policy_data_source_test.go index 8790369432d2..bbd20f9fa451 100644 --- a/internal/service/organizations/policy_data_source_test.go +++ b/internal/service/organizations/policy_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/service/organizations" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) diff --git a/internal/service/quicksight/template_alias_test.go b/internal/service/quicksight/template_alias_test.go index 543a22dc859e..5142a5c59326 100644 --- a/internal/service/quicksight/template_alias_test.go +++ b/internal/service/quicksight/template_alias_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/template_test.go b/internal/service/quicksight/template_test.go index f2a0f01ed34f..67a53e56dcb2 100644 --- a/internal/service/quicksight/template_test.go +++ b/internal/service/quicksight/template_test.go @@ -10,8 +10,8 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/quicksight/vpc_connection_test.go b/internal/service/quicksight/vpc_connection_test.go index 85131def5c4e..e2e3445191d9 100644 --- a/internal/service/quicksight/vpc_connection_test.go +++ b/internal/service/quicksight/vpc_connection_test.go @@ -9,8 +9,8 @@ import ( "github.com/aws/aws-sdk-go/service/quicksight" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" "github.com/hashicorp/terraform-provider-aws/internal/create" diff --git a/internal/service/redshiftserverless/namespace_data_source_test.go b/internal/service/redshiftserverless/namespace_data_source_test.go index 5ffb3dd88693..56cc15cb7c14 100644 --- a/internal/service/redshiftserverless/namespace_data_source_test.go +++ b/internal/service/redshiftserverless/namespace_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/service/redshiftserverless" sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) From 42c95cc89c3d05b1db756f45df9743e2b00063aa Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 09:04:22 -0400 Subject: [PATCH 287/304] r/aws_wafv2_web_acl: Remove 'statement.managed_rule_group_statement.excluded_rule' and 'statement.rule_group_reference_statement.excluded_rule'. --- .changelog/#####.txt | 7 ++ internal/service/wafv2/flex.go | 58 ++---------- internal/service/wafv2/schemas.go | 26 +----- internal/service/wafv2/web_acl_test.go | 93 +++++++++++-------- website/docs/guides/version-5-upgrade.html.md | 7 ++ website/docs/r/wafv2_web_acl.html.markdown | 21 +++-- 6 files changed, 92 insertions(+), 120 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..d1eb022f44c4 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,7 @@ +```release-note:breaking-change +resource/aws_wafv2_web_acl: The `statement.managed_rule_group_statement.excluded_rule` and `statement.rule_group_reference_statement.excluded_rule` attributes have been removed +``` + +```release-note:enhancement +resource/aws_wafv2_web_acl: Support `rule_action_override` on `rule_group_reference_statement` +``` \ No newline at end of file diff --git a/internal/service/wafv2/flex.go b/internal/service/wafv2/flex.go index c43c6c49246f..d9458fe3eb64 100644 --- a/internal/service/wafv2/flex.go +++ b/internal/service/wafv2/flex.go @@ -1016,7 +1016,6 @@ func expandManagedRuleGroupStatement(l []interface{}) *wafv2.ManagedRuleGroupSta m := l[0].(map[string]interface{}) r := &wafv2.ManagedRuleGroupStatement{ - ExcludedRules: expandExcludedRules(m["excluded_rule"].([]interface{})), Name: aws.String(m["name"].(string)), RuleActionOverrides: expandRuleActionOverrides(m["rule_action_override"].([]interface{})), VendorName: aws.String(m["vendor_name"].(string)), @@ -1260,35 +1259,8 @@ func expandRuleGroupReferenceStatement(l []interface{}) *wafv2.RuleGroupReferenc m := l[0].(map[string]interface{}) return &wafv2.RuleGroupReferenceStatement{ - ARN: aws.String(m["arn"].(string)), - ExcludedRules: expandExcludedRules(m["excluded_rule"].([]interface{})), - } -} - -func expandExcludedRules(l []interface{}) []*wafv2.ExcludedRule { - if len(l) == 0 || l[0] == nil { - return nil - } - - rules := make([]*wafv2.ExcludedRule, 0) - - for _, rule := range l { - if rule == nil { - continue - } - rules = append(rules, expandExcludedRule(rule.(map[string]interface{}))) - } - - return rules -} - -func expandExcludedRule(m map[string]interface{}) *wafv2.ExcludedRule { - if m == nil { - return nil - } - - return &wafv2.ExcludedRule{ - Name: aws.String(m["name"].(string)), + ARN: aws.String(m["arn"].(string)), + RuleActionOverrides: expandRuleActionOverrides(m["rule_action_override"].([]interface{})), } } @@ -2176,10 +2148,6 @@ func flattenManagedRuleGroupStatement(apiObject *wafv2.ManagedRuleGroupStatement tfMap := map[string]interface{}{} - if apiObject.ExcludedRules != nil { - tfMap["excluded_rule"] = flattenExcludedRules(apiObject.ExcludedRules) - } - if apiObject.Name != nil { tfMap["name"] = aws.StringValue(apiObject.Name) } @@ -2410,28 +2378,20 @@ func flattenRateBasedStatement(apiObject *wafv2.RateBasedStatement) interface{} return []interface{}{tfMap} } -func flattenRuleGroupReferenceStatement(r *wafv2.RuleGroupReferenceStatement) interface{} { - if r == nil { +func flattenRuleGroupReferenceStatement(apiObject *wafv2.RuleGroupReferenceStatement) interface{} { + if apiObject == nil { return []interface{}{} } - m := map[string]interface{}{ - "excluded_rule": flattenExcludedRules(r.ExcludedRules), - "arn": aws.StringValue(r.ARN), + tfMap := map[string]interface{}{ + "arn": aws.StringValue(apiObject.ARN), } - return []interface{}{m} -} - -func flattenExcludedRules(r []*wafv2.ExcludedRule) interface{} { - out := make([]map[string]interface{}, len(r)) - for i, rule := range r { - m := make(map[string]interface{}) - m["name"] = aws.StringValue(rule.Name) - out[i] = m + if apiObject.RuleActionOverrides != nil { + tfMap["rule_action_override"] = flattenRuleActionOverrides(apiObject.RuleActionOverrides) } - return out + return []interface{}{tfMap} } func flattenRuleActionOverrides(r []*wafv2.RuleActionOverride) interface{} { diff --git a/internal/service/wafv2/schemas.go b/internal/service/wafv2/schemas.go index 2d0b87367a7e..5f50eddc150b 100644 --- a/internal/service/wafv2/schemas.go +++ b/internal/service/wafv2/schemas.go @@ -873,15 +873,14 @@ func managedRuleGroupStatementSchema(level int) *schema.Schema { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "excluded_rule": excludedRuleSchema(), + "managed_rule_group_configs": managedRuleGroupConfigSchema(), "name": { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringLenBetween(1, 128), }, - "rule_action_override": ruleActionOverrideSchema(), - "managed_rule_group_configs": managedRuleGroupConfigSchema(), - "scope_down_statement": scopeDownStatementSchema(level - 1), + "rule_action_override": ruleActionOverrideSchema(), + "scope_down_statement": scopeDownStatementSchema(level - 1), "vendor_name": { Type: schema.TypeString, Required: true, @@ -897,23 +896,6 @@ func managedRuleGroupStatementSchema(level int) *schema.Schema { } } -func excludedRuleSchema() *schema.Schema { - return &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringLenBetween(1, 128), - }, - }, - }, - Deprecated: "Use rule_action_override instead", - } -} - func rateBasedStatementSchema(level int) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, @@ -1100,7 +1082,7 @@ func ruleGroupReferenceStatementSchema() *schema.Schema { Required: true, ValidateFunc: verify.ValidARN, }, - "excluded_rule": excludedRuleSchema(), + "rule_action_override": ruleActionOverrideSchema(), }, }, } diff --git a/internal/service/wafv2/web_acl_test.go b/internal/service/wafv2/web_acl_test.go index 3b5725bcf084..497be2ed3d90 100644 --- a/internal/service/wafv2/web_acl_test.go +++ b/internal/service/wafv2/web_acl_test.go @@ -522,9 +522,9 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_basic(t *testing.T) { "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesCommonRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -544,15 +544,15 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_basic(t *testing.T) { "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesCommonRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "2", - "statement.0.managed_rule_group_statement.0.excluded_rule.0.name": "SizeRestrictions_QUERYSTRING", - "statement.0.managed_rule_group_statement.0.excluded_rule.1.name": "NoUserAgent_HEADER", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "2", + "statement.0.managed_rule_group_statement.0.rule_action_override.0.name": "SizeRestrictions_QUERYSTRING", + "statement.0.managed_rule_group_statement.0.rule_action_override.1.name": "NoUserAgent_HEADER", "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "1", "statement.0.managed_rule_group_statement.0.scope_down_statement.0.geo_match_statement.#": "1", "statement.0.managed_rule_group_statement.0.scope_down_statement.0.geo_match_statement.0.country_codes.#": "2", "statement.0.managed_rule_group_statement.0.scope_down_statement.0.geo_match_statement.0.country_codes.0": "US", "statement.0.managed_rule_group_statement.0.scope_down_statement.0.geo_match_statement.0.country_codes.1": "NL", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -610,10 +610,10 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_basic(t *testing.T) { "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesCommonRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", "statement.0.managed_rule_group_statement.0.version": "Version_1.0", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", }), ), }, @@ -654,15 +654,14 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig(t *testing.T) { "override_action.0.none.#": "1", "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", - "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.login_path": "/login", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.1.payload_type": "JSON", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.2.password_field.0.identifier": "/password", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.3.username_field.0.identifier": "/username", - }), + "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS"}), ), }, { @@ -680,14 +679,14 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig(t *testing.T) { "override_action.0.none.#": "1", "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", - "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.login_path": "/app-login", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.1.payload_type": "JSON", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.2.password_field.0.identifier": "/app-password", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.3.username_field.0.identifier": "/app-username", + "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -728,10 +727,6 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ATPRuleSet(t *te "override_action.0.none.#": "1", "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", - "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.#": "1", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.login_path": "/api/1/signin", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.#": "1", @@ -741,6 +736,10 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ATPRuleSet(t *te "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.0.username_field.#": "1", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.0.username_field.0.identifier": "/username", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.response_inspection.#": "0", + "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -759,10 +758,6 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ATPRuleSet(t *te "override_action.0.none.#": "1", "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", - "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.#": "1", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.login_path": "/api/2/signin", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.#": "1", @@ -772,6 +767,10 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_ATPRuleSet(t *te "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.0.username_field.#": "1", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.request_inspection.0.username_field.0.identifier": "/user", "statement.0.managed_rule_group_statement.0.managed_rule_group_configs.0.aws_managed_rules_atp_rule_set.0.response_inspection.#": "0", + "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesATPRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -850,10 +849,10 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_specifyVersion(t *testing.T) { "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesCommonRuleSet", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", + "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", "statement.0.managed_rule_group_statement.0.version": "Version_1.0", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", - "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", }), ), }, @@ -873,9 +872,9 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_specifyVersion(t *testing.T) { "statement.#": "1", "statement.0.managed_rule_group_statement.#": "1", "statement.0.managed_rule_group_statement.0.name": "AWSManagedRulesCommonRuleSet", - "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", - "statement.0.managed_rule_group_statement.0.excluded_rule.#": "0", + "statement.0.managed_rule_group_statement.0.rule_action_override.#": "0", "statement.0.managed_rule_group_statement.0.scope_down_statement.#": "0", + "statement.0.managed_rule_group_statement.0.vendor_name": "AWS", }), ), }, @@ -1669,8 +1668,8 @@ func TestAccWAFV2WebACL_RuleGroupReference_basic(t *testing.T) { "override_action.0.count.#": "1", "override_action.0.none.#": "0", "statement.#": "1", - "statement.0.rule_group_reference_statement.#": "1", - "statement.0.rule_group_reference_statement.0.excluded_rule.#": "0", + "statement.0.rule_group_reference_statement.#": "1", + "statement.0.rule_group_reference_statement.0.rule_action_override.#": "0", }), resource.TestMatchTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]*regexp.Regexp{ "statement.0.rule_group_reference_statement.0.arn": regexp.MustCompile(`regional/rulegroup/.+$`), @@ -1690,10 +1689,10 @@ func TestAccWAFV2WebACL_RuleGroupReference_basic(t *testing.T) { "override_action.0.count.#": "1", "override_action.0.none.#": "0", "statement.#": "1", - "statement.0.rule_group_reference_statement.#": "1", - "statement.0.rule_group_reference_statement.0.excluded_rule.#": "2", - "statement.0.rule_group_reference_statement.0.excluded_rule.0.name": "rule-to-exclude-b", - "statement.0.rule_group_reference_statement.0.excluded_rule.1.name": "rule-to-exclude-a", + "statement.0.rule_group_reference_statement.#": "1", + "statement.0.rule_group_reference_statement.0.rule_action_override.#": "2", + "statement.0.rule_group_reference_statement.0.rule_action_override.0.name": "rule-to-exclude-b", + "statement.0.rule_group_reference_statement.0.rule_action_override.1.name": "rule-to-exclude-a", }), resource.TestMatchTypeSetElemNestedAttrs(resourceName, "rule.*", map[string]*regexp.Regexp{ "statement.0.rule_group_reference_statement.0.arn": regexp.MustCompile(`regional/rulegroup/.+$`), @@ -3755,11 +3754,19 @@ resource "aws_wafv2_web_acl" "test" { name = "AWSManagedRulesCommonRuleSet" vendor_name = "AWS" - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "SizeRestrictions_QUERYSTRING" } - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "NoUserAgent_HEADER" } @@ -4213,11 +4220,19 @@ resource "aws_wafv2_web_acl" "test" { rule_group_reference_statement { arn = aws_wafv2_rule_group.test.arn - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "rule-to-exclude-b" } - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "rule-to-exclude-a" } } diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 6725fce61244..a7eb052a37d2 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -36,6 +36,7 @@ Upgrade topics: - [Resource: aws_msk_cluster](#resource-aws_msk_cluster) - [Resource: aws_neptune_cluster](#resource-aws_neptune_cluster) - [Resource: aws_rds_cluster](#resource-aws_rds_cluster) +- [Resource: aws_wafv2_web_acl](#resource-aws_wafv2_web_acl) @@ -152,6 +153,12 @@ Changes to the `snapshot_identifier` attribute will now correctly force re-creat Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced. +## Resource: aws_wafv2_web_acl + +The `statement.managed_rule_group_statement.excluded_rule` and `statement.rule_group_reference_statement.excluded_rule` attributes have been removed. + +The `statement.rule_group_reference_statement.rule_action_override` attribute has been added. + ## Data Source: aws_api_gateway_rest_api The `minimum_compression_size` attribute is now a String type, allowing it to be computed when set via the `body` attribute. diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index 01ecb31ca15c..0e6c4892d2cd 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -307,11 +307,19 @@ resource "aws_wafv2_web_acl" "test" { rule_group_reference_statement { arn = aws_wafv2_rule_group.example.arn - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "rule-to-exclude-b" } - excluded_rule { + rule_action_override { + action_to_use { + count {} + } + name = "rule-to-exclude-a" } } @@ -544,7 +552,6 @@ You can't nest a `managed_rule_group_statement`, for example for use inside a `n The `managed_rule_group_statement` block supports the following arguments: -* `excluded_rule` - (Optional, **Deprecated**) The `rules` whose actions are set to `COUNT` by the web ACL, regardless of the action that is set on the rule. See [`excluded_rule`](#excluded_rule) below for details. Use `rule_action_override` instead. (See the [documentation](https://docs.aws.amazon.com/waf/latest/APIReference/API_ManagedRuleGroupStatement.html#WAF-Type-ManagedRuleGroupStatement-ExcludedRules)) * `name` - (Required) Name of the managed rule group. * `rule_action_override` - (Optional) Action settings to use in the place of the rule actions that are configured inside the rule group. You specify one override for each rule whose action you want to change. See [`rule_action_override`](#rule_action_override) below for details. * `managed_rule_group_configs`- (Optional) Additional information that's used by a managed rule group. Only one rule attribute is allowed in each config. See [Managed Rule Group Configs](#managed_rule_group_configs) for more details @@ -614,7 +621,7 @@ You can't nest a `rule_group_reference_statement`, for example for use inside a The `rule_group_reference_statement` block supports the following arguments: * `arn` - (Required) The Amazon Resource Name (ARN) of the `aws_wafv2_rule_group` resource. -* `excluded_rule` - (Optional) The `rules` whose actions are set to `COUNT` by the web ACL, regardless of the action that is set on the rule. See [`excluded_rule`](#excluded_rule) below for details. +* `rule_action_override` - (Optional) Action settings to use in the place of the rule actions that are configured inside the rule group. You specify one override for each rule whose action you want to change. See [`rule_action_override`](#rule_action_override) below for details. #### `size_constraint_statement` @@ -652,12 +659,6 @@ The `xss_match_statement` block supports the following arguments: At least one required. See [`text_transformation`](#text_transformation) below for details. -#### `excluded_rule` - -The `excluded_rule` block supports the following arguments: - -* `name` - (Required) Name of the rule to exclude. If the rule group is managed by AWS, see the [documentation](https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-list.html) for a list of names in the appropriate rule group in use. - #### `rule_action_override` The `rule_action_override` block supports the following arguments: From 77a24d085c04c81caa21cd4955a076534a3990f4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 09:07:50 -0400 Subject: [PATCH 288/304] Rename CHANGELOG entry file. --- .changelog/{#####.txt => 31374.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31374.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31374.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31374.txt From c99cf27ebc9714132305280a41084bf2e4c0aa71 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 12 May 2023 14:50:37 +0000 Subject: [PATCH 289/304] Update CHANGELOG.md for #31374 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad2bcbd9c2f4..8fe3ce4f53d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ BREAKING CHANGES: * resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) +* resource/aws_wafv2_web_acl: The `statement.managed_rule_group_statement.excluded_rule` and `statement.rule_group_reference_statement.excluded_rule` attributes have been removed ([#31374](https://github.com/hashicorp/terraform-provider-aws/issues/31374)) NOTES: @@ -92,6 +93,7 @@ ENHANCEMENTS: * provider: Duplicate `default_tags` can now be included and will be overwritten by resource `tags` ([#30793](https://github.com/hashicorp/terraform-provider-aws/issues/30793)) * resource/aws_guardduty_organization_configuration: Add `auto_enable_organization_members` attribute ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) * resource/aws_kinesis_firehose_delivery_stream: Add `s3_configuration` to `elasticsearch_configuration`, `opensearch_configuration`, `redshift_configuration`, `splunk_configuration`, and `http_endpoint_configuration` ([#31138](https://github.com/hashicorp/terraform-provider-aws/issues/31138)) +* resource/aws_wafv2_web_acl: Support `rule_action_override` on `rule_group_reference_statement` ([#31374](https://github.com/hashicorp/terraform-provider-aws/issues/31374)) BUG FIXES: From a2f5f4118cdd6898bdbc33d221af495275b123f4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:06:30 -0400 Subject: [PATCH 290/304] r/aws_connect_routing_profile: Remove 'queue_configs_associated' attribute. --- .changelog/#####.txt | 3 ++ internal/service/connect/routing_profile.go | 37 ++----------------- website/docs/guides/version-5-upgrade.html.md | 5 +++ 3 files changed, 11 insertions(+), 34 deletions(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..6e93258c9658 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:breaking-change +resource/aws_connect_routing_profile: The `queue_configs_associated` attribute has been removed +``` \ No newline at end of file diff --git a/internal/service/connect/routing_profile.go b/internal/service/connect/routing_profile.go index dcb07c12b64c..a049041af348 100644 --- a/internal/service/connect/routing_profile.go +++ b/internal/service/connect/routing_profile.go @@ -34,10 +34,13 @@ func ResourceRoutingProfile() *schema.Resource { // Routing profiles do not support deletion today. NoOp the Delete method. // Users can rename their routing profiles manually if they want. DeleteWithoutTimeout: schema.NoopContext, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: verify.SetTagsDiff, + Schema: map[string]*schema.Schema{ "arn": { Type: schema.TypeString, @@ -117,39 +120,6 @@ func ResourceRoutingProfile() *schema.Resource { }, }, }, - "queue_configs_associated": { - Deprecated: "Use the queue_configs instead", - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "channel": { - Type: schema.TypeString, - Computed: true, - }, - "delay": { - Type: schema.TypeInt, - Computed: true, - }, - "priority": { - Type: schema.TypeInt, - Computed: true, - }, - "queue_arn": { - Type: schema.TypeString, - Computed: true, - }, - "queue_id": { - Type: schema.TypeString, - Computed: true, - }, - "queue_name": { - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, "routing_profile_id": { Type: schema.TypeString, Computed: true, @@ -254,7 +224,6 @@ func resourceRoutingProfileRead(ctx context.Context, d *schema.ResourceData, met } d.Set("queue_configs", queueConfigs) - d.Set("queue_configs_associated", queueConfigs) SetTagsOut(ctx, resp.RoutingProfile.Tags) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index a7eb052a37d2..0eadd572a8d6 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -29,6 +29,7 @@ Upgrade topics: - [Resource: aws_autoscaling_group](#resource-aws_autoscaling_group) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) +- [Resource: aws_connect_routing_profile](#resource-aws_connect_routing_profile) - [Resource: aws_docdb_cluster](#resource-aws_docdb_cluster) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) - [Resource: aws_ec2_client_vpn_network_association](#resource-aws_ec2_client_vpn_network_association) @@ -119,6 +120,10 @@ The `threshold` attribute has been removed. The `ecs_target.propagate_tags` attribute now has no default value. If no value is specified, the tags are not propagated. +## Resource: aws_connect_routing_profile + +The `queue_configs_associated` attribute has been removed. + ## Resource: aws_docdb_cluster Changes to the `snapshot_identifier` attribute will now correctly force re-creation of the resource. Previously, changing this attribute would result in a successful apply, but without the cluster being restored (only the resource state was changed). This change brings behavior of the cluster `snapshot_identifier` attribute into alignment with other RDS resources, such as `aws_db_instance`. From 3ca05f1efeadae7b8932de19ecd293e6e700c386 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:09:34 -0400 Subject: [PATCH 291/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31376.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31376.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31376.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31376.txt From 48e884cf4bd8b55f7d6e29bddd670bd16670116c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:14:15 -0400 Subject: [PATCH 292/304] r/aws_connect_queue: Remove 'quick_connect_ids_associated' attribute. --- .changelog/31376.txt | 4 ++++ internal/service/connect/queue.go | 14 ++++---------- website/docs/guides/version-5-upgrade.html.md | 5 +++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.changelog/31376.txt b/.changelog/31376.txt index 6e93258c9658..39c58b9c4a58 100644 --- a/.changelog/31376.txt +++ b/.changelog/31376.txt @@ -1,3 +1,7 @@ ```release-note:breaking-change resource/aws_connect_routing_profile: The `queue_configs_associated` attribute has been removed +``` + +```release-note:breaking-change +resource/aws_connect_queue: The `quick_connect_ids_associated` attribute has been removed ``` \ No newline at end of file diff --git a/internal/service/connect/queue.go b/internal/service/connect/queue.go index 17f867180048..55a2dba0de25 100644 --- a/internal/service/connect/queue.go +++ b/internal/service/connect/queue.go @@ -29,10 +29,13 @@ func ResourceQueue() *schema.Resource { // Queues do not support deletion today. NoOp the Delete method. // Users can rename their queues manually if they want. DeleteWithoutTimeout: schema.NoopContext, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, + CustomizeDiff: verify.SetTagsDiff, + Schema: map[string]*schema.Schema{ "arn": { Type: schema.TypeString, @@ -96,14 +99,6 @@ func ResourceQueue() *schema.Resource { Type: schema.TypeString, }, }, - "quick_connect_ids_associated": { - Deprecated: "Use the quick_connect_ids instead", - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, "status": { Type: schema.TypeString, Optional: true, @@ -211,8 +206,7 @@ func resourceQueueRead(ctx context.Context, d *schema.ResourceData, meta interfa return diag.FromErr(fmt.Errorf("error finding Connect Queue Quick Connect ID for Queue (%s): %w", queueID, err)) } - d.Set("quick_connect_ids", flex.FlattenStringSet(quickConnectIds)) - d.Set("quick_connect_ids_associated", flex.FlattenStringSet(quickConnectIds)) + d.Set("quick_connect_ids", aws.StringValueSlice(quickConnectIds)) SetTagsOut(ctx, resp.Queue.Tags) diff --git a/website/docs/guides/version-5-upgrade.html.md b/website/docs/guides/version-5-upgrade.html.md index 0eadd572a8d6..820647ced75f 100644 --- a/website/docs/guides/version-5-upgrade.html.md +++ b/website/docs/guides/version-5-upgrade.html.md @@ -29,6 +29,7 @@ Upgrade topics: - [Resource: aws_autoscaling_group](#resource-aws_autoscaling_group) - [Resource: aws_ce_anomaly_subscription](#resource-aws_ce_anomaly_subscription) - [Resource: aws_cloudwatch_event_target](#resource-aws_cloudwatch_event_target) +- [Resource: aws_connect_routing_profile](#resource-aws_connect_queue) - [Resource: aws_connect_routing_profile](#resource-aws_connect_routing_profile) - [Resource: aws_docdb_cluster](#resource-aws_docdb_cluster) - [Resource: aws_ec2_client_vpn_endpoint](#resource-aws_ec2_client_vpn_endpoint) @@ -120,6 +121,10 @@ The `threshold` attribute has been removed. The `ecs_target.propagate_tags` attribute now has no default value. If no value is specified, the tags are not propagated. +## Resource: aws_connect_queue + +The `quick_connect_ids_associated` attribute has been removed. + ## Resource: aws_connect_routing_profile The `queue_configs_associated` attribute has been removed. From 9ccd148d2d5af2490924eb526d680920de768947 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:24:36 -0400 Subject: [PATCH 293/304] generate/tags: Don't generate 'ListOfStringMap' for AutoScaling. --- .../templates/v1/service_tags_slice_body.tmpl | 24 ------------------- .../templates/v2/service_tags_slice_body.tmpl | 24 ------------------- 2 files changed, 48 deletions(-) diff --git a/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl b/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl index 981b885ccb72..396e8347e7e7 100644 --- a/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl @@ -27,30 +27,6 @@ func ListOfMap(tags tftags.KeyValueTags) []any { } {{- end }} -{{ if eq .ServicePackage "autoscaling" }} -// ListOfStringMap returns a list of {{ .ServicePackage }} tags in flattened map of only string values. -// -// Compatible with setting Terraform state for legacy []map[string]string schema. -// Deprecated: Will be removed in a future major version without replacement. -func ListOfStringMap(tags tftags.KeyValueTags) []any { - var result []any - - for _, key := range tags.Keys() { - m := map[string]string{ - "key": key, - "value": aws.StringValue(tags.KeyValue(key)), - {{ if .TagTypeAddBoolElem }} - "{{ .TagTypeAddBoolElemSnake }}": strconv.FormatBool(aws.BoolValue(tags.KeyAdditionalBoolValue(key, "{{ .TagTypeAddBoolElem }}"))), - {{ end }} - } - - result = append(result, m) - } - - return result -} -{{- end }} - {{- if .TagKeyType }} // TagKeys returns {{ .ServicePackage }} service tag keys. func TagKeys(tags tftags.KeyValueTags) []*{{ .TagPackage }}.{{ .TagKeyType }} { diff --git a/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl b/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl index 338df7fae868..7ead97923430 100644 --- a/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl @@ -27,30 +27,6 @@ func ListOfMap(tags tftags.KeyValueTags) []any { } {{- end }} -{{ if eq .ServicePackage "autoscaling" }} -// ListOfStringMap returns a list of {{ .ServicePackage }} tags in flattened map of only string values. -// -// Compatible with setting Terraform state for legacy []map[string]string schema. -// Deprecated: Will be removed in a future major version without replacement. -func ListOfStringMap(tags tftags.KeyValueTags) []any { - var result []any - - for _, key := range tags.Keys() { - m := map[string]string{ - "key": key, - "value": aws.ToString(tags.KeyValue(key)), - {{ if .TagTypeAddBoolElem }} - "{{ .TagTypeAddBoolElemSnake }}": strconv.FormatBool(aws.ToBool(tags.KeyAdditionalBoolValue(key, "{{ .TagTypeAddBoolElem }}"))), - {{ end }} - } - - result = append(result, m) - } - - return result -} -{{- end }} - {{- if .TagKeyType }} // TagKeys returns {{ .ServicePackage }} service tag keys. func TagKeys(tags tftags.KeyValueTags) []*{{ .AWSService }}.{{ .TagKeyType }} { From c8fa7ad699167614370d082954611fb1ab7177dd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:26:55 -0400 Subject: [PATCH 294/304] generate/tags: Don't generate legacy map handling for AutoScaling. --- .../tags/templates/v1/service_tags_slice_body.tmpl | 9 --------- .../tags/templates/v2/service_tags_slice_body.tmpl | 9 --------- 2 files changed, 18 deletions(-) diff --git a/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl b/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl index 396e8347e7e7..b1666346d0ef 100644 --- a/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl @@ -194,15 +194,6 @@ func KeyValueTags(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifi tagData.AdditionalBoolFields["{{ .TagTypeAddBoolElem }}"] = &v } {{- end }} - {{ if eq .ServicePackage "autoscaling" }} - // Deprecated: Legacy map handling - {{- if .TagTypeAddBoolElem }} - if v, ok := tfMap["{{ .TagTypeAddBoolElemSnake }}"].(string); ok { - b, _ := strconv.ParseBool(v) - tagData.AdditionalBoolFields["{{ .TagTypeAddBoolElem }}"] = &b - } - {{- end }} - {{- end }} {{- end }} {{ if .TagTypeIDElem }} diff --git a/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl b/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl index 7ead97923430..c701a32b4b2c 100644 --- a/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl @@ -194,15 +194,6 @@ func KeyValueTags(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifi tagData.AdditionalBoolFields["{{ .TagTypeAddBoolElem }}"] = &v } {{- end }} - {{ if eq .ServicePackage "autoscaling" }} - // Deprecated: Legacy map handling - {{- if .TagTypeAddBoolElem }} - if v, ok := tfMap["{{ .TagTypeAddBoolElemSnake }}"].(string); ok { - b, _ := strconv.ParseBool(v) - tagData.AdditionalBoolFields["{{ .TagTypeAddBoolElem }}"] = &b - } - {{- end }} - {{- end }} {{- end }} {{ if .TagTypeIDElem }} From 172e81c9c471cdd924bfe775359fe129fc0c934f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:28:13 -0400 Subject: [PATCH 295/304] Run 'make gen'. --- internal/service/autoscaling/tags_gen.go | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/internal/service/autoscaling/tags_gen.go b/internal/service/autoscaling/tags_gen.go index a7eef938c205..2fd40ef37291 100644 --- a/internal/service/autoscaling/tags_gen.go +++ b/internal/service/autoscaling/tags_gen.go @@ -115,27 +115,6 @@ func ListOfMap(tags tftags.KeyValueTags) []any { return result } -// ListOfStringMap returns a list of autoscaling tags in flattened map of only string values. -// -// Compatible with setting Terraform state for legacy []map[string]string schema. -// Deprecated: Will be removed in a future major version without replacement. -func ListOfStringMap(tags tftags.KeyValueTags) []any { - var result []any - - for _, key := range tags.Keys() { - m := map[string]string{ - "key": key, - "value": aws.StringValue(tags.KeyValue(key)), - - "propagate_at_launch": strconv.FormatBool(aws.BoolValue(tags.KeyAdditionalBoolValue(key, "PropagateAtLaunch"))), - } - - result = append(result, m) - } - - return result -} - // Tags returns autoscaling service tags. func Tags(tags tftags.KeyValueTags) []*autoscaling.Tag { var result []*autoscaling.Tag @@ -228,12 +207,6 @@ func KeyValueTags(ctx context.Context, tags any, identifier, resourceType string tagData.AdditionalBoolFields["PropagateAtLaunch"] = &v } - // Deprecated: Legacy map handling - if v, ok := tfMap["propagate_at_launch"].(string); ok { - b, _ := strconv.ParseBool(v) - tagData.AdditionalBoolFields["PropagateAtLaunch"] = &b - } - tagData.AdditionalStringFields = make(map[string]*string) tagData.AdditionalStringFields["ResourceId"] = &identifier tagData.AdditionalStringFields["ResourceType"] = &resourceType From 3f0754a2933ed9f4c859c90ca52b8224d1e60b65 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:38:40 -0400 Subject: [PATCH 296/304] generate/tags: Don't import 'strconv'. --- internal/generate/tags/main.go | 2 -- internal/generate/tags/templates/v1/header_body.tmpl | 3 --- internal/generate/tags/templates/v2/header_body.tmpl | 3 --- 3 files changed, 8 deletions(-) diff --git a/internal/generate/tags/main.go b/internal/generate/tags/main.go index ec7416224c8b..27f778f36ee8 100644 --- a/internal/generate/tags/main.go +++ b/internal/generate/tags/main.go @@ -169,7 +169,6 @@ type TemplateData struct { InternalTypesPkg bool NamesPkg bool SkipTypesImp bool - StrConvPkg bool TfResourcePkg bool } @@ -249,7 +248,6 @@ func main() { InternalTypesPkg: *listTags || *serviceTagsMap || *serviceTagsSlice, NamesPkg: *updateTags && !*skipNamesImp, SkipTypesImp: *skipTypesImp, - StrConvPkg: awsPkg == "autoscaling", TfResourcePkg: *getTag, CreateTagsFunc: createTagsFunc, diff --git a/internal/generate/tags/templates/v1/header_body.tmpl b/internal/generate/tags/templates/v1/header_body.tmpl index c7a8560e8453..96235cae3033 100644 --- a/internal/generate/tags/templates/v1/header_body.tmpl +++ b/internal/generate/tags/templates/v1/header_body.tmpl @@ -6,9 +6,6 @@ import ( {{- if .FmtPkg }} "fmt" {{- end }} - {{- if .StrConvPkg }} - "strconv" - {{- end }} "github.com/aws/aws-sdk-go/aws" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" diff --git a/internal/generate/tags/templates/v2/header_body.tmpl b/internal/generate/tags/templates/v2/header_body.tmpl index 682b40a454de..59dabbd40891 100644 --- a/internal/generate/tags/templates/v2/header_body.tmpl +++ b/internal/generate/tags/templates/v2/header_body.tmpl @@ -6,9 +6,6 @@ import ( {{- if .FmtPkg }} "fmt" {{- end }} - {{- if .StrConvPkg }} - "strconv" - {{- end }} "github.com/aws/aws-sdk-go-v2/aws" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" From 18a1e3ad2a56b97e662ff6ffed51530b2c42a699 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 11:39:40 -0400 Subject: [PATCH 297/304] Run 'make gen'. --- internal/service/autoscaling/tags_gen.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/autoscaling/tags_gen.go b/internal/service/autoscaling/tags_gen.go index 2fd40ef37291..96b4b2983f2f 100644 --- a/internal/service/autoscaling/tags_gen.go +++ b/internal/service/autoscaling/tags_gen.go @@ -4,7 +4,6 @@ package autoscaling import ( "context" "fmt" - "strconv" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" From 672080afdfdfe213335d81eb438f6bfd99d488ca Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 12 May 2023 15:54:19 +0000 Subject: [PATCH 298/304] Update CHANGELOG.md for #31376 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fe3ce4f53d6..212ef6d3e45e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ BREAKING CHANGES: * resource/aws_autoscaling_group: Remove deprecated `tags` attribute ([#30842](https://github.com/hashicorp/terraform-provider-aws/issues/30842)) * resource/aws_ce_anomaly_subscription: The `threshold` attribute has been removed ([#30374](https://github.com/hashicorp/terraform-provider-aws/issues/30374)) * resource/aws_cloudwatch_event_target: The `ecs_target.propagate_tags` attribute now has no default value ([#25233](https://github.com/hashicorp/terraform-provider-aws/issues/25233)) +* resource/aws_connect_queue: The `quick_connect_ids_associated` attribute has been removed ([#31376](https://github.com/hashicorp/terraform-provider-aws/issues/31376)) +* resource/aws_connect_routing_profile: The `queue_configs_associated` attribute has been removed ([#31376](https://github.com/hashicorp/terraform-provider-aws/issues/31376)) * resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed ([#30966](https://github.com/hashicorp/terraform-provider-aws/issues/30966)) * resource/aws_dms_endpoint: `s3_settings.ignore_headers_row` has been removed ([#30452](https://github.com/hashicorp/terraform-provider-aws/issues/30452)) From 7925ba50c3f7c039846d08acb985ce080f43c915 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 12:06:03 -0400 Subject: [PATCH 299/304] r/aws_ssm_association: Call out deprecation of 'instance_id'. --- .changelog/#####.txt | 3 +++ website/docs/r/ssm_association.html.markdown | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..519f36b0a59f --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_ssm_association: The `instance_id` attribute has been deprecated. All configurations using `instance_id` should be updated to use the `targets` attribute instead +``` \ No newline at end of file diff --git a/website/docs/r/ssm_association.html.markdown b/website/docs/r/ssm_association.html.markdown index 4e4aca7b1ce1..cead112886e5 100644 --- a/website/docs/r/ssm_association.html.markdown +++ b/website/docs/r/ssm_association.html.markdown @@ -87,7 +87,7 @@ The following arguments are supported: * `apply_only_at_cron_interval` - (Optional) By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`. * `association_name` - (Optional) The descriptive name for the association. * `document_version` - (Optional) The document version you want to associate with the target(s). Can be a specific version or the default version. -* `instance_id` - (Optional) The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. +* `instance_id` - (Optional, **Deprecated**) The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. * `output_location` - (Optional) An output location block. Output Location is documented below. * `parameters` - (Optional) A block of arbitrary string parameters to pass to the SSM document. * `schedule_expression` - (Optional) A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs. From 42968e06a682e072d6bc9dd487bd731aac2c10d4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 12:09:05 -0400 Subject: [PATCH 300/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31380.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31380.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31380.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31380.txt From ff449b4cca2a63e51686cd33082ef87183637869 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 12 May 2023 17:05:17 +0000 Subject: [PATCH 301/304] Update CHANGELOG.md for #31380 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 212ef6d3e45e..7341d7d551c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,7 @@ NOTES: * resource/aws_rds_cluster_instance: Configurations not including the `engine` argument must be updated to include `engine` as it is now required. Previously, not including `engine` was equivalent to `engine = "aurora"` and created a MySQL-5.6-compatible cluster instance ([#31112](https://github.com/hashicorp/terraform-provider-aws/issues/31112)) * resource/aws_route: Since `instance_id` can no longer be set in configurations, use `network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) * resource/aws_route_table: Since `route.*.instance_id` can no longer be set in configurations, use `route.*.network_interface_id` instead. For example, set `network_interface_id` to `aws_instance.test.primary_network_interface_id`. ([#30804](https://github.com/hashicorp/terraform-provider-aws/issues/30804)) +* resource/aws_ssm_association: The `instance_id` attribute has been deprecated. All configurations using `instance_id` should be updated to use the `targets` attribute instead ([#31380](https://github.com/hashicorp/terraform-provider-aws/issues/31380)) ENHANCEMENTS: From 67277a230b30f092f415f0e7508cacc71a2c761e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 13:28:13 -0400 Subject: [PATCH 302/304] r/aws_flow_log: Call out deprecation of 'log_group_name'. --- .changelog/#####.txt | 3 +++ website/docs/r/flow_log.html.markdown | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/#####.txt diff --git a/.changelog/#####.txt b/.changelog/#####.txt new file mode 100644 index 000000000000..bea5608becb8 --- /dev/null +++ b/.changelog/#####.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_flow_log: The `log_group_name` attribute has been deprecated. All configurations using `log_group_name` should be updated to use the `log_destination` attribute instead +``` \ No newline at end of file diff --git a/website/docs/r/flow_log.html.markdown b/website/docs/r/flow_log.html.markdown index 5398fbcd5632..eb7e96c86b0d 100644 --- a/website/docs/r/flow_log.html.markdown +++ b/website/docs/r/flow_log.html.markdown @@ -186,7 +186,7 @@ The following arguments are supported: * `iam_role_arn` - (Optional) The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs log group * `log_destination_type` - (Optional) The type of the logging destination. Valid values: `cloud-watch-logs`, `s3`, `kinesis-data-firehose`. Default: `cloud-watch-logs`. * `log_destination` - (Optional) The ARN of the logging destination. Either `log_destination` or `log_group_name` must be set. -* `log_group_name` - (Optional) *Deprecated:* Use `log_destination` instead. The name of the CloudWatch log group. Either `log_group_name` or `log_destination` must be set. +* `log_group_name` - (Optional) **Deprecated:** Use `log_destination` instead. The name of the CloudWatch log group. Either `log_group_name` or `log_destination` must be set. * `subnet_id` - (Optional) Subnet ID to attach to * `transit_gateway_id` - (Optional) Transit Gateway ID to attach to * `transit_gateway_attachment_id` - (Optional) Transit Gateway Attachment ID to attach to From 4c935bc4b70e1e08a5e1997f47bbbc0123661491 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 12 May 2023 13:31:10 -0400 Subject: [PATCH 303/304] Correct CHANGELOG entry file name. --- .changelog/{#####.txt => 31382.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{#####.txt => 31382.txt} (100%) diff --git a/.changelog/#####.txt b/.changelog/31382.txt similarity index 100% rename from .changelog/#####.txt rename to .changelog/31382.txt From 5a64df45232859d7713df54bc3032fd139e5c510 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 12 May 2023 17:35:20 +0000 Subject: [PATCH 304/304] Update CHANGELOG.md for #31382 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7341d7d551c2..6c43fa1d49cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,7 @@ NOTES: * resource/aws_elasticache_replication_group: Update configurations to use `num_cache_clusters` instead of the `number_cache_clusters` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use `preferred_cache_cluster_azs` instead of the `availability_zones` argument ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) * resource/aws_elasticache_replication_group: Update configurations to use top-level `num_node_groups` and `replicas_per_node_group` instead of `cluster_mode.0.num_node_groups` and `cluster_mode.0.replicas_per_node_group`, respectively ([#31008](https://github.com/hashicorp/terraform-provider-aws/issues/31008)) +* resource/aws_flow_log: The `log_group_name` attribute has been deprecated. All configurations using `log_group_name` should be updated to use the `log_destination` attribute instead ([#31382](https://github.com/hashicorp/terraform-provider-aws/issues/31382)) * resource/aws_guardduty_organization_configuration: The `auto_enable` argument has been deprecated. Use the `auto_enable_organization_members` argument instead. ([#30736](https://github.com/hashicorp/terraform-provider-aws/issues/30736)) * resource/aws_neptune_cluster: Changes to the `snapshot_identifier` attribute will now trigger a replacement, rather than an in-place update. This corrects the previous behavior which resulted in a successful apply, but did not actually restore the cluster from the designated snapshot. ([#29409](https://github.com/hashicorp/terraform-provider-aws/issues/29409)) * resource/aws_networkmanager_core_network: Update configurations to use the `aws_networkmanager_core_network_policy_attachment` resource instead of the `policy_document` argument ([#30875](https://github.com/hashicorp/terraform-provider-aws/issues/30875))